diff options
author | Henrik Brautaset Aronsen <subsurface@henrik.synth.no> | 2016-02-07 22:23:07 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-02-07 13:56:46 -0800 |
commit | 47403588e5241368c43dd407090b1be214b56252 (patch) | |
tree | 1e4bf425e0ffd722ffdc0147a8d21984a3d718d9 /qt-mobile/qml/DiveDetails.qml | |
parent | d9763100940cbcff297d88a0f1597ba7bd07ea01 (diff) | |
download | subsurface-47403588e5241368c43dd407090b1be214b56252.tar.gz |
Move endEditMode() to DiveDetails.qml
Having endEditMode() in main.qml seemed wrong somehow.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qml/DiveDetails.qml')
-rw-r--r-- | qt-mobile/qml/DiveDetails.qml | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml index b2744ec1e..7fc2a8be9 100644 --- a/qt-mobile/qml/DiveDetails.qml +++ b/qt-mobile/qml/DiveDetails.qml @@ -47,9 +47,7 @@ MobileComponents.Page { iconName: state !== "view" ? "dialog-cancel" : "document-edit" onTriggered: { if (state === "edit") { - // just cancel the edit state - state = "view" - Qt.inputMethod.hide() + endEditMode() } else if (state === "add") { // edit was canceled - so remove the dive from the dive list manager.addDiveAborted(dive_id) @@ -66,6 +64,12 @@ MobileComponents.Page { diveDetailsListView.positionViewAtIndex(index, ListView.Beginning); } + function endEditMode() { + // just cancel the edit state + state = "view"; + Qt.inputMethod.hide(); + } + function startEditMode() { // set things up for editing - so make sure that the detailsEdit has // all the right data (using the property aliases set up above) |