on xenial help sign in
Add back retryText, but squish pin header box slightly to compensate
commit9b6e86538154d43082f8a604c653e8f7012f08d9 authorMichael Terry <michael.terry@canonical.com> dateWed 17 Sep 2014, 10:35 (12 years ago) parent3e2956a
3 files changed+47−2
qml/Components/Lockscreen.qml+9 qml/Components/PinLockscreen.qml+10−1 tests/qmltests/Greeter/tst_Lockscreen.qml+28−1
qml/Components/Lockscreen.qml+9
@@ -27,6 +27,10 @@ Showable {
2727 // Informational text. (e.g. some text to tell which domain this is pin is entered for)
2828 property string infoText: ""
2929
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+
3034 // The text to be displayed in case the login failed
3135 property string errorText: ""
3236
@@ -143,6 +147,11 @@ Showable {
143147 property: "infoText"
144148 value: root.infoText
145149 }
150+ Binding {
151+ target: pinPadLoader.item
152+ property: "retryText"
153+ value: root.retryText
154+ }
146155 Binding {
147156 target: pinPadLoader.item
148157 property: "errorText"
qml/Components/PinLockscreen.qml+10−1
@@ -27,6 +27,7 @@ Column {
2727 spacing: units.gu(2)
2828
2929 property string infoText
30+ property string retryText
3031 property string errorText
3132 property int padWidth: units.gu(34)
3233 property int padHeight: units.gu(28)
@@ -50,7 +51,7 @@ Column {
5051 id: shakeContainer
5152 anchors.horizontalCenter: parent.horizontalCenter
5253 width: parent.width
53− spacing: units.gu(2)
54+ spacing: units.gu(1)
5455
5556 Label {
5657 id: infoField
@@ -133,6 +134,14 @@ Column {
133134 onClicked: pinentryField.backspace()
134135 }
135136 }
137+
138+ Label {
139+ objectName: "retryLabel"
140+ fontSize: "x-small"
141+ color: "#f3f3e7"
142+ anchors.horizontalCenter: parent.horizontalCenter
143+ text: root.retryText || " "
144+ }
136145 }
137146
138147 ThinDivider {
tests/qmltests/Greeter/tst_Lockscreen.qml+28−1
@@ -26,7 +26,7 @@ import Unity.Test 0.1 as UT
2626Rectangle {
2727 id: root
2828 width: units.gu(80)
29− height: units.gu(70)
29+ height: units.gu(76)
3030 color: "orange"
3131
3232 Lockscreen {
@@ -34,6 +34,7 @@ Rectangle {
3434 anchors.fill: parent
3535 anchors.rightMargin: units.gu(40)
3636 infoText: infoTextTextField.text
37+ retryText: retryCountTextField.text
3738 errorText: errorTextTextField.text
3839 alphaNumeric: pinPadCheckBox.checked
3940 minPinLength: minPinLengthTextField.text
@@ -118,6 +119,16 @@ Rectangle {
118119 text: "Max PIN length"
119120 }
120121 }
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+ }
121132 Row {
122133 TextField {
123134 id: delayMinutesTextField
@@ -411,6 +422,22 @@ Rectangle {
411422 }
412423 }
413424
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+
414441 function test_infoPopup() {
415442 verify(findChild(root, "infoPopup") === null);
416443 lockscreen.showInfoPopup("foo", "bar");