diff options
author | jan Iversen <jan@casacondor.com> | 2020-01-05 17:08:48 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-01-18 17:35:16 -0800 |
commit | 93c3a18db7142e9d6afeed4fde17196776e0d422 (patch) | |
tree | 5c1aeebcf0566960d8e593a99880037793925eb3 /mobile-widgets | |
parent | c93b76eee663d5b000dcd9f0a3e7b4fa12b99b9b (diff) | |
download | subsurface-93c3a18db7142e9d6afeed4fde17196776e0d422.tar.gz |
mobile-widgets/qml: use strongly typed CloudStatus
Replace CloudStatus.<value> with backend.<value> as part
of making enum sharing between C/C++ and QML more robust.
Replace PrefCloudStorage.verification_status with
backend.verification_status to use the strongly typed function.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/CloudCredentials.qml | 8 | ||||
-rw-r--r-- | mobile-widgets/qml/DiveList.qml | 2 | ||||
-rw-r--r-- | mobile-widgets/qml/Settings.qml | 6 | ||||
-rw-r--r-- | mobile-widgets/qml/StartPage.qml | 4 | ||||
-rw-r--r-- | mobile-widgets/qml/main.qml | 14 |
5 files changed, 17 insertions, 17 deletions
diff --git a/mobile-widgets/qml/CloudCredentials.qml b/mobile-widgets/qml/CloudCredentials.qml index 36c20b71a..655eaab54 100644 --- a/mobile-widgets/qml/CloudCredentials.qml +++ b/mobile-widgets/qml/CloudCredentials.qml @@ -13,7 +13,7 @@ Item { property string username: login.text; property string password: password.text; - property bool showPin: (PrefCloudStorage.cloud_verification_status === CloudStatus.CS_NEED_TO_VERIFY) + property bool showPin: (Backend.cloud_verification_status === Enums.CS_NEED_TO_VERIFY) ColumnLayout { id: outerLayout @@ -110,7 +110,7 @@ Item { id: cancelpin text: qsTr("Cancel") onClicked: { - PrefCloudStorage.cloud_verification_status = CloudStatus.CS_UNKNOWN + Backend.cloud_verification_status = Enums.CS_UNKNOWN manager.startPageText = qsTr("Check credentials..."); } } @@ -139,8 +139,8 @@ Item { onClicked: { manager.setGitLocalOnly(true) PrefCloudStorage.cloud_auto_sync = false - manager.oldStatus = PrefCloudStorage.cloud_verification_status - PrefCloudStorage.cloud_verification_status = CloudStatus.CS_NOCLOUD + manager.oldStatus = Backend.cloud_verification_status + Backend.cloud_verification_status = Enums.CS_NOCLOUD manager.saveCloudCredentials("", "", "") manager.openNoCloudRepo() } diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index d353d6995..60d2f5ea1 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -30,7 +30,7 @@ Kirigami.ScrollablePage { supportsRefreshing: true onRefreshingChanged: { if (refreshing) { - if (PrefCloudStorage.cloud_verification_status === CloudStatus.CS_VERIFIED) { + if (Backend.cloud_verification_status === Enums.CS_VERIFIED) { detailsWindow.endEditMode() manager.saveChangesCloud(true) refreshing = false diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml index 0af963799..9713a7f15 100644 --- a/mobile-widgets/qml/Settings.qml +++ b/mobile-widgets/qml/Settings.qml @@ -45,7 +45,7 @@ Kirigami.ScrollablePage { color: subsurfaceTheme.textColor } Controls.Label { - text: PrefCloudStorage.cloud_verification_status === CloudStatus.CS_NOCLOUD ? qsTr("Not applicable") : PrefCloudStorage.cloud_storage_email + text: Backend.cloud_verification_status === Enums.CS_NOCLOUD ? qsTr("Not applicable") : PrefCloudStorage.cloud_storage_email font.pointSize: subsurfaceTheme.regularPointSize Layout.preferredWidth: gridWidth * 0.60 color: subsurfaceTheme.textColor @@ -54,7 +54,7 @@ Kirigami.ScrollablePage { id: changeCloudSettings text: qsTr("Change") onClicked: { - PrefCloudStorage.cloud_verification_status = CloudStatus.CS_UNKNOWN + Backend.cloud_verification_status = Enums.CS_UNKNOWN manager.startPageText = qsTr("Starting..."); } } @@ -66,7 +66,7 @@ Kirigami.ScrollablePage { color: subsurfaceTheme.textColor } Controls.Label { - text: describe[PrefCloudStorage.cloud_verification_status] + text: describe[Backend.cloud_verification_status] font.pointSize: subsurfaceTheme.regularPointSize Layout.preferredWidth: gridWidth * 0.60 Layout.preferredHeight: Kirigami.Units.gridUnit * 1.5 diff --git a/mobile-widgets/qml/StartPage.qml b/mobile-widgets/qml/StartPage.qml index d7eb151f9..3c4db1b73 100644 --- a/mobile-widgets/qml/StartPage.qml +++ b/mobile-widgets/qml/StartPage.qml @@ -27,7 +27,7 @@ Kirigami.ScrollablePage { } Controls.Label { id: explanationTextBasic - visible: PrefCloudStorage.cloud_verification_status !== CloudStatus.CS_NEED_TO_VERIFY + visible: Backend.cloud_verification_status !== Enums.CS_NEED_TO_VERIFY Layout.fillWidth: true Layout.margins: Kirigami.Units.gridUnit Layout.topMargin: Kirigami.Units.gridUnit * 3 @@ -40,7 +40,7 @@ Kirigami.ScrollablePage { } Controls.Label { id: explanationTextPin - visible: PrefCloudStorage.cloud_verification_status === CloudStatus.CS_NEED_TO_VERIFY + visible: Backend.cloud_verification_status === Enums.CS_NEED_TO_VERIFY Layout.fillWidth: true Layout.margins: Kirigami.Units.gridUnit Layout.topMargin: Kirigami.Units.gridUnit * 3 diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 94c5dd3c4..11fcad171 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -164,8 +164,8 @@ Kirigami.ApplicationWindow { id: globalDrawer height: rootItem.height rightPadding: 0 - enabled: (PrefCloudStorage.cloud_verification_status === CloudStatus.CS_NOCLOUD || - PrefCloudStorage.cloud_verification_status === CloudStatus.CS_VERIFIED) + enabled: (Backend.cloud_verification_status === Enums.CS_NOCLOUD || + Backend.cloud_verification_status === Enums.CS_VERIFIED) topContent: Image { source: "qrc:/qml/icons/dive.jpg" Layout.fillWidth: true @@ -244,7 +244,7 @@ Kirigami.ApplicationWindow { } text: qsTr("Dive list") onTriggered: { - manager.appendTextToLog("requested dive list with credential status " + PrefCloudStorage.cloud_verification_status) + manager.appendTextToLog("requested dive list with credential status " + Backend.cloud_verification_status) returnTopPage() globalDrawer.close() } @@ -319,7 +319,7 @@ Kirigami.ApplicationWindow { name: ":/icons/cloud_sync.svg" } text: qsTr("Manual sync with cloud") - enabled: PrefCloudStorage.cloud_verification_status === CloudStatus.CS_VERIFIED + enabled: Backend.cloud_verification_status === Enums.CS_VERIFIED onTriggered: { globalDrawer.close() detailsWindow.endEditMode() @@ -332,7 +332,7 @@ Kirigami.ApplicationWindow { name: PrefCloudStorage.cloud_auto_sync ? ":/icons/ic_cloud_off.svg" : ":/icons/ic_cloud_done.svg" } text: PrefCloudStorage.cloud_auto_sync ? qsTr("Disable auto cloud sync") : qsTr("Enable auto cloud sync") - visible: PrefCloudStorage.cloud_verification_status !== CloudStatus.CS_NOCLOUD + visible: Backend.cloud_verification_status !== Enums.CS_NOCLOUD onTriggered: { PrefCloudStorage.cloud_auto_sync = !PrefCloudStorage.cloud_auto_sync manager.setGitLocalOnly(PrefCloudStorage.cloud_auto_sync) @@ -840,8 +840,8 @@ if you have network connectivity and want to sync your data to cloud storage."), StartPage { id: startPage anchors.fill: parent - visible: PrefCloudStorage.cloud_verification_status !== CloudStatus.CS_NOCLOUD && - PrefCloudStorage.cloud_verification_status !== CloudStatus.CS_VERIFIED + visible: Backend.cloud_verification_status !== Enums.CS_NOCLOUD && + Backend.cloud_verification_status !== Enums.CS_VERIFIED Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration } } onVisibleChanged: { |