on xenial help sign in
Add back retryText, but squish pin header box slightly to compensate
9b6e865Michael Terry
qml/Components/Lockscreen.qml+9
@@ -27,6 +27,10 @@ Showable {
27 // Informational text. (e.g. some text to tell which domain this is pin is entered for)
27 // Informational text. (e.g. some text to tell which domain this is pin is entered for)
28 property string infoText: ""
28 property string infoText: ""
29
29
30+ // Retries text (e.g. 3 retries left)
31+ // (This is not currently used, but will be necessary for SIM unlock screen)
32+ property string retryText: ""
33+
30 // The text to be displayed in case the login failed
34 // The text to be displayed in case the login failed
31 property string errorText: ""
35 property string errorText: ""
32
36
@@ -143,6 +147,11 @@ Showable {
143 property: "infoText"
147 property: "infoText"
144 value: root.infoText
148 value: root.infoText
145 }
149 }
150+ Binding {
151+ target: pinPadLoader.item
152+ property: "retryText"
153+ value: root.retryText
154+ }
146 Binding {
155 Binding {
147 target: pinPadLoader.item
156 target: pinPadLoader.item
148 property: "errorText"
157 property: "errorText"
qml/Components/PinLockscreen.qml+10−1
@@ -27,6 +27,7 @@ Column {
27 spacing: units.gu(2)
27 spacing: units.gu(2)
28
28
29 property string infoText
29 property string infoText
30+ property string retryText
30 property string errorText
31 property string errorText
31 property int padWidth: units.gu(34)
32 property int padWidth: units.gu(34)
32 property int padHeight: units.gu(28)
33 property int padHeight: units.gu(28)
@@ -50,7 +51,7 @@ Column {
50 id: shakeContainer
51 id: shakeContainer
51 anchors.horizontalCenter: parent.horizontalCenter
52 anchors.horizontalCenter: parent.horizontalCenter
52 width: parent.width
53 width: parent.width
53− spacing: units.gu(2)
54+ spacing: units.gu(1)
54
55
55 Label {
56 Label {
56 id: infoField
57 id: infoField
@@ -133,6 +134,14 @@ Column {
133 onClicked: pinentryField.backspace()
134 onClicked: pinentryField.backspace()
134 }
135 }
135 }
136 }
137+
138+ Label {
139+ objectName: "retryLabel"
140+ fontSize: "x-small"
141+ color: "#f3f3e7"
142+ anchors.horizontalCenter: parent.horizontalCenter
143+ text: root.retryText || " "
144+ }
136 }
145 }
137
146
138 ThinDivider {
147 ThinDivider {
tests/qmltests/Greeter/tst_Lockscreen.qml+28−1
@@ -26,7 +26,7 @@ import Unity.Test 0.1 as UT
26Rectangle {
26Rectangle {
27 id: root
27 id: root
28 width: units.gu(80)
28 width: units.gu(80)
29− height: units.gu(70)
29+ height: units.gu(76)
30 color: "orange"
30 color: "orange"
31
31
32 Lockscreen {
32 Lockscreen {
@@ -34,6 +34,7 @@ Rectangle {
34 anchors.fill: parent
34 anchors.fill: parent
35 anchors.rightMargin: units.gu(40)
35 anchors.rightMargin: units.gu(40)
36 infoText: infoTextTextField.text
36 infoText: infoTextTextField.text
37+ retryText: retryCountTextField.text
37 errorText: errorTextTextField.text
38 errorText: errorTextTextField.text
38 alphaNumeric: pinPadCheckBox.checked
39 alphaNumeric: pinPadCheckBox.checked
39 minPinLength: minPinLengthTextField.text
40 minPinLength: minPinLengthTextField.text
@@ -118,6 +119,16 @@ Rectangle {
118 text: "Max PIN length"
119 text: "Max PIN length"
119 }
120 }
120 }
121 }
122+ Row {
123+ TextField {
124+ id: retryCountTextField
125+ width: units.gu(7)
126+ text: "3 retries left"
127+ }
128+ Label {
129+ text: "Retries left"
130+ }
131+ }
121 Row {
132 Row {
122 TextField {
133 TextField {
123 id: delayMinutesTextField
134 id: delayMinutesTextField
@@ -411,6 +422,22 @@ Rectangle {
411 }
422 }
412 }
423 }
413
424
425+ function test_retryDisplay_data() {
426+ return [
427+ {tag: "empty", retryText: " "},
428+ {tag: "3 retries left", retryText: "3 retries left"},
429+ ]
430+ }
431+
432+ function test_retryDisplay(data) {
433+ pinPadCheckBox.checked = false
434+ waitForLockscreenReady();
435+
436+ retryCountTextField.text = data.retryText;
437+ var label = findChild(lockscreen, "retryLabel")
438+ compare(label.text, data.retryText);
439+ }
440+
414 function test_infoPopup() {
441 function test_infoPopup() {
415 verify(findChild(root, "infoPopup") === null);
442 verify(findChild(root, "infoPopup") === null);
416 lockscreen.showInfoPopup("foo", "bar");
443 lockscreen.showInfoPopup("foo", "bar");