From 660f421d6d690f363893e8ca0edcd8203df73582 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 19 Apr 2016 10:27:18 -0700 Subject: QML UI: correctly show if we are accessing remote or local storage This makes sure that if the user switches to offline mode they don't get incorrect notifications that tell them that they are accessing cloud storage. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/main.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mobile-widgets/qml/main.qml') diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 8497e7e53..06e691eee 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -22,10 +22,15 @@ Kirigami.ApplicationWindow { property bool showingDiveList: false property alias syncToCloud: manager.syncToCloud onAccessingCloudChanged: { + // >= 0 for updating cloud, -1 for hide, < -1 for local storage if (accessingCloud >= 0) { // we now keep updating this to show progress, so timing out after 30 seconds is more useful // but should still be very conservative - showPassiveNotification("Accessing Subsurface Cloud Storage " + accessingCloud +"%", 30000); + showPassiveNotification("Accessing Subsurface cloud storage " + accessingCloud +"%", 30000); + } else if (accessingCloud < -1) { + // local storage should be much faster, so timeout of 5 seconds + // the offset of 2 is so that things start 0 again + showPassiveNotification("Accessing local storage " + -(accessingCloud + 2) +"%", 5000); } else { hidePassiveNotification(); } -- cgit v1.2.3-70-g09d2