@@ -34,13 +34,14 @@ Showable {
3434 property string infoText: ""
3535
3636 // Retries text (e.g. 3 retries left)
37+ // (This is not currently used, but will be necessary for SIM unlock screen)
3738 property string retryText: ""
3839
3940 // The text to be displayed in case the login failed
4041 property string errorText: ""
4142
42− // In case the Lockscreen can show a greeter message, this is the username
43− property string username: ""
43+ // If > 0, a forced delay is happening
44+ property int delayMinutes: 0
4445
4546 // Set those to a value greater 0 to restrict the pin length.
4647 // If both are unset, the Lockscreen will show a confirm button and allow typing any length of pin before
@@ -60,17 +61,6 @@ Showable {
6061 signal emergencyCall()
6162 signal infoPopupConfirmed()
6263
63− onRequiredChanged: {
64− if (required && pinPadLoader.item) {
65− clear(false)
66− }
67− }
68−
69− function forceDelay(delay) {
70− forcedDelayTimer.interval = delay
71− forcedDelayTimer.start()
72− }
73−
7464 function reset() {
7565 // This causes the loader below to destry and recreate the source
7666 pinPadLoader.resetting = true;
@@ -89,11 +79,6 @@ Showable {
8979 PopupUtils.open(infoPopupComponent, root, {title: title, text: text})
9080 }
9181
92− Timer {
93− id: forcedDelayTimer
94− onTriggered: pinPadLoader.showWrongText = false
95− }
96−
9782 Rectangle {
9883 // In case background fails to load
9984 id: backgroundBackup
@@ -119,25 +104,26 @@ Showable {
119104 Loader {
120105 id: pinPadLoader
121106 objectName: "pinPadLoader"
122− anchors {
123− left: parent.left
124− right: parent.right
125− verticalCenter: parent.verticalCenter
126− verticalCenterOffset: root.alphaNumeric ? -units.gu(10) : 0
127− }
107+ anchors.fill: parent
128108 property bool resetting: false
129109 property bool waiting: false
130110 property bool showWrongText: false
131111
132− source: (!resetting && root.required) ? (root.alphaNumeric ? "PassphraseLockscreen.qml" : "PinLockscreen.qml") : ""
112+ source: {
113+ if (resetting || !root.required) {
114+ return ""
115+ } else if (root.delayMinutes > 0) {
116+ return "DelayedLockscreen.qml"
117+ } else if (root.alphaNumeric) {
118+ return "PassphraseLockscreen.qml"
119+ } else {
120+ return "PinLockscreen.qml"
121+ }
122+ }
133123 onSourceChanged: {
134124 waiting = false
135125 showWrongText = false
136− }
137− onLoaded: {
138− if (forcedDelayTimer.running) {
139− pinPadLoader.item.clear(true)
140− }
126+ clear(false)
141127 }
142128
143129 Connections {
@@ -171,23 +157,27 @@ Showable {
171157 Binding {
172158 target: pinPadLoader.item
173159 property: "retryText"
174− value: forcedDelayTimer.running ? i18n.tr("Please wait") : root.retryText
160+ value: root.retryText
175161 }
176162 Binding {
177163 target: pinPadLoader.item
178164 property: "errorText"
179− value: forcedDelayTimer.running ? i18n.tr("Too many incorrect attempts") :
180− (pinPadLoader.showWrongText ? root.errorText : "")
165+ value: pinPadLoader.showWrongText ? root.errorText : ""
181166 }
182167 Binding {
183168 target: pinPadLoader.item
184− property: "username"
185− value: root.username
169+ property: "entryEnabled"
170+ value: !pinPadLoader.waiting
186171 }
187172 Binding {
188173 target: pinPadLoader.item
189− property: "entryEnabled"
190− value: !pinPadLoader.waiting && !forcedDelayTimer.running
174+ property: "alphaNumeric"
175+ value: root.alphaNumeric
176+ }
177+ Binding {
178+ target: pinPadLoader.item
179+ property: "delayMinutes"
180+ value: root.delayMinutes
191181 }
192182 Binding {
193183 target: pinPadLoader.item
@@ -196,27 +186,44 @@ Showable {
196186 }
197187 }
198188
199− Label {
200− id: emergencyCallLabel
201− objectName: "emergencyCallLabel"
189+ Item {
190+ id: emergencyCallRow
202191
203192 visible: showEmergencyCallButton
204193
205194 anchors {
206195 bottom: parent.bottom
207− bottomMargin: units.gu(4)
208− horizontalCenter: parent.horizontalCenter
196+ bottomMargin: units.gu(7) + (Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0)
197+ left: parent.left
198+ right: parent.right
209199 }
210200
211− text: i18n.tr("Emergency Call")
212− color: "#f3f3e7"
213− opacity: 0.6
214− }
201+ Label {
202+ id: emergencyCallLabel
203+ objectName: "emergencyCallLabel"
204+ anchors.horizontalCenter: parent.horizontalCenter
215205
216− MouseArea {
217− anchors.fill: emergencyCallLabel
218− onClicked: root.emergencyCall()
219− enabled: emergencyCallLabel.visible
206+ text: i18n.tr("Emergency Call")
207+ color: "#f3f3e7"
208+ }
209+
210+ Icon {
211+ id: emergencyCallIcon
212+ anchors.left: emergencyCallLabel.right
213+ anchors.leftMargin: units.gu(1)
214+ width: emergencyCallLabel.height
215+ height: emergencyCallLabel.height
216+ name: "call-start"
217+ color: "#f3f3e7"
218+ }
219+
220+ MouseArea {
221+ anchors.top: emergencyCallLabel.top
222+ anchors.bottom: emergencyCallLabel.bottom
223+ anchors.left: emergencyCallLabel.left
224+ anchors.right: emergencyCallIcon.right
225+ onClicked: root.emergencyCall()
226+ }
220227 }
221228
222229 Component {