on xenial help sign in
Fix some focus issues
commitb059577662b507237e5095c4b2fc49dd67af7980 authorMichael Terry <michael.terry@canonical.com> dateMon 15 Sep 2014, 14:49 (12 years ago) parent7c97457
2 files changed+11−3
qml/Components/PassphraseLockscreen.qml+10−1 qml/Shell.qml+1−2
qml/Components/PassphraseLockscreen.qml+10−1
@@ -33,6 +33,7 @@ Item {
3333
3434 function clear(playAnimation) {
3535 pinentryField.text = "";
36+ pinentryField.incorrectOverride = false;
3637 pinentryField.forceActiveFocus();
3738 if (playAnimation) {
3839 wrongPasswordAnimation.start();
@@ -62,6 +63,9 @@ Item {
6263 TextInput {
6364 id: pinentryField
6465 objectName: "pinentryField"
66+
67+ property bool incorrectOverride: false
68+
6569 anchors {
6670 top: parent.top
6771 left: parent.left
@@ -86,6 +90,11 @@ Item {
8690 enabled: root.entryEnabled
8791 clip: true
8892
93+ onTextChanged: incorrectOverride = true
94+
95+ onActiveFocusChanged: if (!activeFocus) pinentryField.forceActiveFocus()
96+ onEnabledChanged: if (enabled) pinentryField.forceActiveFocus()
97+
8998 onAccepted: {
9099 if (pinentryField.text) {
91100 root.entered(pinentryField.text);
@@ -101,7 +110,7 @@ Item {
101110 anchors.horizontalCenter: parent.horizontalCenter
102111 horizontalAlignment: Text.AlignHCenter
103112 text: root.errorText
104− visible: pinentryField.text.length == 0
113+ visible: pinentryField.text.length == 0 && !pinentryField.incorrectOverride
105114 }
106115 }
107116 }
qml/Shell.qml+1−2
@@ -355,8 +355,7 @@ Item {
355355 SystemImage.factoryReset() // Ouch!
356356 }
357357 }
358−
359− if (failedLoginsDelayAttempts > 0 && AccountsService.failedLogins >= failedLoginsDelayAttempts) {
358+ if (failedLoginsDelayAttempts > 0 && AccountsService.failedLogins % failedLoginsDelayAttempts == 0) {
360359 lockscreen.delayMinutes = failedLoginsDelayMinutes
361360 forcedDelayTimer.start()
362361 }