diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-02-29 06:53:26 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-02-29 15:42:33 -0800 |
commit | abab031ed2547d3bc9183a6e7c4c090ad0548463 (patch) | |
tree | a55139035a68ec802bc3fbab2924944af5aa50d3 /qt-mobile/qml/DiveDetails.qml | |
parent | e39e9eee3ba1a8192c2a643b0ecafc5e139c39f8 (diff) | |
download | subsurface-abab031ed2547d3bc9183a6e7c4c090ad0548463.tar.gz |
QML UI: implement undelete
This code is very similar to the undo code in the desktop UI, but
untangling that from the desktop seemed massive overkill; we don't have
lists of dives to delete and undelete here - so this is actually much
simpler and easier to maintain (I hope).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qml/DiveDetails.qml')
-rw-r--r-- | qt-mobile/qml/DiveDetails.qml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml index 43b6c5e88..c5fb0e4f0 100644 --- a/qt-mobile/qml/DiveDetails.qml +++ b/qt-mobile/qml/DiveDetails.qml @@ -63,11 +63,12 @@ MobileComponents.Page { text: "Delete dive" iconName: "trash-empty" onTriggered: { - manager.deleteDive(diveDetailsListView.currentItem.modelData.dive.id) + var deletedId = diveDetailsListView.currentItem.modelData.dive.id + manager.deleteDive(deletedId) var notification = notificationComponent.createObject(contentItem.parent); notification.showNotification("Dive deleted", 3000, "Undo", function() { - print("now I need to undo!") + manager.undoDelete(deletedId) }); contextDrawer.close() stackView.pop() |