From b2b51c833a2c6f71fe411b5f99ccbf3107ef9677 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 17 Jun 2017 23:22:37 -0700 Subject: QML UI: redesign the user notification The old system of cloud access updates with fake percentages just wasn't helpful. Even worse, it hid a lot important information from the user. This should be more useful (but it will require that we localize the messages sent from the git progress notifications and make them more 'user ready'). Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/main.qml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 5a5d7d20e..d3d102f99 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -19,23 +19,19 @@ Kirigami.ApplicationWindow { } property bool fullscreen: true property alias oldStatus: manager.oldStatus - property alias accessingCloud: manager.accessingCloud + property alias notificationText: manager.notificationText property QtObject notification: null property bool showingDiveList: false property alias syncToCloud: manager.syncToCloud property alias showPin: manager.showPin - 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); - } 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); + onNotificationTextChanged: { + if (notificationText != "") { + // there's a risk that we have a >5 second gap in update events; + // still, keep the timeout at 5s to avoid odd unchanging notifications + showPassiveNotification(notificationText, 5000) } else { + // hiding the notification right away may be a mistake as it hides the last warning / error hidePassiveNotification(); } } -- cgit v1.2.3-70-g09d2