diff options
author | jan Iversen <jani@apache.org> | 2018-06-13 18:06:11 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-06-15 14:12:14 -0700 |
commit | b8eb348f546291c49e2d606649b3c85d23e43782 (patch) | |
tree | 8ca54d1f5aa363496de4b83e1b6200b92304a8a3 /mobile-widgets/qml/DiveList.qml | |
parent | 62ca5e90e13d65235d3cd53feffd0cb62cfbac43 (diff) | |
download | subsurface-b8eb348f546291c49e2d606649b3c85d23e43782.tar.gz |
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>
Diffstat (limited to 'mobile-widgets/qml/DiveList.qml')
-rw-r--r-- | mobile-widgets/qml/DiveList.qml | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index 31b2204fa..36929951a 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -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) { |