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
1=== modified file 'po/unity8.pot'
2--- po/unity8.pot 2014-10-03 12:13:56 +0000
3+++ po/unity8.pot 2014-10-07 08:41:46 +0000
4@@ -8,7 +8,7 @@
5 msgstr ""
6 "Project-Id-Version: unity8\n"
7 "Report-Msgid-Bugs-To: \n"
8-"POT-Creation-Date: 2014-10-03 08:13-0400\n"
9+"POT-Creation-Date: 2014-10-07 11:37+0300\n"
10 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13@@ -152,23 +152,23 @@
14 "phone<br><br>Tap on the screen to start"
15 msgstr ""
16
17-#: qml/Components/Lockscreen.qml:218
18+#: qml/Components/Lockscreen.qml:220
19 msgid "Emergency Call"
20 msgstr ""
21
22-#: qml/Components/Lockscreen.qml:250
23+#: qml/Components/Lockscreen.qml:252
24 msgid "OK"
25 msgstr ""
26
27-#: qml/Dash/GenericScopeView.qml:411 qml/Dash/GenericScopeView.qml:568
28+#: qml/Dash/GenericScopeView.qml:434 qml/Dash/GenericScopeView.qml:591
29 msgid "See less"
30 msgstr ""
31
32-#: qml/Dash/GenericScopeView.qml:411
33+#: qml/Dash/GenericScopeView.qml:434
34 msgid "See all"
35 msgstr ""
36
37-#: qml/Dash/GenericScopeView.qml:473 qml/Dash/PageHeader.qml:258
38+#: qml/Dash/GenericScopeView.qml:496 qml/Dash/PageHeader.qml:258
39 #: qml/Panel/SearchIndicator.qml:27
40 msgid "Search"
41 msgstr ""
42@@ -257,18 +257,10 @@
43 msgid "Speaking..."
44 msgstr ""
45
46-#: qml/Notifications/NotificationMenuItemFactory.qml:108
47+#: qml/Notifications/NotificationMenuItemFactory.qml:116
48 msgid "Show password"
49 msgstr ""
50
51-#: qml/Notifications/NotificationMenuItemFactory.qml:124
52-msgid "Enter SIM PIN"
53-msgstr ""
54-
55-#: qml/Notifications/NotificationMenuItemFactory.qml:125
56-msgid "Sorry, incorrect PIN"
57-msgstr ""
58-
59 #: qml/Panel/ActiveCallHint.qml:77
60 msgid "Tap to return to call..."
61 msgstr ""
62@@ -313,55 +305,55 @@
63 msgid "Roaming"
64 msgstr ""
65
66-#: qml/Shell.qml:340
67+#: qml/Shell.qml:346
68 msgid "Enter passphrase"
69 msgstr ""
70
71-#: qml/Shell.qml:341
72+#: qml/Shell.qml:347
73 msgid "Sorry, incorrect passphrase"
74 msgstr ""
75
76-#: qml/Shell.qml:342
77+#: qml/Shell.qml:348
78 msgid "Please re-enter"
79 msgstr ""
80
81-#: qml/Shell.qml:344
82+#: qml/Shell.qml:350
83 msgid "Enter passcode"
84 msgstr ""
85
86-#: qml/Shell.qml:345
87+#: qml/Shell.qml:351
88 msgid "Sorry, incorrect passcode"
89 msgstr ""
90
91-#: qml/Shell.qml:348
92+#: qml/Shell.qml:354
93 #, qt-format
94 msgid "Enter %1"
95 msgstr ""
96
97-#: qml/Shell.qml:349
98+#: qml/Shell.qml:355
99 #, qt-format
100 msgid "Sorry, incorrect %1"
101 msgstr ""
102
103-#: qml/Shell.qml:384
104+#: qml/Shell.qml:390
105 msgid "Sorry, incorrect passphrase."
106 msgstr ""
107
108-#: qml/Shell.qml:385
109+#: qml/Shell.qml:391
110 msgid "Sorry, incorrect passcode."
111 msgstr ""
112
113-#: qml/Shell.qml:386
114+#: qml/Shell.qml:392
115 msgid "This will be your last attempt."
116 msgstr ""
117
118-#: qml/Shell.qml:388
119+#: qml/Shell.qml:394
120 msgid ""
121 "If passphrase is entered incorrectly, your phone will conduct a factory "
122 "reset and all personal data will be deleted."
123 msgstr ""
124
125-#: qml/Shell.qml:389
126+#: qml/Shell.qml:395
127 msgid ""
128 "If passcode is entered incorrectly, your phone will conduct a factory reset "
129 "and all personal data will be deleted."
130
131=== modified file 'qml/Components/Lockscreen.qml'
132--- qml/Components/Lockscreen.qml 2014-09-24 19:31:32 +0000
133+++ qml/Components/Lockscreen.qml 2014-10-07 08:41:46 +0000
134@@ -78,7 +78,9 @@
135 }
136
137 function showInfoPopup(title, text) {
138- PopupUtils.open(infoPopupComponent, root, {title: title, text: text})
139+ var popup = PopupUtils.open(infoPopupComponent, root, {title: title, text: text})
140+ // FIXME: SDK will do this internally soonish
141+ popup.z = Number.MAX_VALUE
142 }
143
144 Rectangle {
145
146=== modified file 'qml/Notifications/NotificationMenuItemFactory.qml'
147--- qml/Notifications/NotificationMenuItemFactory.qml 2014-08-29 14:54:19 +0000
148+++ qml/Notifications/NotificationMenuItemFactory.qml 2014-10-07 08:41:46 +0000
149@@ -19,6 +19,7 @@
150
151 import QtQuick 2.0
152 import Ubuntu.Components 0.1
153+import QMenuModel 0.1
154 import "../Components"
155
156 Loader {
157@@ -26,7 +27,7 @@
158
159 property QtObject menuModel: null
160 property QtObject menuData: null
161- property int menuIndex
162+ property int menuIndex : -1
163 property int maxHeight
164 readonly property bool fullscreen: menuData.type === "com.canonical.snapdecision.pinlock"
165
166@@ -46,6 +47,13 @@
167 }
168 }
169
170+ function getExtendedProperty(object, propertyName, defaultValue) {
171+ if (object && object.hasOwnProperty(propertyName)) {
172+ return object[propertyName];
173+ }
174+ return defaultValue;
175+ }
176+
177 Component {
178 id: textfield
179
180@@ -121,14 +129,14 @@
181 right: parent.right
182 }
183 height: menuFactory.maxHeight
184- infoText: i18n.tr("Enter SIM PIN")
185- errorText: i18n.tr("Sorry, incorrect PIN")
186- minPinLength: 4
187- maxPinLength: 8
188+ infoText: notification.summary
189+ errorText: errorAction.valid ? errorAction.state : ""
190+ retryText: notification.body
191 background: shell.background
192
193 onEntered: {
194 menuModel.changeState(menuIndex, passphrase);
195+ clear(false);
196 }
197
198 onCancel: {
199@@ -139,6 +147,70 @@
200 shell.activateApplication("dialer-app")
201 menuModel.activate(menuIndex, false)
202 }
203+
204+ property var extendedData: menuData && menuData.ext || undefined
205+
206+ property var pinMinMaxAction : UnityMenuAction {
207+ model: menuModel
208+ index: menuIndex
209+ name: getExtendedProperty(extendedData, "xCanonicalPinMinMax", "")
210+
211+ onStateChanged: {
212+ var min = pinMinMaxAction.state[0];
213+ var max = pinMinMaxAction.state[1];
214+
215+ if (min === 0) min = -1;
216+ if (max === 0) max = -1;
217+
218+ minPinLength = min
219+ maxPinLength = max
220+ }
221+ }
222+
223+ property var popupAction: UnityMenuAction {
224+ model: menuModel
225+ index: menuIndex
226+ name: getExtendedProperty(extendedData, "xCanonicalPinPopup", "")
227+ onStateChanged: {
228+ if (state !== "")
229+ showInfoPopup("", state);
230+ }
231+ }
232+ onInfoPopupConfirmed: {
233+ popupAction.activate();
234+ }
235+
236+ Timer {
237+ id: errorTimer
238+ interval: 4000;
239+ running: false;
240+ repeat: false
241+ onTriggered: {
242+ errorAction.activate();
243+ }
244+ }
245+ property var errorAction: UnityMenuAction {
246+ model: menuModel
247+ index: menuIndex
248+ name: getExtendedProperty(extendedData, "xCanonicalPinError", "")
249+ onStateChanged: {
250+ errorText = state;
251+ if (state !== "") {
252+ clear(true);
253+ errorTimer.running = true;
254+ }
255+ }
256+ }
257+
258+ function loadAttributes() {
259+ if (!menuModel || menuIndex == -1) return;
260+ menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-pin-min-max': 'string',
261+ 'x-canonical-pin-popup': 'string',
262+ 'x-canonical-pin-error': 'string'});
263+ }
264+ Component.onCompleted: {
265+ loadAttributes();
266+ }
267 }
268 }
269 }

Subscribers

People subscribed via source and target branches