mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile: move settings from qmlmanager to qmlprefs
add settings variables/functions to qmlprefs remove settings variables/functions from qmlmanager change manager. to prefs. in qml files for setting variables/functions Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
parent
62ca5e90e1
commit
b8eb348f54
8 changed files with 389 additions and 283 deletions
|
@ -13,7 +13,7 @@ Kirigami.ScrollablePage {
|
|||
title: qsTr("Dive list")
|
||||
verticalScrollBarPolicy: Qt.ScrollBarAlwaysOff
|
||||
width: subsurfaceTheme.columnWidth
|
||||
property int credentialStatus: manager.credentialStatus
|
||||
property int credentialStatus: prefs.credentialStatus
|
||||
property int numDives: diveListView.count
|
||||
property color textColor: subsurfaceTheme.textColor
|
||||
property color secondaryTextColor: subsurfaceTheme.secondaryTextColor
|
||||
|
@ -23,14 +23,14 @@ Kirigami.ScrollablePage {
|
|||
supportsRefreshing: true
|
||||
onRefreshingChanged: {
|
||||
if (refreshing) {
|
||||
if (manager.credentialStatus === QMLManager.CS_VERIFIED) {
|
||||
if (prefs.credentialStatus === QMLPrefs.CS_VERIFIED) {
|
||||
console.log("User pulled down dive list - syncing with cloud storage")
|
||||
detailsWindow.endEditMode()
|
||||
manager.saveChangesCloud(true)
|
||||
console.log("done syncing, turn off spinner")
|
||||
refreshing = false
|
||||
} else {
|
||||
console.log("sync with cloud storage requested, but credentialStatus is " + manager.credentialStatus)
|
||||
console.log("sync with cloud storage requested, but credentialStatus is " + prefs.credentialStatus)
|
||||
console.log("no syncing, turn off spinner")
|
||||
refreshing = false
|
||||
}
|
||||
|
@ -339,7 +339,8 @@ Kirigami.ScrollablePage {
|
|||
StartPage {
|
||||
id: startPage
|
||||
anchors.fill: parent
|
||||
opacity: credentialStatus === QMLManager.CS_NOCLOUD || (credentialStatus === QMLManager.CS_VERIFIED) ? 0 : 1
|
||||
opacity: credentialStatus === QMLPrefs.CS_NOCLOUD ||
|
||||
(credentialStatus === QMLPrefs.CS_VERIFIED) ? 0 : 1
|
||||
visible: opacity > 0
|
||||
Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration } }
|
||||
function setupActions() {
|
||||
|
@ -347,7 +348,8 @@ Kirigami.ScrollablePage {
|
|||
page.actions.main = null
|
||||
page.actions.right = null
|
||||
page.title = qsTr("Cloud credentials")
|
||||
} else if (manager.credentialStatus === QMLManager.CS_VERIFIED || manager.credentialStatus === QMLManager.CS_NOCLOUD) {
|
||||
} else if (prefs.credentialStatus === QMLPrefs.CS_VERIFIED ||
|
||||
prefs.credentialStatus === QMLPrefs.CS_NOCLOUD) {
|
||||
page.actions.main = page.downloadFromDCAction
|
||||
page.actions.right = page.addDiveAction
|
||||
page.title = qsTr("Dive list")
|
||||
|
@ -424,8 +426,9 @@ Kirigami.ScrollablePage {
|
|||
}
|
||||
|
||||
onBackRequested: {
|
||||
if (startPage.visible && diveListView.count > 0 && manager.credentialStatus !== QMLManager.CS_INCORRECT_USER_PASSWD) {
|
||||
manager.credentialStatus = oldStatus
|
||||
if (startPage.visible && diveListView.count > 0 &&
|
||||
prefs.credentialStatus !== QMLPrefs.CS_INCORRECT_USER_PASSWD) {
|
||||
prefs.credentialStatus = oldStatus
|
||||
event.accepted = true;
|
||||
}
|
||||
if (!startPage.visible) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue