mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: make qPref::cloud_status the only version of the enum
add enum to qPref and remove elsewhere update source core to reference qPref. the enum cannot be in pref.h because it is to be used in qml and Q_ENUM need the enum to be defined as part of the class Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
parent
7103f36c7c
commit
8d66633fe7
14 changed files with 90 additions and 95 deletions
|
|
@ -186,10 +186,10 @@ Kirigami.ApplicationWindow {
|
|||
text: qsTr("Dive list")
|
||||
onTriggered: {
|
||||
manager.appendTextToLog("requested dive list with credential status " + prefs.credentialStatus)
|
||||
if (prefs.credentialStatus == QMLPrefs.CS_UNKNOWN) {
|
||||
if (prefs.credentialStatus == SsrfPrefs.CS_UNKNOWN) {
|
||||
// the user has asked to change credentials - if the credentials before that
|
||||
// were valid, go back to dive list
|
||||
if (oldStatus == QMLPrefs.CS_VERIFIED) {
|
||||
if (oldStatus == SsrfPrefs.CS_VERIFIED) {
|
||||
prefs.credentialStatus = oldStatus
|
||||
}
|
||||
}
|
||||
|
|
@ -216,8 +216,8 @@ Kirigami.ApplicationWindow {
|
|||
name: ":/icons/ic_add.svg"
|
||||
}
|
||||
text: qsTr("Add dive manually")
|
||||
enabled: prefs.credentialStatus === QMLPrefs.CS_VERIFIED ||
|
||||
prefs.credentialStatus === QMLPrefs.CS_NOCLOUD
|
||||
enabled: prefs.credentialStatus === SsrfPrefs.CS_VERIFIED ||
|
||||
prefs.credentialStatus === SsrfPrefs.CS_NOCLOUD
|
||||
onTriggered: {
|
||||
globalDrawer.close()
|
||||
returnTopPage() // otherwise odd things happen with the page stack
|
||||
|
|
@ -251,14 +251,14 @@ Kirigami.ApplicationWindow {
|
|||
name: ":/icons/cloud_sync.svg"
|
||||
}
|
||||
text: qsTr("Manual sync with cloud")
|
||||
enabled: prefs.credentialStatus === QMLPrefs.CS_VERIFIED ||
|
||||
prefs.credentialStatus === QMLPrefs.CS_NOCLOUD
|
||||
enabled: prefs.credentialStatus === SsrfPrefs.CS_VERIFIED ||
|
||||
prefs.credentialStatus === SsrfPrefs.CS_NOCLOUD
|
||||
onTriggered: {
|
||||
if (prefs.credentialStatus === QMLPrefs.CS_NOCLOUD) {
|
||||
if (prefs.credentialStatus === SsrfPrefs.CS_NOCLOUD) {
|
||||
returnTopPage()
|
||||
oldStatus = prefs.credentialStatus
|
||||
manager.startPageText = "Enter valid cloud storage credentials"
|
||||
prefs.credentialStatus = QMLPrefs.CS_UNKNOWN
|
||||
prefs.credentialStatus = SsrfPrefs.CS_UNKNOWN
|
||||
globalDrawer.close()
|
||||
} else {
|
||||
globalDrawer.close()
|
||||
|
|
@ -273,7 +273,7 @@ Kirigami.ApplicationWindow {
|
|||
name: syncToCloud ? ":/icons/ic_cloud_off.svg" : ":/icons/ic_cloud_done.svg"
|
||||
}
|
||||
text: syncToCloud ? qsTr("Disable auto cloud sync") : qsTr("Enable auto cloud sync")
|
||||
enabled: prefs.credentialStatus !== QMLPrefs.CS_NOCLOUD
|
||||
enabled: prefs.credentialStatus !== SsrfPrefs.CS_NOCLOUD
|
||||
onTriggered: {
|
||||
syncToCloud = !syncToCloud
|
||||
if (!syncToCloud) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue