mobile-widgets/qml: don't offer manual sync to cloud in no-cloud mode

Manual sync was enabled both for CS_VERIFIED (online) and CS_NOCLOUD (offline)
and then in the trigger CS_NOCLOUD lead to a login screen, potentially
confusing the user.

Only enable manual sync with verified cloud credentials.

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
jan Iversen 2019-12-28 16:20:44 +01:00 committed by Dirk Hohndel
parent bdbaf72d27
commit a73ce80eee

View file

@ -321,21 +321,12 @@ Kirigami.ApplicationWindow {
name: ":/icons/cloud_sync.svg" name: ":/icons/cloud_sync.svg"
} }
text: qsTr("Manual sync with cloud") text: qsTr("Manual sync with cloud")
enabled: prefs.credentialStatus === CloudStatus.CS_VERIFIED || enabled: PrefCloudStorage.cloud_verification_status === CloudStatus.CS_VERIFIED
prefs.credentialStatus === CloudStatus.CS_NOCLOUD
onTriggered: { onTriggered: {
if (prefs.credentialStatus === CloudStatus.CS_NOCLOUD) { globalDrawer.close()
returnTopPage() detailsWindow.endEditMode()
prefs.oldStatus = prefs.credentialStatus manager.saveChangesCloud(true);
manager.startPageText = "Enter valid cloud storage credentials" globalDrawer.close()
prefs.credentialStatus = CloudStatus.CS_UNKNOWN
globalDrawer.close()
} else {
globalDrawer.close()
detailsWindow.endEditMode()
manager.saveChangesCloud(true);
globalDrawer.close()
}
} }
} }
Kirigami.Action { Kirigami.Action {