on xenial help sign in
provide feedback when entering passcodes in wideview mode
4325d49Lukáš Tinkl
qml/Wizard/Pages/passcode-desktop.qml+24−2
@@ -30,7 +30,8 @@ LocalComponents.Page {
30 title: i18n.tr("Lock Screen Passcode")
30 title: i18n.tr("Lock Screen Passcode")
31 forwardButtonSourceComponent: forwardButton
31 forwardButtonSourceComponent: forwardButton
32
32
33− property alias password: passwordField.text
33+ readonly property alias password: passwordField.text
34+ readonly property alias password2: password2Field.text
34
35
35 GridLayout {
36 GridLayout {
36 id: column
37 id: column
@@ -88,6 +89,27 @@ LocalComponents.Page {
88 validator: RegExpValidator { regExp: /^\d{4}$/ }
89 validator: RegExpValidator { regExp: /^\d{4}$/ }
89 maximumLength: 4
90 maximumLength: 4
90 }
91 }
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+ }
91 }
113 }
92
114
93 Item { // spacer
115 Item { // spacer
@@ -99,7 +121,7 @@ LocalComponents.Page {
99 id: forwardButton
121 id: forwardButton
100 LocalComponents.StackButton {
122 LocalComponents.StackButton {
101 text: i18n.tr("Next")
123 text: i18n.tr("Next")
102− enabled: password != "" && password == password2Field.text
124+ enabled: password != "" && password == password2
103 onClicked: {
125 onClicked: {
104 root.password = password;
126 root.password = password;
105 pageStack.next();
127 pageStack.next();