From abab031ed2547d3bc9183a6e7c4c090ad0548463 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 29 Feb 2016 06:53:26 -0800 Subject: 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 --- qt-mobile/qml/DiveDetails.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qt-mobile/qml/DiveDetails.qml') 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() -- cgit v1.2.3-70-g09d2