mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
2d5f023b58
commit
b2b51c833a
9 changed files with 106 additions and 130 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue