mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
e39e9eee3b
commit
abab031ed2
3 changed files with 59 additions and 3 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue