From 31d1755efdd6df01122e9d83946893ba95500a1b Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Tue, 13 Feb 2024 01:03:34 +1300 Subject: [PATCH] Mobile: Fix Cloud Synch Status Management. Fix how the cloud synch status is handled - currently the preference is used incorrectly, switching cloud synch off when it should be on. Also hide the 'Manual cloud synch' button when no cloud credentials are stored, and don't show the 'manual synch' popup when auto synch is enabled. Signed-off-by: Michael Keller --- mobile-widgets/qml/CloudCredentials.qml | 1 + mobile-widgets/qml/main.qml | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mobile-widgets/qml/CloudCredentials.qml b/mobile-widgets/qml/CloudCredentials.qml index 982b42c48..7e79af524 100644 --- a/mobile-widgets/qml/CloudCredentials.qml +++ b/mobile-widgets/qml/CloudCredentials.qml @@ -125,6 +125,7 @@ Item { id: signin_register_normal text: qsTr("Sign-in or Register") onClicked: { + PrefCloudStorage.cloud_auto_sync = true manager.saveCloudCredentials(login.text, password.text, "") } } diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 117ae9357..f909fcd1c 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -334,7 +334,7 @@ Kirigami.ApplicationWindow { name: ":/icons/cloud_sync.svg" } text: qsTr("Manual sync with cloud") - enabled: Backend.cloud_verification_status === Enums.CS_VERIFIED + visible: Backend.cloud_verification_status !== Enums.CS_NOCLOUD onTriggered: { globalDrawer.close() detailsWindow.endEditMode() @@ -344,14 +344,14 @@ Kirigami.ApplicationWindow { } } Kirigami.Action { - icon { - name: PrefCloudStorage.cloud_auto_sync ? ":/icons/ic_cloud_off.svg" : ":/icons/ic_cloud_done.svg" - } -text: (PrefCloudStorage.cloud_auto_sync ? "\u2610 " : "\u2611 ") + qsTr("Auto cloud sync") + icon { + name: PrefCloudStorage.cloud_auto_sync ? ":/icons/ic_cloud_done.svg" : ":/icons/ic_cloud_off.svg" + } + text: (PrefCloudStorage.cloud_auto_sync ? "\u2611 " : "\u2610 ") + qsTr("Auto cloud sync") visible: Backend.cloud_verification_status !== Enums.CS_NOCLOUD onTriggered: { PrefCloudStorage.cloud_auto_sync = !PrefCloudStorage.cloud_auto_sync - manager.setGitLocalOnly(PrefCloudStorage.cloud_auto_sync) + manager.setGitLocalOnly(!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' \