on xenial help sign in
Show correct placeholder text, add wrong-password placeholder text, and keep it showing until next entry
ed919ebMichael Terry
qml/Components/PinLockscreen.qml+3−1
@@ -38,6 +38,7 @@ Column {
38
38
39 function clear(playAnimation) {
39 function clear(playAnimation) {
40 pinentryField.text = "";
40 pinentryField.text = "";
41+ pinentryFieldPlaceHolder.text = playAnimation ? wrongPlaceholderText : placeholderText
41 if (playAnimation) {
42 if (playAnimation) {
42 wrongPasswordAnimation.start();
43 wrongPasswordAnimation.start();
43 }
44 }
@@ -90,9 +91,10 @@ Column {
90 id: pinentryFieldPlaceHolder
91 id: pinentryFieldPlaceHolder
91 objectName: "pinentryFieldPlaceHolder"
92 objectName: "pinentryFieldPlaceHolder"
92 anchors.centerIn: parent
93 anchors.centerIn: parent
94+ horizontalAlignment: Text.AlignHCenter
93 color: "#f3f3e7"
95 color: "#f3f3e7"
94 opacity: 0.6
96 opacity: 0.6
95− text: wrongPasswordAnimation.running ? parent.wrongPlaceholderText : parent.placeholderText
97+ text: parent.placeholderText
96 visible: pinentryFieldLabel.text.length == 0
98 visible: pinentryFieldLabel.text.length == 0
97 }
99 }
98
100
qml/Shell.qml+17−5
@@ -387,7 +387,15 @@ Item {
387
387
388 onShowPrompt: {
388 onShowPrompt: {
389 if (greeter.narrowMode) {
389 if (greeter.narrowMode) {
390+ var promptText = text.toLowerCase()
391+ if (promptText === "password") {
392+ promptText = lockscreen.alphaNumeric ?
393+ i18n.tr("passphrase") : i18n.tr("passcode")
394+ }
390− lockscreen.placeholderText = i18n.tr("Please enter %1").arg(text.toLowerCase());
395+ lockscreen.placeholderText = i18n.tr("Enter your %1").arg(promptText)
396+ lockscreen.wrongPlaceholderText = i18n.tr("Incorrect %1").arg(promptText) +
397+ "\n" +
398+ i18n.tr("Please re-enter")
391 lockscreen.show();
399 lockscreen.show();
392 }
400 }
393 }
401 }
@@ -460,6 +468,14 @@ Item {
460 }
468 }
461
469
462 property bool fullyShown: showProgress === 1.0
470 property bool fullyShown: showProgress === 1.0
471+ onFullyShownChanged: {
472+ // Wait until the greeter is completely covering lockscreen before resetting it.
473+ if (fullyShown && !LightDM.Greeter.authenticated) {
474+ lockscreen.reset();
475+ lockscreen.show();
476+ }
477+ }
478+
463 readonly property real showProgress: MathUtils.clamp((1 - x/width) + greeter.showProgress - 1, 0, 1)
479 readonly property real showProgress: MathUtils.clamp((1 - x/width) + greeter.showProgress - 1, 0, 1)
464 onShowProgressChanged: if (LightDM.Greeter.authenticated && showProgress === 0) greeter.login()
480 onShowProgressChanged: if (LightDM.Greeter.authenticated && showProgress === 0) greeter.login()
465
481
@@ -498,10 +514,6 @@ Item {
498 if (greeter.narrowMode) {
514 if (greeter.narrowMode) {
499 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
515 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
500 }
516 }
501− if (!LightDM.Greeter.authenticated) {
502− lockscreen.reset();
503− lockscreen.show();
504− }
505 greeter.fakeActiveForApp = "";
517 greeter.fakeActiveForApp = "";
506 greeter.forceActiveFocus();
518 greeter.forceActiveFocus();
507 }
519 }