mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile-widgets/qml: use showPin/oldStatus consistently
Remove aliases for showPin/oldStatus and reference prefs.showPin/oldStatus directly. showPin/oldStatus are "temporary" variables, that are not saved in settings, so they easily be replaced Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
parent
ab28008679
commit
a4d299e01e
3 changed files with 12 additions and 14 deletions
|
@ -53,7 +53,7 @@ Item {
|
||||||
|
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
text: qsTr("Email")
|
text: qsTr("Email")
|
||||||
visible: !rootItem.showPin
|
visible: !prefs.showPin
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
color: subsurfaceTheme.secondaryTextColor
|
color: subsurfaceTheme.secondaryTextColor
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ Item {
|
||||||
Controls.TextField {
|
Controls.TextField {
|
||||||
id: login
|
id: login
|
||||||
text: prefs.cloudUserName
|
text: prefs.cloudUserName
|
||||||
visible: !rootItem.showPin
|
visible: !prefs.showPin
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
inputMethodHints: Qt.ImhEmailCharactersOnly |
|
inputMethodHints: Qt.ImhEmailCharactersOnly |
|
||||||
Qt.ImhNoAutoUppercase
|
Qt.ImhNoAutoUppercase
|
||||||
|
@ -69,7 +69,7 @@ Item {
|
||||||
|
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
text: qsTr("Password")
|
text: qsTr("Password")
|
||||||
visible: !rootItem.showPin
|
visible: !prefs.showPin
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
color: subsurfaceTheme.secondaryTextColor
|
color: subsurfaceTheme.secondaryTextColor
|
||||||
}
|
}
|
||||||
|
@ -87,20 +87,20 @@ Item {
|
||||||
|
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
text: qsTr("PIN")
|
text: qsTr("PIN")
|
||||||
visible: rootItem.showPin
|
visible: prefs.showPin
|
||||||
}
|
}
|
||||||
Controls.TextField {
|
Controls.TextField {
|
||||||
id: pin
|
id: pin
|
||||||
text: ""
|
text: ""
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
visible: rootItem.showPin
|
visible: prefs.showPin
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.margins: Kirigami.Units.smallSpacing
|
Layout.margins: Kirigami.Units.smallSpacing
|
||||||
spacing: Kirigami.Units.smallSpacing
|
spacing: Kirigami.Units.smallSpacing
|
||||||
visible: rootItem.showPin
|
visible: prefs.showPin
|
||||||
SsrfButton {
|
SsrfButton {
|
||||||
id: registerpin
|
id: registerpin
|
||||||
text: qsTr("Register")
|
text: qsTr("Register")
|
||||||
|
@ -126,7 +126,7 @@ Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.margins: Kirigami.Units.smallSpacing
|
Layout.margins: Kirigami.Units.smallSpacing
|
||||||
spacing: Kirigami.Units.smallSpacing
|
spacing: Kirigami.Units.smallSpacing
|
||||||
visible: !rootItem.showPin
|
visible: !prefs.showPin
|
||||||
|
|
||||||
SsrfButton {
|
SsrfButton {
|
||||||
id: signin_register_normal
|
id: signin_register_normal
|
||||||
|
|
|
@ -28,7 +28,7 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
id: explanationTextBasic
|
id: explanationTextBasic
|
||||||
visible: !showPin
|
visible: !prefs.showPin
|
||||||
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
|
||||||
|
@ -41,7 +41,7 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
id: explanationTextPin
|
id: explanationTextPin
|
||||||
visible: showPin
|
visible: prefs.showPin
|
||||||
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
|
||||||
|
|
|
@ -26,11 +26,9 @@ Kirigami.ApplicationWindow {
|
||||||
pageStack.globalToolBar.preferredHeight: Math.round(Kirigami.Units.gridUnit * (Qt.platform.os == "ios" ? 2 : 1.5))
|
pageStack.globalToolBar.preferredHeight: Math.round(Kirigami.Units.gridUnit * (Qt.platform.os == "ios" ? 2 : 1.5))
|
||||||
pageStack.globalToolBar.maximumHeight: Kirigami.Units.gridUnit * 2
|
pageStack.globalToolBar.maximumHeight: Kirigami.Units.gridUnit * 2
|
||||||
|
|
||||||
property alias oldStatus: prefs.oldStatus
|
|
||||||
property alias notificationText: manager.notificationText
|
property alias notificationText: manager.notificationText
|
||||||
property alias locationServiceEnabled: manager.locationServiceEnabled
|
property alias locationServiceEnabled: manager.locationServiceEnabled
|
||||||
property alias pluggedInDeviceName: manager.pluggedInDeviceName
|
property alias pluggedInDeviceName: manager.pluggedInDeviceName
|
||||||
property alias showPin: prefs.showPin
|
|
||||||
property alias defaultCylinderIndex: settingsWindow.defaultCylinderIndex
|
property alias defaultCylinderIndex: settingsWindow.defaultCylinderIndex
|
||||||
property bool filterToggle: false
|
property bool filterToggle: false
|
||||||
property string filterPattern: ""
|
property string filterPattern: ""
|
||||||
|
@ -249,8 +247,8 @@ Kirigami.ApplicationWindow {
|
||||||
if (prefs.credentialStatus == CloudStatus.CS_UNKNOWN) {
|
if (prefs.credentialStatus == CloudStatus.CS_UNKNOWN) {
|
||||||
// the user has asked to change credentials - if the credentials before that
|
// the user has asked to change credentials - if the credentials before that
|
||||||
// were valid, go back to dive list
|
// were valid, go back to dive list
|
||||||
if (oldStatus == CloudStatus.CS_VERIFIED) {
|
if (prefs.oldStatus == CloudStatus.CS_VERIFIED) {
|
||||||
prefs.credentialStatus = oldStatus
|
prefs.credentialStatus = prefs.oldStatus
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
returnTopPage()
|
returnTopPage()
|
||||||
|
@ -334,7 +332,7 @@ Kirigami.ApplicationWindow {
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (prefs.credentialStatus === CloudStatus.CS_NOCLOUD) {
|
if (prefs.credentialStatus === CloudStatus.CS_NOCLOUD) {
|
||||||
returnTopPage()
|
returnTopPage()
|
||||||
oldStatus = prefs.credentialStatus
|
prefs.oldStatus = prefs.credentialStatus
|
||||||
manager.startPageText = "Enter valid cloud storage credentials"
|
manager.startPageText = "Enter valid cloud storage credentials"
|
||||||
prefs.credentialStatus = CloudStatus.CS_UNKNOWN
|
prefs.credentialStatus = CloudStatus.CS_UNKNOWN
|
||||||
globalDrawer.close()
|
globalDrawer.close()
|
||||||
|
|
Loading…
Add table
Reference in a new issue