mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
93f9bcd041
commit
d24e5b455f
3 changed files with 4 additions and 18 deletions
|
@ -25,7 +25,6 @@ MobileComponents.Page {
|
||||||
property alias startpressure: detailsEdit.startpressureText
|
property alias startpressure: detailsEdit.startpressureText
|
||||||
property alias endpressure: detailsEdit.endpressureText
|
property alias endpressure: detailsEdit.endpressureText
|
||||||
property alias gasmix: detailsEdit.gasmixText
|
property alias gasmix: detailsEdit.gasmixText
|
||||||
property QtObject notificationComponent
|
|
||||||
|
|
||||||
state: "view"
|
state: "view"
|
||||||
|
|
||||||
|
@ -65,8 +64,7 @@ MobileComponents.Page {
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
var deletedId = diveDetailsListView.currentItem.modelData.dive.id
|
var deletedId = diveDetailsListView.currentItem.modelData.dive.id
|
||||||
manager.deleteDive(deletedId)
|
manager.deleteDive(deletedId)
|
||||||
var notification = notificationComponent.createObject(contentItem.parent);
|
showPassiveNotification("Dive deleted", 3000, "Undo",
|
||||||
notification.showNotification("Dive deleted", 3000, "Undo",
|
|
||||||
function() {
|
function() {
|
||||||
manager.undoDelete(deletedId)
|
manager.undoDelete(deletedId)
|
||||||
});
|
});
|
||||||
|
@ -194,12 +192,4 @@ MobileComponents.Page {
|
||||||
id: detailsEdit
|
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() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,17 +13,13 @@ MobileComponents.ApplicationWindow {
|
||||||
title: qsTr("Subsurface-mobile")
|
title: qsTr("Subsurface-mobile")
|
||||||
property bool fullscreen: true
|
property bool fullscreen: true
|
||||||
property int oldStatus: -1
|
property int oldStatus: -1
|
||||||
property alias sharedNotificationComponent: detailsWindow.notificationComponent
|
|
||||||
property alias accessingCloud: manager.accessingCloud
|
property alias accessingCloud: manager.accessingCloud
|
||||||
property QtObject notification: null
|
property QtObject notification: null
|
||||||
onAccessingCloudChanged: {
|
onAccessingCloudChanged: {
|
||||||
if (accessingCloud) {
|
if (accessingCloud) {
|
||||||
notification = sharedNotificationComponent.createObject(rootItem);
|
showPassiveNotification("Accessing Subsurface Cloud Storage", 5000);
|
||||||
notification.showNotification("Accessing Subsurface Cloud Storage", 5000);
|
|
||||||
} else {
|
} else {
|
||||||
if (notification) {
|
hidePassiveNotification();
|
||||||
notification.hideNotification();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
<file alias="context-menu.png">icons/context-menu.png</file>
|
<file alias="context-menu.png">icons/context-menu.png</file>
|
||||||
<file alias="menu-edit.png">icons/menu-edit.png</file>
|
<file alias="menu-edit.png">icons/menu-edit.png</file>
|
||||||
<file alias="menu-back.png">icons/menu-back.png</file>
|
<file alias="menu-back.png">icons/menu-back.png</file>
|
||||||
<file alias="PassiveNotification.qml">mobilecomponents/private/PassiveNotification.qml</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/imports">
|
<qresource prefix="/imports">
|
||||||
<file alias="org/kde/plasma/mobilecomponents/qmldir">mobilecomponents/qmldir</file>
|
<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/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/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/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-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/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>
|
<file alias="org/kde/plasma/mobilecomponents/icons/distribute-horizontal-x.svg">mobilecomponents/icons/distribute-horizontal-x.svg</file>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue