@@ -33,6 +33,7 @@ Item {
34 function clear(playAnimation) {
34 function clear(playAnimation) {
35 pinentryField.text = "";
35 pinentryField.text = "";
36+ pinentryField.incorrectOverride = false;
36 pinentryField.forceActiveFocus();
37 pinentryField.forceActiveFocus();
37 if (playAnimation) {
38 if (playAnimation) {
38 wrongPasswordAnimation.start();
39 wrongPasswordAnimation.start();
@@ -62,6 +63,9 @@ Item {
62 TextInput {
63 TextInput {
63 id: pinentryField
64 id: pinentryField
64 objectName: "pinentryField"
65 objectName: "pinentryField"
67+ property bool incorrectOverride: false
66 top: parent.top
70 top: parent.top
67 left: parent.left
71 left: parent.left
@@ -86,6 +90,11 @@ Item {
86 enabled: root.entryEnabled
90 enabled: root.entryEnabled
87 clip: true
91 clip: true
93+ onTextChanged: incorrectOverride = true
95+ onActiveFocusChanged: if (!activeFocus) pinentryField.forceActiveFocus()
96+ onEnabledChanged: if (enabled) pinentryField.forceActiveFocus()
89 onAccepted: {
98 onAccepted: {
90 if (pinentryField.text) {
99 if (pinentryField.text) {
91 root.entered(pinentryField.text);
100 root.entered(pinentryField.text);
@@ -101,7 +110,7 @@ Item {
101 anchors.horizontalCenter: parent.horizontalCenter
110 anchors.horizontalCenter: parent.horizontalCenter
102 horizontalAlignment: Text.AlignHCenter
111 horizontalAlignment: Text.AlignHCenter
103 text: root.errorText
112 text: root.errorText
104− visible: pinentryField.text.length == 0
113+ visible: pinentryField.text.length == 0 && !pinentryField.incorrectOverride