summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/CloudCredentials.qml
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2020-01-01 18:49:37 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-02 06:36:18 +0900
commit6d6a4278c4450abf4beb504c085ff66d910ae071 (patch)
treeceff1814746a61fe16af91974c09c676efc933b2 /mobile-widgets/qml/CloudCredentials.qml
parenta72e6e46abe1dee427a1a08893b33077d63b8e5e (diff)
downloadsubsurface-6d6a4278c4450abf4beb504c085ff66d910ae071.tar.gz
mobile-widgets/qml: reintroduce showPin
but the proper way, as a direct check on PrefCloudStorage. This secures PrefCloudStorage is only tested once and not n times. As a sideeffect it saves typing and control. Signed-off-by: Jan Iversen <jan@casacondor.com>
Diffstat (limited to 'mobile-widgets/qml/CloudCredentials.qml')
-rw-r--r--mobile-widgets/qml/CloudCredentials.qml17
1 files changed, 9 insertions, 8 deletions
diff --git a/mobile-widgets/qml/CloudCredentials.qml b/mobile-widgets/qml/CloudCredentials.qml
index 405531258..36c20b71a 100644
--- a/mobile-widgets/qml/CloudCredentials.qml
+++ b/mobile-widgets/qml/CloudCredentials.qml
@@ -13,6 +13,7 @@ Item {
property string username: login.text;
property string password: password.text;
+ property bool showPin: (PrefCloudStorage.cloud_verification_status === CloudStatus.CS_NEED_TO_VERIFY)
ColumnLayout {
id: outerLayout
@@ -46,7 +47,7 @@ Item {
Controls.Label {
text: qsTr("Email")
- visible: PrefCloudStorage.cloud_verification_status !== CloudStatus.CS_NEED_TO_VERIFY
+ visible: !showPin
font.pointSize: subsurfaceTheme.smallPointSize
color: subsurfaceTheme.secondaryTextColor
}
@@ -54,7 +55,7 @@ Item {
Controls.TextField {
id: login
text: PrefCloudStorage.cloud_storage_email
- visible: PrefCloudStorage.cloud_verification_status !== CloudStatus.CS_NEED_TO_VERIFY
+ visible: !showPin
Layout.fillWidth: true
inputMethodHints: Qt.ImhEmailCharactersOnly |
Qt.ImhNoAutoUppercase
@@ -62,7 +63,7 @@ Item {
Controls.Label {
text: qsTr("Password")
- visible: PrefCloudStorage.cloud_verification_status !== CloudStatus.CS_NEED_TO_VERIFY
+ visible: !showPin
font.pointSize: subsurfaceTheme.smallPointSize
color: subsurfaceTheme.secondaryTextColor
}
@@ -70,7 +71,7 @@ Item {
Controls.TextField {
id: password
text: PrefCloudStorage.cloud_storage_password
- visible: PrefCloudStorage.cloud_verification_status !== CloudStatus.CS_NEED_TO_VERIFY
+ visible: !showPin
echoMode: TextInput.PasswordEchoOnEdit
inputMethodHints: Qt.ImhSensitiveData |
Qt.ImhHiddenText |
@@ -80,20 +81,20 @@ Item {
Controls.Label {
text: qsTr("PIN")
- visible: PrefCloudStorage.cloud_verification_status === CloudStatus.CS_NEED_TO_VERIFY
+ visible: showPin
}
Controls.TextField {
id: pin
text: ""
Layout.fillWidth: true
- visible: PrefCloudStorage.cloud_verification_status === CloudStatus.CS_NEED_TO_VERIFY
+ visible: showPin
}
RowLayout {
Layout.fillWidth: true
Layout.margins: Kirigami.Units.smallSpacing
spacing: Kirigami.Units.smallSpacing
- visible: PrefCloudStorage.cloud_verification_status === CloudStatus.CS_NEED_TO_VERIFY
+ visible: showPin
SsrfButton {
id: registerpin
text: qsTr("Register")
@@ -119,7 +120,7 @@ Item {
Layout.fillWidth: true
Layout.margins: Kirigami.Units.smallSpacing
spacing: Kirigami.Units.smallSpacing
- visible: PrefCloudStorage.cloud_verification_status !== CloudStatus.CS_NEED_TO_VERIFY
+ visible: !showPin
SsrfButton {
id: signin_register_normal