use the global showPassiveNotification function

don't create a local PassiveNotification copy,
use the global show/hidePassiveNotification from
ApplicationWindow, now that it works

Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Marco Martin 2016-03-03 19:35:33 +01:00 committed by Dirk Hohndel
parent 93f9bcd041
commit d24e5b455f
3 changed files with 4 additions and 18 deletions

View file

@ -25,7 +25,6 @@ MobileComponents.Page {
property alias startpressure: detailsEdit.startpressureText
property alias endpressure: detailsEdit.endpressureText
property alias gasmix: detailsEdit.gasmixText
property QtObject notificationComponent
state: "view"
@ -65,8 +64,7 @@ MobileComponents.Page {
onTriggered: {
var deletedId = diveDetailsListView.currentItem.modelData.dive.id
manager.deleteDive(deletedId)
var notification = notificationComponent.createObject(contentItem.parent);
notification.showNotification("Dive deleted", 3000, "Undo",
showPassiveNotification("Dive deleted", 3000, "Undo",
function() {
manager.undoDelete(deletedId)
});
@ -194,12 +192,4 @@ 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() );
}
}
}