@@ -34,13 +34,14 @@ Showable {
34 property string infoText: ""
34 property string infoText: ""
36 // Retries text (e.g. 3 retries left)
36 // Retries text (e.g. 3 retries left)
37+ // (This is not currently used, but will be necessary for SIM unlock screen)
37 property string retryText: ""
38 property string retryText: ""
39 // The text to be displayed in case the login failed
40 // The text to be displayed in case the login failed
40 property string errorText: ""
41 property string errorText: ""
42− // In case the Lockscreen can show a greeter message, this is the username
43+ // If > 0, a forced delay is happening
43− property string username: ""
44+ property int delayMinutes: 0
45 // Set those to a value greater 0 to restrict the pin length.
46 // Set those to a value greater 0 to restrict the pin length.
46 // If both are unset, the Lockscreen will show a confirm button and allow typing any length of pin before
47 // If both are unset, the Lockscreen will show a confirm button and allow typing any length of pin before
@@ -60,17 +61,6 @@ Showable {
60 signal emergencyCall()
61 signal emergencyCall()
61 signal infoPopupConfirmed()
62 signal infoPopupConfirmed()
64− if (required && pinPadLoader.item) {
69− function forceDelay(delay) {
70− forcedDelayTimer.interval = delay
71− forcedDelayTimer.start()
74 function reset() {
64 function reset() {
75 // This causes the loader below to destry and recreate the source
65 // This causes the loader below to destry and recreate the source
76 pinPadLoader.resetting = true;
66 pinPadLoader.resetting = true;
@@ -89,11 +79,6 @@ Showable {
89 PopupUtils.open(infoPopupComponent, root, {title: title, text: text})
79 PopupUtils.open(infoPopupComponent, root, {title: title, text: text})
94− onTriggered: pinPadLoader.showWrongText = false
97 Rectangle {
82 Rectangle {
98 // In case background fails to load
83 // In case background fails to load
99 id: backgroundBackup
84 id: backgroundBackup
@@ -119,25 +104,26 @@ Showable {
120 id: pinPadLoader
105 id: pinPadLoader
121 objectName: "pinPadLoader"
106 objectName: "pinPadLoader"
122− anchors {
107+ anchors.fill: parent
125− verticalCenter: parent.verticalCenter
126− verticalCenterOffset: root.alphaNumeric ? -units.gu(10) : 0
128 property bool resetting: false
108 property bool resetting: false
129 property bool waiting: false
109 property bool waiting: false
130 property bool showWrongText: false
110 property bool showWrongText: false
113+ if (resetting || !root.required) {
115+ } else if (root.delayMinutes > 0) {
116+ return "DelayedLockscreen.qml"
117+ } else if (root.alphaNumeric) {
132− source: (!resetting && root.required) ? (root.alphaNumeric ? "PassphraseLockscreen.qml" : "PinLockscreen.qml") : ""
118+ return "PassphraseLockscreen.qml"
120+ return "PinLockscreen.qml"
133 onSourceChanged: {
123 onSourceChanged: {
134 waiting = false
124 waiting = false
135 showWrongText = false
125 showWrongText = false
138− if (forcedDelayTimer.running) {
139− pinPadLoader.item.clear(true)
143 Connections {
129 Connections {
@@ -171,23 +157,27 @@ Showable {
171 Binding {
157 Binding {
172 target: pinPadLoader.item
158 target: pinPadLoader.item
173 property: "retryText"
159 property: "retryText"
174− value: forcedDelayTimer.running ? i18n.tr("Please wait") : root.retryText
160+ value: root.retryText
176 Binding {
162 Binding {
177 target: pinPadLoader.item
163 target: pinPadLoader.item
178 property: "errorText"
164 property: "errorText"
179− value: forcedDelayTimer.running ? i18n.tr("Too many incorrect attempts") :
180− (pinPadLoader.showWrongText ? root.errorText : "")
165+ value: pinPadLoader.showWrongText ? root.errorText : ""
182 Binding {
167 Binding {
183 target: pinPadLoader.item
168 target: pinPadLoader.item
184− property: "username"
169+ property: "entryEnabled"
185− value: root.username
170+ value: !pinPadLoader.waiting
187 Binding {
172 Binding {
188 target: pinPadLoader.item
173 target: pinPadLoader.item
189− property: "entryEnabled"
174+ property: "alphaNumeric"
190− value: !pinPadLoader.waiting && !forcedDelayTimer.running
175+ value: root.alphaNumeric
178+ target: pinPadLoader.item
179+ property: "delayMinutes"
180+ value: root.delayMinutes
192 Binding {
182 Binding {
193 target: pinPadLoader.item
183 target: pinPadLoader.item
@@ -196,27 +186,44 @@ Showable {
200− id: emergencyCallLabel
190+ id: emergencyCallRow
201− objectName: "emergencyCallLabel"
203 visible: showEmergencyCallButton
192 visible: showEmergencyCallButton
205 anchors {
194 anchors {
206 bottom: parent.bottom
195 bottom: parent.bottom
207− bottomMargin: units.gu(4)
196+ bottomMargin: units.gu(7) + (Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0)
208− horizontalCenter: parent.horizontalCenter
197+ left: parent.left
211− text: i18n.tr("Emergency Call")
201+ Label {
212− color: "#f3f3e7"
202+ id: emergencyCallLabel
213− opacity: 0.6
203+ objectName: "emergencyCallLabel"
214− }
204+ anchors.horizontalCenter: parent.horizontalCenter
206+ text: i18n.tr("Emergency Call")
211+ id: emergencyCallIcon
212+ anchors.left: emergencyCallLabel.right
213+ anchors.leftMargin: units.gu(1)
214+ width: emergencyCallLabel.height
215+ height: emergencyCallLabel.height
216− MouseArea {
220+ MouseArea {
221+ anchors.top: emergencyCallLabel.top
222+ anchors.bottom: emergencyCallLabel.bottom
217− anchors.fill: emergencyCallLabel
223+ anchors.left: emergencyCallLabel.left
224+ anchors.right: emergencyCallIcon.right
218− onClicked: root.emergencyCall()
225+ onClicked: root.emergencyCall()
219− enabled: emergencyCallLabel.visible
226+ }
222 Component {
229 Component {