From bb74144860b14d23f26ebd3dd72e4654342282ae Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 3 Apr 2016 18:33:40 -0700 Subject: 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 --- qt-mobile/qml/main.qml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'qt-mobile/qml/main.qml') 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) + } } } }, -- cgit v1.2.3-70-g09d2