@@ -27,14 +27,11 @@ 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: ""
30− // Retries text (e.g. 3 retries left)
31− property string retryText: ""
33 // The text to be displayed in case the login failed
30 // The text to be displayed in case the login failed
34 property string errorText: ""
31 property string errorText: ""
36− // In case the Lockscreen can show a greeter message, this is the username
33+ // If > 0, a forced delay is happening
37− property string username: ""
34+ property int delayMinutes: 0
39 // Set those to a value greater 0 to restrict the pin length.
36 // Set those to a value greater 0 to restrict the pin length.
40 // If both are unset, the Lockscreen will show a confirm button and allow typing any length of pin before
37 // If both are unset, the Lockscreen will show a confirm button and allow typing any length of pin before
@@ -60,11 +57,6 @@ Showable {
63− function forceDelay(delay) {
64− forcedDelayTimer.interval = delay
65− forcedDelayTimer.start()
68 function reset() {
60 function reset() {
69 // This causes the loader below to destry and recreate the source
61 // This causes the loader below to destry and recreate the source
70 pinPadLoader.resetting = true;
62 pinPadLoader.resetting = true;
@@ -83,11 +75,6 @@ Showable {
83 PopupUtils.open(infoPopupComponent, root, {title: title, text: text})
75 PopupUtils.open(infoPopupComponent, root, {title: title, text: text})
88− onTriggered: pinPadLoader.showWrongText = false
91 Rectangle {
78 Rectangle {
92 // In case background fails to load or is undefined
79 // In case background fails to load or is undefined
93 id: backgroundBackup
80 id: backgroundBackup
@@ -112,26 +99,26 @@ Showable {
113 id: pinPadLoader
100 id: pinPadLoader
114 objectName: "pinPadLoader"
101 objectName: "pinPadLoader"
115− anchors {
102+ anchors.fill: parent
118− verticalCenter: parent.verticalCenter
119− verticalCenterOffset: root.alphaNumeric ? -units.gu(10) : 0
121 property bool resetting: false
103 property bool resetting: false
122 property bool waiting: false
104 property bool waiting: false
123 property bool showWrongText: false
105 property bool showWrongText: false
108+ if (resetting || !root.required) {
110+ } else if (root.delayMinutes > 0) {
111+ return "DelayedLockscreen.qml"
112+ } else if (root.alphaNumeric) {
125− source: (!resetting && root.required) ? (root.alphaNumeric ? "PassphraseLockscreen.qml" : "PinLockscreen.qml") : ""
113+ return "PassphraseLockscreen.qml"
115+ return "PinLockscreen.qml"
126 onSourceChanged: {
118 onSourceChanged: {
127 waiting = false
119 waiting = false
128 showWrongText = false
120 showWrongText = false
131− if (forcedDelayTimer.running) {
132− pinPadLoader.item.clear(true)
136 Connections {
123 Connections {
137 target: pinPadLoader.item
124 target: pinPadLoader.item
@@ -163,30 +150,28 @@ Showable {
164 Binding {
151 Binding {
165 target: pinPadLoader.item
152 target: pinPadLoader.item
166− property: "retryText"
153+ property: "errorText"
167− value: forcedDelayTimer.running ? i18n.tr("Please wait") : root.retryText
154+ value: pinPadLoader.showWrongText ? root.errorText : ""
169 Binding {
156 Binding {
170 target: pinPadLoader.item
157 target: pinPadLoader.item
171− property: "errorText"
158+ property: "entryEnabled"
172− value: forcedDelayTimer.running ? i18n.tr("Too many incorrect attempts") :
159+ value: !pinPadLoader.waiting
173− (pinPadLoader.showWrongText ? root.errorText : "")
175 Binding {
161 Binding {
176 target: pinPadLoader.item
162 target: pinPadLoader.item
177− property: "username"
163+ property: "alphaNumeric"
178− value: root.username
164+ value: root.alphaNumeric
180 Binding {
166 Binding {
181 target: pinPadLoader.item
167 target: pinPadLoader.item
182− property: "entryEnabled"
168+ property: "delayMinutes"
183− value: !pinPadLoader.waiting && !forcedDelayTimer.running
169+ value: root.delayMinutes
188− id: emergencyCallLabel
174+ id: emergencyCallRow
189− objectName: "emergencyCallLabel"
191 // FIXME: We *should* show emergency dialer if there is a SIM present,
176 // FIXME: We *should* show emergency dialer if there is a SIM present,
192 // regardless of whether the side stage is enabled. But right now,
177 // regardless of whether the side stage is enabled. But right now,
@@ -199,19 +184,37 @@ Showable {
200 anchors {
185 anchors {
201 bottom: parent.bottom
186 bottom: parent.bottom
202− bottomMargin: units.gu(4)
187+ bottomMargin: units.gu(7) + (Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0)
203− horizontalCenter: parent.horizontalCenter
188+ left: parent.left
206− text: i18n.tr("Emergency Call")
192+ Label {
207− color: "#f3f3e7"
193+ id: emergencyCallLabel
208− opacity: 0.6
194+ objectName: "emergencyCallLabel"
209− }
195+ anchors.horizontalCenter: parent.horizontalCenter
197+ text: i18n.tr("Emergency Call")
202+ id: emergencyCallIcon
203+ anchors.left: emergencyCallLabel.right
204+ anchors.leftMargin: units.gu(1)
205+ width: emergencyCallLabel.height
206+ height: emergencyCallLabel.height
211− MouseArea {
211+ MouseArea {
212+ anchors.top: emergencyCallLabel.top
213+ anchors.bottom: emergencyCallLabel.bottom
212− anchors.fill: emergencyCallLabel
214+ anchors.left: emergencyCallLabel.left
215+ anchors.right: emergencyCallIcon.right
213− onClicked: root.emergencyCall()
216+ onClicked: root.emergencyCall()
214− enabled: emergencyCallLabel.visible
217+ }
217 Component {
220 Component {