on xenial help sign in
Show a spinner while waiting for PAM, clean up wrong-password text handling
d73fdc5Michael Terry
qml/Components/Lockscreen.qml+14−21
@@ -77,6 +77,7 @@ Showable {
77 if (pinPadLoader.item) {
77 if (pinPadLoader.item) {
78 pinPadLoader.item.clear(showAnimation);
78 pinPadLoader.item.clear(showAnimation);
79 }
79 }
80+ pinPadLoader.showWrongText = showAnimation
80 pinPadLoader.waiting = false
81 pinPadLoader.waiting = false
81 }
82 }
82
83
@@ -86,6 +87,7 @@ Showable {
86
87
87 Timer {
88 Timer {
88 id: forcedDelayTimer
89 id: forcedDelayTimer
90+ onTriggered: pinPadLoader.showWrongText = false
89 }
91 }
90
92
91 Rectangle {
93 Rectangle {
@@ -117,19 +119,6 @@ Showable {
117 bottom: pinPadLoader.top
119 bottom: pinPadLoader.top
118 bottomMargin: units.gu(2)
120 bottomMargin: units.gu(2)
119 }
121 }
120− Label {
121− id: delayTextLabel
122− objectName: "delayTextLabel"
123− anchors {
124− left: parent.left
125− right: parent.right
126− }
127− text: i18n.tr("Too many incorrect attempts, please wait")
128− horizontalAlignment: Text.AlignHCenter
129− color: "#f3f3e7"
130− opacity: 0.6
131− visible: forcedDelayTimer.running
132− }
133 Label {
122 Label {
134 objectName: "retryCountLabel"
123 objectName: "retryCountLabel"
135 anchors {
124 anchors {
@@ -157,8 +146,6 @@ Showable {
157 }
146 }
158 }
147 }
159
148
160−
161−
162 Loader {
149 Loader {
163 id: pinPadLoader
150 id: pinPadLoader
164 objectName: "pinPadLoader"
151 objectName: "pinPadLoader"
@@ -170,6 +157,7 @@ Showable {
170 }
157 }
171 property bool resetting: false
158 property bool resetting: false
172 property bool waiting: false
159 property bool waiting: false
160+ property bool showWrongText: false
173
161
174 source: (!resetting && root.required) ? (root.alphaNumeric ? "PassphraseLockscreen.qml" : "PinLockscreen.qml") : ""
162 source: (!resetting && root.required) ? (root.alphaNumeric ? "PassphraseLockscreen.qml" : "PinLockscreen.qml") : ""
175
163
@@ -199,12 +187,12 @@ Showable {
199 Binding {
187 Binding {
200 target: pinPadLoader.item
188 target: pinPadLoader.item
201 property: "placeholderText"
189 property: "placeholderText"
202− value: root.placeholderText
190+ value: forcedDelayTimer.running ?
203− }
191+ (i18n.tr("Too many incorrect attempts") +
204− Binding {
192+ "\n" +
193+ i18n.tr("Please wait")) :
205− target: pinPadLoader.item
194+ (pinPadLoader.showWrongText ?
206− property: "wrongPlaceholderText"
195+ root.wrongPlaceholderText : root.placeholderText)
207− value: root.wrongPlaceholderText
208 }
196 }
209 Binding {
197 Binding {
210 target: pinPadLoader.item
198 target: pinPadLoader.item
@@ -216,6 +204,11 @@ Showable {
216 property: "entryEnabled"
204 property: "entryEnabled"
217 value: !pinPadLoader.waiting && !forcedDelayTimer.running
205 value: !pinPadLoader.waiting && !forcedDelayTimer.running
218 }
206 }
207+ Binding {
208+ target: pinPadLoader.item
209+ property: "waiting"
210+ value: pinPadLoader.waiting
211+ }
219 }
212 }
220
213
221 Column {
214 Column {
qml/Components/PassphraseLockscreen.qml+10−2
@@ -23,9 +23,9 @@ Item {
23 height: highlightItem.height
23 height: highlightItem.height
24
24
25 property string placeholderText
25 property string placeholderText
26− property string wrongPlaceholderText
27 property string username: ""
26 property string username: ""
28 property bool entryEnabled: true
27 property bool entryEnabled: true
28+ property bool waiting: false
29
29
30 signal entered(string passphrase)
30 signal entered(string passphrase)
31 signal cancel()
31 signal cancel()
@@ -77,13 +77,21 @@ Item {
77 opacity: 0.9
77 opacity: 0.9
78 hasClearButton: false
78 hasClearButton: false
79 enabled: entryEnabled
79 enabled: entryEnabled
80− placeholderText: wrongPasswordAnimation.running ? root.wrongPlaceholderText : root.placeholderText
80+ placeholderText: root.placeholderText
81
81
82 onAccepted: {
82 onAccepted: {
83 if (pinentryField.text) {
83 if (pinentryField.text) {
84 root.entered(pinentryField.text);
84 root.entered(pinentryField.text);
85 }
85 }
86 }
86 }
87+
88+ ActivityIndicator {
89+ id: spinner
90+ anchors.verticalCenter: parent.verticalCenter
91+ anchors.right: parent.right
92+ anchors.rightMargin: units.gu(1)
93+ running: root.waiting
94+ }
87 }
95 }
88 }
96 }
89
97
qml/Components/PinLockscreen.qml+9−5
@@ -25,7 +25,6 @@ Column {
25 spacing: units.gu(3.5)
25 spacing: units.gu(3.5)
26
26
27 property alias placeholderText: pinentryField.placeholderText
27 property alias placeholderText: pinentryField.placeholderText
28− property alias wrongPlaceholderText: pinentryField.wrongPlaceholderText
29 property int padWidth: units.gu(34)
28 property int padWidth: units.gu(34)
30 property int padHeight: units.gu(28)
29 property int padHeight: units.gu(28)
31 property int minPinLength: -1
30 property int minPinLength: -1
@@ -35,10 +34,10 @@ Column {
35 signal cancel()
34 signal cancel()
36
35
37 property bool entryEnabled: true
36 property bool entryEnabled: true
37+ property bool waiting: false
38
38
39 function clear(playAnimation) {
39 function clear(playAnimation) {
40 pinentryField.text = "";
40 pinentryField.text = "";
41− pinentryFieldPlaceHolder.text = playAnimation ? wrongPlaceholderText : placeholderText
42 if (playAnimation) {
41 if (playAnimation) {
43 wrongPasswordAnimation.start();
42 wrongPasswordAnimation.start();
44 }
43 }
@@ -59,7 +58,6 @@ Column {
59 radius: "medium"
58 radius: "medium"
60 property string text: ""
59 property string text: ""
61 property string placeholderText: ""
60 property string placeholderText: ""
62− property string wrongPlaceholderText: ""
63
61
64 function appendChar(character) {
62 function appendChar(character) {
65 if (root.maxPinLength == -1 || pinentryField.text.length < root.maxPinLength) {
63 if (root.maxPinLength == -1 || pinentryField.text.length < root.maxPinLength) {
@@ -77,6 +75,11 @@ Column {
77 }
75 }
78 }
76 }
79
77
78+ ActivityIndicator {
79+ id: spinner
80+ anchors.centerIn: parent
81+ running: root.waiting
82+ }
80 Label {
83 Label {
81 id: pinentryFieldLabel
84 id: pinentryFieldLabel
82 anchors.centerIn: parent
85 anchors.centerIn: parent
@@ -86,6 +89,7 @@ Column {
86 font.pixelSize: units.dp(44)
89 font.pixelSize: units.dp(44)
87 color: "#f3f3e7"
90 color: "#f3f3e7"
88 opacity: 0.6
91 opacity: 0.6
92+ visible: !spinner.running
89 }
93 }
90 Label {
94 Label {
91 id: pinentryFieldPlaceHolder
95 id: pinentryFieldPlaceHolder
@@ -95,7 +99,7 @@ Column {
95 color: "#f3f3e7"
99 color: "#f3f3e7"
96 opacity: 0.6
100 opacity: 0.6
97 text: parent.placeholderText
101 text: parent.placeholderText
98− visible: pinentryFieldLabel.text.length == 0
102+ visible: !spinner.running && pinentryFieldLabel.text.length == 0
99 }
103 }
100
104
101 Icon {
105 Icon {
@@ -109,7 +113,7 @@ Column {
109 bottom: parent.bottom
113 bottom: parent.bottom
110 bottomMargin: units.gu(1)
114 bottomMargin: units.gu(1)
111 }
115 }
112− visible: !priv.autoConfirm
116+ visible: !spinner.running && entryEnabled && !priv.autoConfirm
113 width: height
117 width: height
114 name: "erase"
118 name: "erase"
115 color: "#f3f3e7"
119 color: "#f3f3e7"