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>
This commit is contained in:
Dirk Hohndel 2016-04-03 18:33:40 -07:00
parent 616842c8c0
commit bb74144860
3 changed files with 37 additions and 23 deletions

View file

@ -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,21 +134,26 @@ Kirigami.ApplicationWindow {
}
}
Kirigami.Action {
text: "Refresh"
onTriggered: {
globalDrawer.close()
detailsWindow.endEditMode()
manager.loadDives();
}
}
Kirigami.Action {
text: "Upload to cloud"
text: "Manual sync with cloud"
onTriggered: {
globalDrawer.close()
detailsWindow.endEditMode()
manager.saveChanges();
}
}
Kirigami.Action {
text: syncToCloud ? "Disable auto cloud sync" : "Enable auto cloud sync"
onTriggered: {
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)
}
}
}
},
Kirigami.Action {