on xenial help sign in
don't clear lockscreen directly after login, its still visible in the fading animation. Clear it when it is requested to be shown instead

this also removes a colon that design didn't like and updates tests to make sure the above works. Approved by PS Jenkins bot, Nicolas d'Offay.

commitfda29452611101adbdacc90db9a3fbca20423a39 authorMichael Zanetti <michael.zanetti@canonical.com> dateMon 24 Jun 2013, 17:50 (13 years ago) parentaf5d2445c35408
3 files changed+15−3
Greeter/Lockscreen.qml+7−1 Shell.qml+1−1 tests/qmltests/Greeter/tst_Lockscreen.qml+7−1
Greeter/Lockscreen.qml+7−1
@@ -41,7 +41,14 @@ Showable {
4141 signal cancel()
4242 signal emergencyCall()
4343
44+ onRequiredChanged: {
45+ if (required && pinPadLoader.item) {
46+ pinPadLoader.item.clear(false);
47+ }
48+ }
49+
4450 function reset() {
51+ // This causes the loader below to destry and recreate the source
4552 pinPadLoader.resetting = true;
4653 pinPadLoader.resetting = false;
4754 }
@@ -140,7 +147,6 @@ Showable {
140147 }
141148 if (LightDM.Greeter.authenticated) {
142149 root.unlocked();
143− pinPadLoader.item.clear(false);
144150 } else {
145151 pinPadLoader.item.clear(true);
146152 }
Shell.qml+1−1
@@ -380,7 +380,7 @@ FocusScope {
380380 } else {
381381 lockscreen.alphaNumeric = true
382382 }
383− lockscreen.placeholderText = i18n.tr("Please enter %1:").arg(text);
383+ lockscreen.placeholderText = i18n.tr("Please enter %1").arg(text);
384384 lockscreen.show();
385385 }
386386 }
tests/qmltests/Greeter/tst_Lockscreen.qml+7−1
@@ -187,8 +187,8 @@ Rectangle {
187187 unlockedCheckBox.checked = false
188188 LightDM.Greeter.authenticate(data.username)
189189
190+ var inputField = findChild(lockscreen, "pinentryField")
190191 if (data.alphanumeric) {
191− var inputField = findChild(lockscreen, "pinentryField")
192192 mouseClick(inputField, units.gu(1), units.gu(1))
193193 typeString(data.password)
194194 keyClick(Qt.Key_Enter)
@@ -200,6 +200,12 @@ Rectangle {
200200 }
201201 }
202202 tryCompare(unlockedCheckBox, "checked", data.unlockedSignal)
203+ if (!data.unlockedSignal) {
204+ // make sure the input is cleared on wrong input
205+ tryCompareFunction(function() {return inputField.text.length == 0}, true)
206+ } else {
207+ tryCompareFunction(function() {return inputField.text.length > 0}, true)
208+ }
203209 }
204210 }
205211}