aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Marco Martin <notmart@gmail.com>2016-03-03 19:35:33 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-03 10:44:41 -0800
commitd24e5b455f4c52c59fe70f047f9ca0a6c30fcaa6 (patch)
tree6d6a62c371b05677adb6d3900ddfb842988a2f61
parent93f9bcd0411770c52cc1e0d356b5da03729c253e (diff)
downloadsubsurface-d24e5b455f4c52c59fe70f047f9ca0a6c30fcaa6.tar.gz
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>
-rw-r--r--qt-mobile/qml/DiveDetails.qml12
-rw-r--r--qt-mobile/qml/main.qml8
-rw-r--r--qt-mobile/qml/mobile-resources.qrc2
3 files changed, 4 insertions, 18 deletions
diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml
index c5fb0e4f0..19a3466db 100644
--- a/qt-mobile/qml/DiveDetails.qml
+++ b/qt-mobile/qml/DiveDetails.qml
@@ -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() );
- }
- }
}
diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml
index 19655e7e5..6e9bb767c 100644
--- a/qt-mobile/qml/main.qml
+++ b/qt-mobile/qml/main.qml
@@ -13,17 +13,13 @@ MobileComponents.ApplicationWindow {
title: qsTr("Subsurface-mobile")
property bool fullscreen: true
property int oldStatus: -1
- property alias sharedNotificationComponent: detailsWindow.notificationComponent
property alias accessingCloud: manager.accessingCloud
property QtObject notification: null
onAccessingCloudChanged: {
if (accessingCloud) {
- notification = sharedNotificationComponent.createObject(rootItem);
- notification.showNotification("Accessing Subsurface Cloud Storage", 5000);
+ showPassiveNotification("Accessing Subsurface Cloud Storage", 5000);
} else {
- if (notification) {
- notification.hideNotification();
- }
+ hidePassiveNotification();
}
}
diff --git a/qt-mobile/qml/mobile-resources.qrc b/qt-mobile/qml/mobile-resources.qrc
index a96910494..1039e9c32 100644
--- a/qt-mobile/qml/mobile-resources.qrc
+++ b/qt-mobile/qml/mobile-resources.qrc
@@ -22,7 +22,6 @@
<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>
@@ -45,6 +44,7 @@
<file alias="org/kde/plasma/mobilecomponents/private/ActionButtonArrow.qml">mobilecomponents/private/ActionButtonArrow.qml</file>
<file alias="org/kde/plasma/mobilecomponents/private/AbstractDrawer.qml">mobilecomponents/private/AbstractDrawer.qml</file>
<file alias="org/kde/plasma/mobilecomponents/private/PageStack.js">mobilecomponents/private/PageStack.js</file>
+ <file alias="org/kde/plasma/mobilecomponents/private/PassiveNotification.qml">mobilecomponents/private/PassiveNotification.qml</file>
<file alias="org/kde/plasma/mobilecomponents/icons/go-next.svg">mobilecomponents/icons/go-next.svg</file>
<file alias="org/kde/plasma/mobilecomponents/icons/go-previous.svg">mobilecomponents/icons/go-previous.svg</file>
<file alias="org/kde/plasma/mobilecomponents/icons/distribute-horizontal-x.svg">mobilecomponents/icons/distribute-horizontal-x.svg</file>