@@ -27,14 +27,11 @@ 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− property string retryText: ""
32−
3330 // The text to be displayed in case the login failed
3431 property string errorText: ""
3532
36− // In case the Lockscreen can show a greeter message, this is the username
37− property string username: ""
33+ // If > 0, a forced delay is happening
34+ property int delayMinutes: 0
3835
3936 // Set those to a value greater 0 to restrict the pin length.
4037 // If both are unset, the Lockscreen will show a confirm button and allow typing any length of pin before
@@ -60,11 +57,6 @@ Showable {
6057 }
6158 }
6259
63− function forceDelay(delay) {
64− forcedDelayTimer.interval = delay
65− forcedDelayTimer.start()
66− }
67−
6860 function reset() {
6961 // This causes the loader below to destry and recreate the source
7062 pinPadLoader.resetting = true;
@@ -83,11 +75,6 @@ Showable {
8375 PopupUtils.open(infoPopupComponent, root, {title: title, text: text})
8476 }
8577
86− Timer {
87− id: forcedDelayTimer
88− onTriggered: pinPadLoader.showWrongText = false
89− }
90−
9178 Rectangle {
9279 // In case background fails to load or is undefined
9380 id: backgroundBackup
@@ -112,26 +99,26 @@ Showable {
11299 Loader {
113100 id: pinPadLoader
114101 objectName: "pinPadLoader"
115− anchors {
116− left: parent.left
117− right: parent.right
118− verticalCenter: parent.verticalCenter
119− verticalCenterOffset: root.alphaNumeric ? -units.gu(10) : 0
120− }
102+ anchors.fill: parent
121103 property bool resetting: false
122104 property bool waiting: false
123105 property bool showWrongText: false
124106
125− source: (!resetting && root.required) ? (root.alphaNumeric ? "PassphraseLockscreen.qml" : "PinLockscreen.qml") : ""
107+ source: {
108+ if (resetting || !root.required) {
109+ return ""
110+ } else if (root.delayMinutes > 0) {
111+ return "DelayedLockscreen.qml"
112+ } else if (root.alphaNumeric) {
113+ return "PassphraseLockscreen.qml"
114+ } else {
115+ return "PinLockscreen.qml"
116+ }
117+ }
126118 onSourceChanged: {
127119 waiting = false
128120 showWrongText = false
129121 }
130− onLoaded: {
131− if (forcedDelayTimer.running) {
132− pinPadLoader.item.clear(true)
133− }
134− }
135122
136123 Connections {
137124 target: pinPadLoader.item
@@ -163,30 +150,28 @@ Showable {
163150 }
164151 Binding {
165152 target: pinPadLoader.item
166− property: "retryText"
167− value: forcedDelayTimer.running ? i18n.tr("Please wait") : root.retryText
153+ property: "errorText"
154+ value: pinPadLoader.showWrongText ? root.errorText : ""
168155 }
169156 Binding {
170157 target: pinPadLoader.item
171− property: "errorText"
172− value: forcedDelayTimer.running ? i18n.tr("Too many incorrect attempts") :
173− (pinPadLoader.showWrongText ? root.errorText : "")
158+ property: "entryEnabled"
159+ value: !pinPadLoader.waiting
174160 }
175161 Binding {
176162 target: pinPadLoader.item
177− property: "username"
178− value: root.username
163+ property: "alphaNumeric"
164+ value: root.alphaNumeric
179165 }
180166 Binding {
181167 target: pinPadLoader.item
182− property: "entryEnabled"
183− value: !pinPadLoader.waiting && !forcedDelayTimer.running
168+ property: "delayMinutes"
169+ value: root.delayMinutes
184170 }
185171 }
186172
187− Label {
188− id: emergencyCallLabel
189− objectName: "emergencyCallLabel"
173+ Item {
174+ id: emergencyCallRow
190175
191176 // FIXME: We *should* show emergency dialer if there is a SIM present,
192177 // regardless of whether the side stage is enabled. But right now,
@@ -199,19 +184,37 @@ Showable {
199184
200185 anchors {
201186 bottom: parent.bottom
202− bottomMargin: units.gu(4)
203− horizontalCenter: parent.horizontalCenter
187+ bottomMargin: units.gu(7) + (Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0)
188+ left: parent.left
189+ right: parent.right
204190 }
205191
206− text: i18n.tr("Emergency Call")
207− color: "#f3f3e7"
208− opacity: 0.6
209− }
192+ Label {
193+ id: emergencyCallLabel
194+ objectName: "emergencyCallLabel"
195+ anchors.horizontalCenter: parent.horizontalCenter
210196
211− MouseArea {
212− anchors.fill: emergencyCallLabel
213− onClicked: root.emergencyCall()
214− enabled: emergencyCallLabel.visible
197+ text: i18n.tr("Emergency Call")
198+ color: "#f3f3e7"
199+ }
200+
201+ Icon {
202+ id: emergencyCallIcon
203+ anchors.left: emergencyCallLabel.right
204+ anchors.leftMargin: units.gu(1)
205+ width: emergencyCallLabel.height
206+ height: emergencyCallLabel.height
207+ name: "call-start"
208+ color: "#f3f3e7"
209+ }
210+
211+ MouseArea {
212+ anchors.top: emergencyCallLabel.top
213+ anchors.bottom: emergencyCallLabel.bottom
214+ anchors.left: emergencyCallLabel.left
215+ anchors.right: emergencyCallIcon.right
216+ onClicked: root.emergencyCall()
217+ }
215218 }
216219
217220 Component {