summaryrefslogtreecommitdiffstats
path: root/qt-mobile/qml/main.qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-03 18:33:40 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-04 14:18:41 -0700
commitbb74144860b14d23f26ebd3dd72e4654342282ae (patch)
treeb61f9b3406452e2722f9fc77cecfb642ed819e73 /qt-mobile/qml/main.qml
parent616842c8c00654718ba3390b055eb946aaa4cff4 (diff)
downloadsubsurface-bb74144860b14d23f26ebd3dd72e4654342282ae.tar.gz
QML UI: allow user to disable automatic cloud sync
This is useful if you are in an area with slow or spotty network and if you are fine with just saving to the phone. In order to sync to the cloud you either have to manually sync via the menu or turn this back on and hide the application. The commit also removes the old refresh from the Manage dives menu as the semantic of that was possibly destructive now that we no longer immediately save changes to git - those could be thrown away by selecting refresh before the app had a chance to save them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qml/main.qml')
-rw-r--r--qt-mobile/qml/main.qml18
1 files changed, 12 insertions, 6 deletions
diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml
index 6b6116611..f4f6ea28b 100644
--- a/qt-mobile/qml/main.qml
+++ b/qt-mobile/qml/main.qml
@@ -20,6 +20,7 @@ Kirigami.ApplicationWindow {
property alias accessingCloud: manager.accessingCloud
property QtObject notification: null
property bool showingDiveList: false
+ property alias syncToCloud: manager.syncToCloud
onAccessingCloudChanged: {
if (accessingCloud >= 0) {
// we now keep updating this to show progress, so timing out after 30 seconds is more useful
@@ -133,19 +134,24 @@ Kirigami.ApplicationWindow {
}
}
Kirigami.Action {
- text: "Refresh"
+ text: "Manual sync with cloud"
onTriggered: {
globalDrawer.close()
detailsWindow.endEditMode()
- manager.loadDives();
+ manager.saveChanges();
}
}
Kirigami.Action {
- text: "Upload to cloud"
+ text: syncToCloud ? "Disable auto cloud sync" : "Enable auto cloud sync"
onTriggered: {
- globalDrawer.close()
- detailsWindow.endEditMode()
- manager.saveChanges();
+ syncToCloud = !syncToCloud
+ if (!syncToCloud) {
+ var alertText = "Turning off automatic sync to cloud causes all data to only be stored locally.\n"
+ alertText += "This can be very useful in situations with limited or no network access.\n"
+ alertText += "Please chose 'Manual sync with cloud' if you have network connectivity\n"
+ alertText += "and want to sync your data to cloud storage."
+ showPassiveNotification(alertText, 10000)
+ }
}
}
},