aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile/qml/DiveDetails.qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-29 06:14:18 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-29 15:41:58 -0800
commite39e9eee3ba1a8192c2a643b0ecafc5e139c39f8 (patch)
tree207b909636df182b7e1d97e6460ecda263ee827b /qt-mobile/qml/DiveDetails.qml
parent84769dc2f6faba46c9d2b0c2442792da0ddd653e (diff)
downloadsubsurface-e39e9eee3ba1a8192c2a643b0ecafc5e139c39f8.tar.gz
QML UI: present an undo dialog after delete
The dialog gives the user 3 seconds to undo the delete and then disappears without any user interaction. This isn't hooked up, yet. 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, 15 insertions, 1 deletions
diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml
index 83a8b3a93..43b6c5e88 100644
--- a/qt-mobile/qml/DiveDetails.qml
+++ b/qt-mobile/qml/DiveDetails.qml
@@ -25,6 +25,7 @@ MobileComponents.Page {
property alias startpressure: detailsEdit.startpressureText
property alias endpressure: detailsEdit.endpressureText
property alias gasmix: detailsEdit.gasmixText
+ property QtObject notificationComponent
state: "view"
@@ -63,8 +64,13 @@ MobileComponents.Page {
iconName: "trash-empty"
onTriggered: {
manager.deleteDive(diveDetailsListView.currentItem.modelData.dive.id)
- stackView.pop()
+ var notification = notificationComponent.createObject(contentItem.parent);
+ notification.showNotification("Dive deleted", 3000, "Undo",
+ function() {
+ print("now I need to undo!")
+ });
contextDrawer.close()
+ stackView.pop()
}
}
]
@@ -187,4 +193,12 @@ MobileComponents.Page {
id: detailsEdit
}
}
+ Component.onCompleted: {
+ notificationComponent = Qt.createComponent("PassiveNotification.qml");
+ if( notificationComponent.status != Component.Ready ) {
+ print("notificationComponent isn't ready with status " + notificationComponent.status)
+ if( notificationComponent.status == Component.Error )
+ print("Error:"+ notificationComponent.errorString() );
+ }
+ }
}