diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-06-17 23:22:37 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-06-17 23:22:37 -0700 |
commit | b2b51c833a2c6f71fe411b5f99ccbf3107ef9677 (patch) | |
tree | db7a3bf3ddb6450a6c4514d684f4b03c9c97f4cf /mobile-widgets/qml/main.qml | |
parent | 2d5f023b5811ffde028d5c9b680cd99f9f1448f9 (diff) | |
download | subsurface-b2b51c833a2c6f71fe411b5f99ccbf3107ef9677.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/main.qml')
-rw-r--r-- | mobile-widgets/qml/main.qml | 18 |
1 files changed, 7 insertions, 11 deletions
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(); } } |