diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-04-22 05:21:26 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-04-22 11:59:16 -0700 |
commit | 8946edfd922c6e3abde9d52f25e4818207a0f508 (patch) | |
tree | 2130e6796e675b33110ec2fe8983892b3d6e1a00 /mobile-widgets | |
parent | 27fccbbe4ea21ef4723ded4e01d5ea0df67fb61f (diff) | |
download | subsurface-8946edfd922c6e3abde9d52f25e4818207a0f508.tar.gz |
QML UI: adapt "Manage dives" to no cloud status
If we are in no cloud mode
- allow adding dives via the menu
- enabling / disabling automatic sync makes no sense.
- if the user wants to manually sync the cloud, they need to first enter
credentials.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/main.qml | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 858e9d003..ad3f68e37 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -134,7 +134,7 @@ Kirigami.ApplicationWindow { */ Kirigami.Action { text: "Add dive manually" - enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL + enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL || manager.credentialStatus === QMLManager.NOCLOUD onTriggered: { returnTopPage() // otherwise odd things happen with the page stack startAddDive() @@ -142,16 +142,25 @@ Kirigami.ApplicationWindow { } Kirigami.Action { text: "Manual sync with cloud" - enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL + enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL || manager.credentialStatus === QMLManager.NOCLOUD onTriggered: { - globalDrawer.close() - detailsWindow.endEditMode() - manager.saveChangesCloud(true); - globalDrawer.close() + if (manager.credentialStatus === QMLManager.NOCLOUD) { + returnTopPage() + oldStatus = manager.credentialStatus + manager.startPageText = "Enter valid cloud storage credentials" + manager.credentialStatus = QMLManager.UNKNOWN + globalDrawer.close() + } else { + globalDrawer.close() + detailsWindow.endEditMode() + manager.saveChangesCloud(true); + globalDrawer.close() + } } } Kirigami.Action { text: syncToCloud ? "Offline mode" : "Enable auto cloud sync" + enabled: manager.credentialStatus !== QMLManager.NOCLOUD onTriggered: { syncToCloud = !syncToCloud if (!syncToCloud) { |