summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2018-10-08 18:47:01 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-09 10:03:21 -0700
commit87b8155576cf04b0a002c80690f1222f3fec7935 (patch)
tree5b2a1bf016eb822595a7bfc89ab2d6bc3be9e362 /mobile-widgets
parent91c8a2fa5c897111146bff30ff27763ddb92f929 (diff)
downloadsubsurface-87b8155576cf04b0a002c80690f1222f3fec7935.tar.gz
Mobile: preserve auto download status [2/3]
Hook up the new preference to the UI. So now, an earlier choice if automatic or manual download to the cloud is preserved in between sessions. Strictly speaking this fixes issue 1725. Notice that there is also a higly related syncToCloud thing present. As factoring out that seemingly duplicate piece of code is non-trivial, this will be done in a seperate commit. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qml/CloudCredentials.qml1
-rw-r--r--mobile-widgets/qml/main.qml9
2 files changed, 6 insertions, 4 deletions
diff --git a/mobile-widgets/qml/CloudCredentials.qml b/mobile-widgets/qml/CloudCredentials.qml
index b57e4b989..7b4ea12fb 100644
--- a/mobile-widgets/qml/CloudCredentials.qml
+++ b/mobile-widgets/qml/CloudCredentials.qml
@@ -144,6 +144,7 @@ Item {
text: qsTr("No cloud mode")
onClicked: {
manager.syncToCloud = false
+ PrefCloudStorage.cloud_auto_sync = false
prefs.credentialStatus = CloudStatus.CS_NOCLOUD
manager.saveCloudCredentials()
manager.openNoCloudRepo()
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml
index 93f2a6c5c..fb63ed0c3 100644
--- a/mobile-widgets/qml/main.qml
+++ b/mobile-widgets/qml/main.qml
@@ -273,13 +273,14 @@ Kirigami.ApplicationWindow {
}
Kirigami.Action {
icon {
- name: syncToCloud ? ":/icons/ic_cloud_off.svg" : ":/icons/ic_cloud_done.svg"
+ name: PrefCloudStorage.cloud_auto_sync ? ":/icons/ic_cloud_off.svg" : ":/icons/ic_cloud_done.svg"
}
- text: syncToCloud ? qsTr("Disable auto cloud sync") : qsTr("Enable auto cloud sync")
+ text: PrefCloudStorage.cloud_auto_sync ? qsTr("Disable auto cloud sync") : qsTr("Enable auto cloud sync")
visible: prefs.credentialStatus !== CloudStatus.CS_NOCLOUD
onTriggered: {
- syncToCloud = !syncToCloud
- if (!syncToCloud) {
+ PrefCloudStorage.cloud_auto_sync = !PrefCloudStorage.cloud_auto_sync
+ syncToCloud = PrefCloudStorage.cloud_auto_sync
+ if (!PrefCloudStorage.cloud_auto_sync) {
showPassiveNotification(qsTr("Turning off automatic sync to cloud causes all data to only be \
stored locally. This can be very useful in situations with limited or no network access. Please choose 'Manual sync with cloud' \
if you have network connectivity and want to sync your data to cloud storage."), 10000)