Merge lp:~unity-api-team/unity8/dual_sim_pin_unlock into lp:unity8

Proposed by Antti Kaijanmäki
Status: Merged
Approved by: Michael Zanetti
Approved revision: 1226
Merged at revision: 1336
Proposed branch: lp:~unity-api-team/unity8/dual_sim_pin_unlock
Merge into: lp:unity8
Diff against target: 269 lines (+99/-33)
3 files modified
po/unity8.pot (+19/-27)
qml/Components/Lockscreen.qml (+3/-1)
qml/Notifications/NotificationMenuItemFactory.qml (+77/-5)
To merge this branch: bzr merge lp:~unity-api-team/unity8/dual_sim_pin_unlock
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+232672@code.launchpad.net

Commit message

Dual SIM pin unlocking. Hook up the UI to the backend.

Description of the change

Dual SIM pin unlocking. Hook up the UI to the backend.

 * Are there any related MPs required for this MP to build/function as expected? Please list.

https://code.launchpad.net/~unity-api-team/indicator-network/dual_sim_pin_unlock/+merge/237386

 * Did you perform an exploratory manual test run of your code change and any related functionality?

Yes.

 * Did you make sure that your branch does not contain spurious tags?

Yes.

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

N/A

 * If you changed the UI, has there been a design review?

This branch does not change the UI, just hooks it up with data.

To post a comment you must log in.
1226. By Antti Kaijanmäki

update .pot

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

Can we split the infoPopup messages into title and text instead of just having text? Sort of like this: http://i.imgur.com/tb7JNLU.png

This way it would look the same as the warning if you enter the phone lock code wrong 9 times in a row.

review: Needs Information
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

> Can we split the infoPopup messages into title and text instead of just having
> text? Sort of like this: http://i.imgur.com/tb7JNLU.png
>
> This way it would look the same as the warning if you enter the phone lock
> code wrong 9 times in a row.

Well, we _could_ but I don't want to delay this landing any further. It would require all sorts of nastiness to happen in both unity8 and i-network side. We can land that in an OTA update or something.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?

yes

 * Did CI run pass? If not, please explain why.

nope... seems it failed to set up the phone

 * Did you make sure that the branch does not contain spurious tags?

yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'po/unity8.pot'
--- po/unity8.pot 2014-10-03 12:13:56 +0000
+++ po/unity8.pot 2014-10-07 08:41:46 +0000
@@ -8,7 +8,7 @@
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 @@
152"phone<br><br>Tap on the screen to start"152"phone<br><br>Tap on the screen to start"
153msgstr ""153msgstr ""
154154
155#: qml/Components/Lockscreen.qml:218155#: qml/Components/Lockscreen.qml:220
156msgid "Emergency Call"156msgid "Emergency Call"
157msgstr ""157msgstr ""
158158
159#: qml/Components/Lockscreen.qml:250159#: qml/Components/Lockscreen.qml:252
160msgid "OK"160msgid "OK"
161msgstr ""161msgstr ""
162162
163#: qml/Dash/GenericScopeView.qml:411 qml/Dash/GenericScopeView.qml:568163#: qml/Dash/GenericScopeView.qml:434 qml/Dash/GenericScopeView.qml:591
164msgid "See less"164msgid "See less"
165msgstr ""165msgstr ""
166166
167#: qml/Dash/GenericScopeView.qml:411167#: qml/Dash/GenericScopeView.qml:434
168msgid "See all"168msgid "See all"
169msgstr ""169msgstr ""
170170
171#: qml/Dash/GenericScopeView.qml:473 qml/Dash/PageHeader.qml:258171#: qml/Dash/GenericScopeView.qml:496 qml/Dash/PageHeader.qml:258
172#: qml/Panel/SearchIndicator.qml:27172#: qml/Panel/SearchIndicator.qml:27
173msgid "Search"173msgid "Search"
174msgstr ""174msgstr ""
@@ -257,18 +257,10 @@
257msgid "Speaking..."257msgid "Speaking..."
258msgstr ""258msgstr ""
259259
260#: qml/Notifications/NotificationMenuItemFactory.qml:108260#: qml/Notifications/NotificationMenuItemFactory.qml:116
261msgid "Show password"261msgid "Show password"
262msgstr ""262msgstr ""
263263
264#: qml/Notifications/NotificationMenuItemFactory.qml:124
265msgid "Enter SIM PIN"
266msgstr ""
267
268#: qml/Notifications/NotificationMenuItemFactory.qml:125
269msgid "Sorry, incorrect PIN"
270msgstr ""
271
272#: qml/Panel/ActiveCallHint.qml:77264#: qml/Panel/ActiveCallHint.qml:77
273msgid "Tap to return to call..."265msgid "Tap to return to call..."
274msgstr ""266msgstr ""
@@ -313,55 +305,55 @@
313msgid "Roaming"305msgid "Roaming"
314msgstr ""306msgstr ""
315307
316#: qml/Shell.qml:340308#: qml/Shell.qml:346
317msgid "Enter passphrase"309msgid "Enter passphrase"
318msgstr ""310msgstr ""
319311
320#: qml/Shell.qml:341312#: qml/Shell.qml:347
321msgid "Sorry, incorrect passphrase"313msgid "Sorry, incorrect passphrase"
322msgstr ""314msgstr ""
323315
324#: qml/Shell.qml:342316#: qml/Shell.qml:348
325msgid "Please re-enter"317msgid "Please re-enter"
326msgstr ""318msgstr ""
327319
328#: qml/Shell.qml:344320#: qml/Shell.qml:350
329msgid "Enter passcode"321msgid "Enter passcode"
330msgstr ""322msgstr ""
331323
332#: qml/Shell.qml:345324#: qml/Shell.qml:351
333msgid "Sorry, incorrect passcode"325msgid "Sorry, incorrect passcode"
334msgstr ""326msgstr ""
335327
336#: qml/Shell.qml:348328#: qml/Shell.qml:354
337#, qt-format329#, qt-format
338msgid "Enter %1"330msgid "Enter %1"
339msgstr ""331msgstr ""
340332
341#: qml/Shell.qml:349333#: qml/Shell.qml:355
342#, qt-format334#, qt-format
343msgid "Sorry, incorrect %1"335msgid "Sorry, incorrect %1"
344msgstr ""336msgstr ""
345337
346#: qml/Shell.qml:384338#: qml/Shell.qml:390
347msgid "Sorry, incorrect passphrase."339msgid "Sorry, incorrect passphrase."
348msgstr ""340msgstr ""
349341
350#: qml/Shell.qml:385342#: qml/Shell.qml:391
351msgid "Sorry, incorrect passcode."343msgid "Sorry, incorrect passcode."
352msgstr ""344msgstr ""
353345
354#: qml/Shell.qml:386346#: qml/Shell.qml:392
355msgid "This will be your last attempt."347msgid "This will be your last attempt."
356msgstr ""348msgstr ""
357349
358#: qml/Shell.qml:388350#: 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 ""
363355
364#: qml/Shell.qml:389356#: 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."
368360
=== modified file 'qml/Components/Lockscreen.qml'
--- qml/Components/Lockscreen.qml 2014-09-24 19:31:32 +0000
+++ qml/Components/Lockscreen.qml 2014-10-07 08:41:46 +0000
@@ -78,7 +78,9 @@
78 }78 }
7979
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 }
8385
84 Rectangle {86 Rectangle {
8587
=== modified file 'qml/Notifications/NotificationMenuItemFactory.qml'
--- qml/Notifications/NotificationMenuItemFactory.qml 2014-08-29 14:54:19 +0000
+++ qml/Notifications/NotificationMenuItemFactory.qml 2014-10-07 08:41:46 +0000
@@ -19,6 +19,7 @@
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 0.1
22import QMenuModel 0.1
22import "../Components"23import "../Components"
2324
24Loader {25Loader {
@@ -26,7 +27,7 @@
2627
27 property QtObject menuModel: null28 property QtObject menuModel: null
28 property QtObject menuData: null29 property QtObject menuData: null
29 property int menuIndex30 property int menuIndex : -1
30 property int maxHeight31 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"
3233
@@ -46,6 +47,13 @@
46 }47 }
47 }48 }
4849
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: textfield58 id: textfield
5159
@@ -121,14 +129,14 @@
121 right: parent.right129 right: parent.right
122 }130 }
123 height: menuFactory.maxHeight131 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: 4134 retryText: notification.body
127 maxPinLength: 8
128 background: shell.background135 background: shell.background
129136
130 onEntered: {137 onEntered: {
131 menuModel.changeState(menuIndex, passphrase);138 menuModel.changeState(menuIndex, passphrase);
139 clear(false);
132 }140 }
133141
134 onCancel: {142 onCancel: {
@@ -139,6 +147,70 @@
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}

Subscribers

People subscribed via source and target branches