on xenial help sign in
Dual SIM pin unlocking. Hook up the UI to the backend. Fixes: 1267135, 1336675, 1357000, 1359226, 1361074
45e8385Antti Kaijanmäki
po/unity8.pot+19−27
@@ -8,7 +8,7 @@ msgid ""
8msgstr ""
8msgstr ""
9"Project-Id-Version: unity8\n"
9"Project-Id-Version: unity8\n"
10"Report-Msgid-Bugs-To: \n"
10"Report-Msgid-Bugs-To: \n"
11−"POT-Creation-Date: 2014-10-03 08:13-0400\n"
11+"POT-Creation-Date: 2014-10-07 11:37+0300\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -152,23 +152,23 @@ msgid ""
152"phone<br><br>Tap on the screen to start"
152"phone<br><br>Tap on the screen to start"
153msgstr ""
153msgstr ""
154
154
155−#: qml/Components/Lockscreen.qml:218
155+#: qml/Components/Lockscreen.qml:220
156msgid "Emergency Call"
156msgid "Emergency Call"
157msgstr ""
157msgstr ""
158
158
159−#: qml/Components/Lockscreen.qml:250
159+#: qml/Components/Lockscreen.qml:252
160msgid "OK"
160msgid "OK"
161msgstr ""
161msgstr ""
162
162
163−#: qml/Dash/GenericScopeView.qml:411 qml/Dash/GenericScopeView.qml:568
163+#: qml/Dash/GenericScopeView.qml:434 qml/Dash/GenericScopeView.qml:591
164msgid "See less"
164msgid "See less"
165msgstr ""
165msgstr ""
166
166
167−#: qml/Dash/GenericScopeView.qml:411
167+#: qml/Dash/GenericScopeView.qml:434
168msgid "See all"
168msgid "See all"
169msgstr ""
169msgstr ""
170
170
171−#: qml/Dash/GenericScopeView.qml:473 qml/Dash/PageHeader.qml:258
171+#: qml/Dash/GenericScopeView.qml:496 qml/Dash/PageHeader.qml:258
172#: qml/Panel/SearchIndicator.qml:27
172#: qml/Panel/SearchIndicator.qml:27
173msgid "Search"
173msgid "Search"
174msgstr ""
174msgstr ""
@@ -257,18 +257,10 @@ msgstr ""
257msgid "Speaking..."
257msgid "Speaking..."
258msgstr ""
258msgstr ""
259
259
260−#: qml/Notifications/NotificationMenuItemFactory.qml:108
260+#: qml/Notifications/NotificationMenuItemFactory.qml:116
261msgid "Show password"
261msgid "Show password"
262msgstr ""
262msgstr ""
263
263
264−#: qml/Notifications/NotificationMenuItemFactory.qml:124
265−msgid "Enter SIM PIN"
266−msgstr ""
267−
268−#: qml/Notifications/NotificationMenuItemFactory.qml:125
269−msgid "Sorry, incorrect PIN"
270−msgstr ""
271−
272#: qml/Panel/ActiveCallHint.qml:77
264#: qml/Panel/ActiveCallHint.qml:77
273msgid "Tap to return to call..."
265msgid "Tap to return to call..."
274msgstr ""
266msgstr ""
@@ -313,55 +305,55 @@ msgstr ""
313msgid "Roaming"
305msgid "Roaming"
314msgstr ""
306msgstr ""
315
307
316−#: qml/Shell.qml:340
308+#: qml/Shell.qml:346
317msgid "Enter passphrase"
309msgid "Enter passphrase"
318msgstr ""
310msgstr ""
319
311
320−#: qml/Shell.qml:341
312+#: qml/Shell.qml:347
321msgid "Sorry, incorrect passphrase"
313msgid "Sorry, incorrect passphrase"
322msgstr ""
314msgstr ""
323
315
324−#: qml/Shell.qml:342
316+#: qml/Shell.qml:348
325msgid "Please re-enter"
317msgid "Please re-enter"
326msgstr ""
318msgstr ""
327
319
328−#: qml/Shell.qml:344
320+#: qml/Shell.qml:350
329msgid "Enter passcode"
321msgid "Enter passcode"
330msgstr ""
322msgstr ""
331
323
332−#: qml/Shell.qml:345
324+#: qml/Shell.qml:351
333msgid "Sorry, incorrect passcode"
325msgid "Sorry, incorrect passcode"
334msgstr ""
326msgstr ""
335
327
336−#: qml/Shell.qml:348
328+#: qml/Shell.qml:354
337#, qt-format
329#, qt-format
338msgid "Enter %1"
330msgid "Enter %1"
339msgstr ""
331msgstr ""
340
332
341−#: qml/Shell.qml:349
333+#: qml/Shell.qml:355
342#, qt-format
334#, qt-format
343msgid "Sorry, incorrect %1"
335msgid "Sorry, incorrect %1"
344msgstr ""
336msgstr ""
345
337
346−#: qml/Shell.qml:384
338+#: qml/Shell.qml:390
347msgid "Sorry, incorrect passphrase."
339msgid "Sorry, incorrect passphrase."
348msgstr ""
340msgstr ""
349
341
350−#: qml/Shell.qml:385
342+#: qml/Shell.qml:391
351msgid "Sorry, incorrect passcode."
343msgid "Sorry, incorrect passcode."
352msgstr ""
344msgstr ""
353
345
354−#: qml/Shell.qml:386
346+#: qml/Shell.qml:392
355msgid "This will be your last attempt."
347msgid "This will be your last attempt."
356msgstr ""
348msgstr ""
357
349
358−#: qml/Shell.qml:388
350+#: qml/Shell.qml:394
359msgid ""
351msgid ""
360"If passphrase is entered incorrectly, your phone will conduct a factory "
352"If passphrase is entered incorrectly, your phone will conduct a factory "
361"reset and all personal data will be deleted."
353"reset and all personal data will be deleted."
362msgstr ""
354msgstr ""
363
355
364−#: qml/Shell.qml:389
356+#: qml/Shell.qml:395
365msgid ""
357msgid ""
366"If passcode is entered incorrectly, your phone will conduct a factory reset "
358"If passcode is entered incorrectly, your phone will conduct a factory reset "
367"and all personal data will be deleted."
359"and all personal data will be deleted."
qml/Components/Lockscreen.qml+3−1
@@ -78,7 +78,9 @@ Showable {
78 }
78 }
79
79
80 function showInfoPopup(title, text) {
80 function showInfoPopup(title, text) {
81− PopupUtils.open(infoPopupComponent, root, {title: title, text: text})
81+ var popup = PopupUtils.open(infoPopupComponent, root, {title: title, text: text})
82+ // FIXME: SDK will do this internally soonish
83+ popup.z = Number.MAX_VALUE
82 }
84 }
83
85
84 Rectangle {
86 Rectangle {
qml/Notifications/NotificationMenuItemFactory.qml+77−5
@@ -19,6 +19,7 @@
19
19
20import QtQuick 2.0
20import QtQuick 2.0
21import Ubuntu.Components 0.1
21import Ubuntu.Components 0.1
22+import QMenuModel 0.1
22import "../Components"
23import "../Components"
23
24
24Loader {
25Loader {
@@ -26,7 +27,7 @@ Loader {
26
27
27 property QtObject menuModel: null
28 property QtObject menuModel: null
28 property QtObject menuData: null
29 property QtObject menuData: null
29− property int menuIndex
30+ property int menuIndex : -1
30 property int maxHeight
31 property int maxHeight
31 readonly property bool fullscreen: menuData.type === "com.canonical.snapdecision.pinlock"
32 readonly property bool fullscreen: menuData.type === "com.canonical.snapdecision.pinlock"
32
33
@@ -46,6 +47,13 @@ Loader {
46 }
47 }
47 }
48 }
48
49
50+ function getExtendedProperty(object, propertyName, defaultValue) {
51+ if (object && object.hasOwnProperty(propertyName)) {
52+ return object[propertyName];
53+ }
54+ return defaultValue;
55+ }
56+
49 Component {
57 Component {
50 id: textfield
58 id: textfield
51
59
@@ -121,14 +129,14 @@ Loader {
121 right: parent.right
129 right: parent.right
122 }
130 }
123 height: menuFactory.maxHeight
131 height: menuFactory.maxHeight
124− infoText: i18n.tr("Enter SIM PIN")
132+ infoText: notification.summary
125− errorText: i18n.tr("Sorry, incorrect PIN")
133+ errorText: errorAction.valid ? errorAction.state : ""
126− minPinLength: 4
134+ retryText: notification.body
127− maxPinLength: 8
128 background: shell.background
135 background: shell.background
129
136
130 onEntered: {
137 onEntered: {
131 menuModel.changeState(menuIndex, passphrase);
138 menuModel.changeState(menuIndex, passphrase);
139+ clear(false);
132 }
140 }
133
141
134 onCancel: {
142 onCancel: {
@@ -139,6 +147,70 @@ Loader {
139 shell.activateApplication("dialer-app")
147 shell.activateApplication("dialer-app")
140 menuModel.activate(menuIndex, false)
148 menuModel.activate(menuIndex, false)
141 }
149 }
150+
151+ property var extendedData: menuData && menuData.ext || undefined
152+
153+ property var pinMinMaxAction : UnityMenuAction {
154+ model: menuModel
155+ index: menuIndex
156+ name: getExtendedProperty(extendedData, "xCanonicalPinMinMax", "")
157+
158+ onStateChanged: {
159+ var min = pinMinMaxAction.state[0];
160+ var max = pinMinMaxAction.state[1];
161+
162+ if (min === 0) min = -1;
163+ if (max === 0) max = -1;
164+
165+ minPinLength = min
166+ maxPinLength = max
167+ }
168+ }
169+
170+ property var popupAction: UnityMenuAction {
171+ model: menuModel
172+ index: menuIndex
173+ name: getExtendedProperty(extendedData, "xCanonicalPinPopup", "")
174+ onStateChanged: {
175+ if (state !== "")
176+ showInfoPopup("", state);
177+ }
178+ }
179+ onInfoPopupConfirmed: {
180+ popupAction.activate();
181+ }
182+
183+ Timer {
184+ id: errorTimer
185+ interval: 4000;
186+ running: false;
187+ repeat: false
188+ onTriggered: {
189+ errorAction.activate();
190+ }
191+ }
192+ property var errorAction: UnityMenuAction {
193+ model: menuModel
194+ index: menuIndex
195+ name: getExtendedProperty(extendedData, "xCanonicalPinError", "")
196+ onStateChanged: {
197+ errorText = state;
198+ if (state !== "") {
199+ clear(true);
200+ errorTimer.running = true;
201+ }
202+ }
203+ }
204+
205+ function loadAttributes() {
206+ if (!menuModel || menuIndex == -1) return;
207+ menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-pin-min-max': 'string',
208+ 'x-canonical-pin-popup': 'string',
209+ 'x-canonical-pin-error': 'string'});
210+ }
211+ Component.onCompleted: {
212+ loadAttributes();
213+ }
142 }
214 }
143 }
215 }
144}
216}