summaryrefslogtreecommitdiffstats
path: root/qt-mobile/qml/DiveDetails.qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-13 21:25:10 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-13 21:25:10 -0800
commit0ce1dd80cc4752764e54b2a64e8bc9641b297239 (patch)
tree4beedb013c80c76d18df32a952ecc65d77dd9891 /qt-mobile/qml/DiveDetails.qml
parent5952b09b51b84fa1367a8013e1d5df4cb46e2c5d (diff)
downloadsubsurface-0ce1dd80cc4752764e54b2a64e8bc9641b297239.tar.gz
QML UI: change the dive add/edit action button to be save
Remove the button on the page and instead use the action button to save and the back key to cancel. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qml/DiveDetails.qml')
-rw-r--r--qt-mobile/qml/DiveDetails.qml16
1 files changed, 9 insertions, 7 deletions
diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml
index c906ba268..a8db2990c 100644
--- a/qt-mobile/qml/DiveDetails.qml
+++ b/qt-mobile/qml/DiveDetails.qml
@@ -74,12 +74,10 @@ MobileComponents.Page {
]
*/
mainAction: Action {
- iconName: state !== "view" ? "dialog-cancel" : "document-edit"
+ iconName: state !== "view" ? "document-save" : "document-edit"
onTriggered: {
- if (state === "edit") {
- endEditMode()
- } else if (state === "add") {
- endAddMode()
+ if (state === "edit" || state === "add") {
+ detailsEdit.saveData()
} else {
startEditMode()
}
@@ -87,10 +85,14 @@ MobileComponents.Page {
}
onBackRequested: {
- if (state === "edit" || state === "add") {
- endEditMode();
+ if (state === "edit") {
+ endEditMode()
+ event.accepted = true;
+ } else if (state === "add") {
+ endAddMode()
event.accepted = true;
}
+ // if we were in view mode, don't accept the event and pop the page
}
function showDiveIndex(index) {