mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
c93b76eee6
commit
93c3a18db7
5 changed files with 17 additions and 17 deletions
|
@ -13,7 +13,7 @@ Item {
|
||||||
|
|
||||||
property string username: login.text;
|
property string username: login.text;
|
||||||
property string password: password.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 {
|
ColumnLayout {
|
||||||
id: outerLayout
|
id: outerLayout
|
||||||
|
@ -110,7 +110,7 @@ Item {
|
||||||
id: cancelpin
|
id: cancelpin
|
||||||
text: qsTr("Cancel")
|
text: qsTr("Cancel")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
PrefCloudStorage.cloud_verification_status = CloudStatus.CS_UNKNOWN
|
Backend.cloud_verification_status = Enums.CS_UNKNOWN
|
||||||
manager.startPageText = qsTr("Check credentials...");
|
manager.startPageText = qsTr("Check credentials...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -139,8 +139,8 @@ Item {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
manager.setGitLocalOnly(true)
|
manager.setGitLocalOnly(true)
|
||||||
PrefCloudStorage.cloud_auto_sync = false
|
PrefCloudStorage.cloud_auto_sync = false
|
||||||
manager.oldStatus = PrefCloudStorage.cloud_verification_status
|
manager.oldStatus = Backend.cloud_verification_status
|
||||||
PrefCloudStorage.cloud_verification_status = CloudStatus.CS_NOCLOUD
|
Backend.cloud_verification_status = Enums.CS_NOCLOUD
|
||||||
manager.saveCloudCredentials("", "", "")
|
manager.saveCloudCredentials("", "", "")
|
||||||
manager.openNoCloudRepo()
|
manager.openNoCloudRepo()
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ Kirigami.ScrollablePage {
|
||||||
supportsRefreshing: true
|
supportsRefreshing: true
|
||||||
onRefreshingChanged: {
|
onRefreshingChanged: {
|
||||||
if (refreshing) {
|
if (refreshing) {
|
||||||
if (PrefCloudStorage.cloud_verification_status === CloudStatus.CS_VERIFIED) {
|
if (Backend.cloud_verification_status === Enums.CS_VERIFIED) {
|
||||||
detailsWindow.endEditMode()
|
detailsWindow.endEditMode()
|
||||||
manager.saveChangesCloud(true)
|
manager.saveChangesCloud(true)
|
||||||
refreshing = false
|
refreshing = false
|
||||||
|
|
|
@ -45,7 +45,7 @@ Kirigami.ScrollablePage {
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
Controls.Label {
|
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
|
font.pointSize: subsurfaceTheme.regularPointSize
|
||||||
Layout.preferredWidth: gridWidth * 0.60
|
Layout.preferredWidth: gridWidth * 0.60
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
|
@ -54,7 +54,7 @@ Kirigami.ScrollablePage {
|
||||||
id: changeCloudSettings
|
id: changeCloudSettings
|
||||||
text: qsTr("Change")
|
text: qsTr("Change")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
PrefCloudStorage.cloud_verification_status = CloudStatus.CS_UNKNOWN
|
Backend.cloud_verification_status = Enums.CS_UNKNOWN
|
||||||
manager.startPageText = qsTr("Starting...");
|
manager.startPageText = qsTr("Starting...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ Kirigami.ScrollablePage {
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
text: describe[PrefCloudStorage.cloud_verification_status]
|
text: describe[Backend.cloud_verification_status]
|
||||||
font.pointSize: subsurfaceTheme.regularPointSize
|
font.pointSize: subsurfaceTheme.regularPointSize
|
||||||
Layout.preferredWidth: gridWidth * 0.60
|
Layout.preferredWidth: gridWidth * 0.60
|
||||||
Layout.preferredHeight: Kirigami.Units.gridUnit * 1.5
|
Layout.preferredHeight: Kirigami.Units.gridUnit * 1.5
|
||||||
|
|
|
@ -27,7 +27,7 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
id: explanationTextBasic
|
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.fillWidth: true
|
||||||
Layout.margins: Kirigami.Units.gridUnit
|
Layout.margins: Kirigami.Units.gridUnit
|
||||||
Layout.topMargin: Kirigami.Units.gridUnit * 3
|
Layout.topMargin: Kirigami.Units.gridUnit * 3
|
||||||
|
@ -40,7 +40,7 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
id: explanationTextPin
|
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.fillWidth: true
|
||||||
Layout.margins: Kirigami.Units.gridUnit
|
Layout.margins: Kirigami.Units.gridUnit
|
||||||
Layout.topMargin: Kirigami.Units.gridUnit * 3
|
Layout.topMargin: Kirigami.Units.gridUnit * 3
|
||||||
|
|
|
@ -164,8 +164,8 @@ Kirigami.ApplicationWindow {
|
||||||
id: globalDrawer
|
id: globalDrawer
|
||||||
height: rootItem.height
|
height: rootItem.height
|
||||||
rightPadding: 0
|
rightPadding: 0
|
||||||
enabled: (PrefCloudStorage.cloud_verification_status === CloudStatus.CS_NOCLOUD ||
|
enabled: (Backend.cloud_verification_status === Enums.CS_NOCLOUD ||
|
||||||
PrefCloudStorage.cloud_verification_status === CloudStatus.CS_VERIFIED)
|
Backend.cloud_verification_status === Enums.CS_VERIFIED)
|
||||||
topContent: Image {
|
topContent: Image {
|
||||||
source: "qrc:/qml/icons/dive.jpg"
|
source: "qrc:/qml/icons/dive.jpg"
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
@ -244,7 +244,7 @@ Kirigami.ApplicationWindow {
|
||||||
}
|
}
|
||||||
text: qsTr("Dive list")
|
text: qsTr("Dive list")
|
||||||
onTriggered: {
|
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()
|
returnTopPage()
|
||||||
globalDrawer.close()
|
globalDrawer.close()
|
||||||
}
|
}
|
||||||
|
@ -319,7 +319,7 @@ 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: PrefCloudStorage.cloud_verification_status === CloudStatus.CS_VERIFIED
|
enabled: Backend.cloud_verification_status === Enums.CS_VERIFIED
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
globalDrawer.close()
|
globalDrawer.close()
|
||||||
detailsWindow.endEditMode()
|
detailsWindow.endEditMode()
|
||||||
|
@ -332,7 +332,7 @@ Kirigami.ApplicationWindow {
|
||||||
name: PrefCloudStorage.cloud_auto_sync ? ":/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: PrefCloudStorage.cloud_auto_sync ? 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: PrefCloudStorage.cloud_verification_status !== CloudStatus.CS_NOCLOUD
|
visible: Backend.cloud_verification_status !== Enums.CS_NOCLOUD
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
PrefCloudStorage.cloud_auto_sync = !PrefCloudStorage.cloud_auto_sync
|
PrefCloudStorage.cloud_auto_sync = !PrefCloudStorage.cloud_auto_sync
|
||||||
manager.setGitLocalOnly(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 {
|
StartPage {
|
||||||
id: startPage
|
id: startPage
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: PrefCloudStorage.cloud_verification_status !== CloudStatus.CS_NOCLOUD &&
|
visible: Backend.cloud_verification_status !== Enums.CS_NOCLOUD &&
|
||||||
PrefCloudStorage.cloud_verification_status !== CloudStatus.CS_VERIFIED
|
Backend.cloud_verification_status !== Enums.CS_VERIFIED
|
||||||
Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration } }
|
Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration } }
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue