diff options
Diffstat (limited to 'qt-mobile/qml')
-rw-r--r-- | qt-mobile/qml/DiveDetails.qml | 16 | ||||
-rw-r--r-- | qt-mobile/qml/mobile-resources.qrc | 1 |
2 files changed, 16 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() ); + } + } } diff --git a/qt-mobile/qml/mobile-resources.qrc b/qt-mobile/qml/mobile-resources.qrc index 77a78c918..a96910494 100644 --- a/qt-mobile/qml/mobile-resources.qrc +++ b/qt-mobile/qml/mobile-resources.qrc @@ -22,6 +22,7 @@ <file alias="context-menu.png">icons/context-menu.png</file> <file alias="menu-edit.png">icons/menu-edit.png</file> <file alias="menu-back.png">icons/menu-back.png</file> + <file alias="PassiveNotification.qml">mobilecomponents/private/PassiveNotification.qml</file> </qresource> <qresource prefix="/imports"> <file alias="org/kde/plasma/mobilecomponents/qmldir">mobilecomponents/qmldir</file> |