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>
This commit is contained in:
Dirk Hohndel 2016-02-29 06:53:26 -08:00
parent e39e9eee3b
commit abab031ed2
3 changed files with 59 additions and 3 deletions

View file

@ -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()