Changeset 825afb4 in subsurface


Ignore:
Timestamp:
Dec 18, 2017, 6:23:23 AM (5 weeks ago)
Author:
Jan Mulder <jlmulder@…>
Branches:
master
Children:
5e116db
Parents:
7b88f830
git-author:
Jan Mulder <jlmulder@…> (12/18/17 05:37:02)
git-committer:
Jan Mulder <jlmulder@…> (12/18/17 06:23:23)
Message:

mobile: exit edit mode when navigating away from edit page

Navigating using the breadcrumb in the header did leave the
dive detail edit (and add) mode in such a way that (for example)
navigation in the dive list was suspended. Obviously, it is
debatable what should be done. Saving the edits/add, or
cancelling them. For now, this commit cancels them
silently. This is the exact same thing that is happening when
the user selects the dive list from the drawer menu.

Fixes: #932

Signed-off-by: Jan Mulder <jlmulder@…>

Location:
mobile-widgets/qml
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mobile-widgets/qml/DiveDetails.qml

    ref543da5 r825afb4  
    99Kirigami.Page {
    1010        id: diveDetailsPage // but this is referenced as detailsWindow
     11        objectName: "DiveDetails"
    1112        property alias currentIndex: diveDetailsListView.currentIndex
    1213        property alias currentItem: diveDetailsListView.currentItem
  • mobile-widgets/qml/main.qml

    r62ef78b r825afb4  
    2020                maximumHeight: Kirigami.Units.gridUnit * 2
    2121        }
     22
    2223        property alias oldStatus: manager.oldStatus
    2324        property alias notificationText: manager.notificationText
     
    437438                        }
    438439                }
    439 
     440        }
     441
     442        pageStack.onCurrentItemChanged: {
     443        // This is called whenever the user navigates using the breadcrumbs in the header
     444
     445                // In case we land on any page, not being the DiveDetails (which can be
     446                // in multiple states, such as add, edit or view), just end the edit/add mode
     447                if (pageStack.currentItem.objectName !== "DiveDetails" &&
     448                                (detailsWindow.state === 'edit' || detailsWindow.state === 'add')) {
     449                                detailsWindow.endEditMode()
     450                }
    440451        }
    441452
Note: See TracChangeset for help on using the changeset viewer.