on xenial help sign in
improve password strength/match feedback
commita7dcbaef8913f89766eb92c5c637e580fc78331f authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 11 Mar 2016, 15:10 (11 years ago) parent28af86e
2 files changed+10−5
qml/Wizard/Pages/password-set.qml+1−1 qml/Wizard/PasswordMeter.qml+9−4
qml/Wizard/Pages/password-set.qml+1−1
@@ -131,7 +131,7 @@ LocalComponents.Page {
131131 }
132132
133133 password: passwordField.text
134− matching: passwordsMatching
134+ matching: passwordsMatching ? true : (password2.trim().length > 0 ? false : undefined)
135135 }
136136 }
137137
qml/Wizard/PasswordMeter.qml+9−4
@@ -20,7 +20,7 @@ import Ubuntu.Components 1.3
2020Item {
2121 property string password: ""
2222 readonly property int passwordScore: scorePassword(password)
23− property bool matching: false
23+ property var matching
2424
2525 function scorePassword(pass) {
2626 var score = 0;
@@ -82,9 +82,14 @@ Item {
8282 }
8383 wrapMode: Text.Wrap
8484 text: {
85− if (matching)
86− return i18n.tr("Passwords match");
87− else if (passwordScore > 80)
85+ if (matching !== undefined) {
86+ if (matching)
87+ return i18n.tr("Passwords match");
88+ else if (!matching)
89+ return i18n.tr("Passwords do not match");
90+ }
91+
92+ if (passwordScore > 80)
8893 return i18n.tr("Strong password");
8994 else if (passwordScore > 60)
9095 return i18n.tr("Fair password");