on xenial help sign in
provide feedback when entering passcodes in wideview mode
commit4325d49d40531da16b0fdb971ef4d55dd8560c5d authorLukáš Tinkl <lukas.tinkl@canonical.com> dateWed 9 Mar 2016, 22:42 (11 years ago) parent95ebb9e
1 file changed+24−2
qml/Wizard/Pages/passcode-desktop.qml+24−2
qml/Wizard/Pages/passcode-desktop.qml+24−2
@@ -30,7 +30,8 @@ LocalComponents.Page {
3030 title: i18n.tr("Lock Screen Passcode")
3131 forwardButtonSourceComponent: forwardButton
3232
33− property alias password: passwordField.text
33+ readonly property alias password: passwordField.text
34+ readonly property alias password2: password2Field.text
3435
3536 GridLayout {
3637 id: column
@@ -88,6 +89,27 @@ LocalComponents.Page {
8889 validator: RegExpValidator { regExp: /^\d{4}$/ }
8990 maximumLength: 4
9091 }
92+
93+ Label {
94+ Layout.row: 2
95+ Layout.column: 1
96+ id: errorLabel
97+ wrapMode: Text.Wrap
98+ color: errorColor
99+ visible: password && password2
100+ fontSize: "small"
101+ text: {
102+ if (password) {
103+ if (password2.length < password2Field.maximumLength)
104+ return i18n.tr("Passcode too short")
105+ else if (password == password2)
106+ return i18n.tr("Passcodes match")
107+ else if (password2)
108+ return i18n.tr("Passcodes do not match")
109+ }
110+ return ""
111+ }
112+ }
91113 }
92114
93115 Item { // spacer
@@ -99,7 +121,7 @@ LocalComponents.Page {
99121 id: forwardButton
100122 LocalComponents.StackButton {
101123 text: i18n.tr("Next")
102− enabled: password != "" && password == password2Field.text
124+ enabled: password != "" && password == password2
103125 onClicked: {
104126 root.password = password;
105127 pageStack.next();