Merge lp:~tiagosh/dialer-app/sim-presence into lp:dialer-app

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Ɓukasz Zemczak
Approved revision: 231
Merged at revision: 230
Proposed branch: lp:~tiagosh/dialer-app/sim-presence
Merge into: lp:dialer-app
Diff against target: 570 lines (+202/-110)
5 files modified
po/dialer-app.pot (+162/-87)
src/qml/DialerPage/DialerPage.qml (+19/-19)
src/qml/Dialogs/NoDefaultSIMCardDialog.qml (+1/-1)
src/qml/LiveCallPage/LiveCall.qml (+1/-0)
src/qml/dialer-app.qml (+19/-3)
To merge this branch: bzr merge lp:~tiagosh/dialer-app/sim-presence
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+231042@code.launchpad.net

Commit message

- Display operator name in the header when available
- Do not display slots without sim cards.

Description of the change

- Display operator name in the header when available
- Do not display slots without sim cards.

--Checklist--
Are there any related MPs required for this MP to build/function as expected? Please list.
https://code.launchpad.net/~tiagosh/telephony-service/sim-presence/+merge/231045
https://code.launchpad.net/~tiagosh/telepathy-ofono/sim-presence/+merge/231046

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/dialer-app) on device or emulator?
Yes

If you changed the UI, was the change specified/approved by design?
N/A

If you changed UI labels, did you update the pot file?
Yes

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~tiagosh/dialer-app/sim-presence updated
229. By Tiago Salem Herrmann

restore binding when needed

230. By Tiago Salem Herrmann

- improve dual sim support
- show sim label in live call view

231. By Tiago Salem Herrmann

fix dialog creation

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
Yes

Did CI run pass? If not, please explain why.
No, but that's because this branch has a dependency on other changes.

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes

Code looks good and works as expected!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'po/dialer-app.pot'
2--- po/dialer-app.pot 2014-07-17 17:56:04 +0000
3+++ po/dialer-app.pot 2014-08-19 19:47:22 +0000
4@@ -8,7 +8,7 @@
5 msgstr ""
6 "Project-Id-Version: PACKAGE VERSION\n"
7 "Report-Msgid-Bugs-To: \n"
8-"POT-Creation-Date: 2014-06-16 19:26+0200\n"
9+"POT-Creation-Date: 2014-08-15 18:33-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@@ -18,7 +18,7 @@
14 "Content-Transfer-Encoding: 8bit\n"
15 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
16
17-#: src/qml/DialerPage/Keypad.qml:202
18+#: src/qml/DialerPage/Keypad.qml:174
19 msgid "#"
20 msgstr ""
21
22@@ -43,140 +43,152 @@
23 msgstr[0] ""
24 msgstr[1] ""
25
26-#: src/qml/DialerPage/Keypad.qml:179
27+#: src/qml/DialerPage/Keypad.qml:150
28 msgid "*"
29 msgstr ""
30
31-#: src/qml/DialerPage/Keypad.qml:189
32+#: src/qml/DialerPage/Keypad.qml:161 src/qml/DialerPage/DialerPage.qml:326
33 msgid "+"
34 msgstr ""
35
36-#: src/qml/DialerPage/Keypad.qml:188
37+#: src/qml/ContactsPage/ContactsPage.qml:186
38+msgid "+ Create New"
39+msgstr ""
40+
41+#: src/qml/DialerPage/Keypad.qml:160
42 msgid "0"
43 msgstr ""
44
45-#: src/qml/DialerPage/Keypad.qml:86
46+#: src/qml/DialerPage/Keypad.qml:49
47 msgid "1"
48 msgstr ""
49
50-#: src/qml/DialerPage/Keypad.qml:97
51+#: src/qml/DialerPage/Keypad.qml:60
52 msgid "2"
53 msgstr ""
54
55-#: src/qml/DialerPage/Keypad.qml:107
56+#: src/qml/DialerPage/Keypad.qml:71
57 msgid "3"
58 msgstr ""
59
60-#: src/qml/DialerPage/Keypad.qml:117
61+#: src/qml/DialerPage/Keypad.qml:82
62 msgid "4"
63 msgstr ""
64
65-#: src/qml/DialerPage/Keypad.qml:127
66+#: src/qml/DialerPage/Keypad.qml:93
67 msgid "5"
68 msgstr ""
69
70-#: src/qml/DialerPage/Keypad.qml:137
71+#: src/qml/DialerPage/Keypad.qml:104
72 msgid "6"
73 msgstr ""
74
75-#: src/qml/DialerPage/Keypad.qml:147
76+#: src/qml/DialerPage/Keypad.qml:115
77 msgid "7"
78 msgstr ""
79
80-#: src/qml/DialerPage/Keypad.qml:157
81+#: src/qml/DialerPage/Keypad.qml:126
82 msgid "8"
83 msgstr ""
84
85-#: src/qml/DialerPage/Keypad.qml:167
86+#: src/qml/DialerPage/Keypad.qml:137
87 msgid "9"
88 msgstr ""
89
90-#: src/qml/DialerPage/Keypad.qml:98
91+#: src/qml/DialerPage/Keypad.qml:61
92 msgid "ABC"
93 msgstr ""
94
95-#: src/qml/HistoryPage/CallLogContactDelegate.qml:80
96-msgid "Add Contact"
97-msgstr ""
98-
99-#: src/qml/HistoryPage/CallLogContactDelegate.qml:42
100-msgid "Add to existing contact"
101-msgstr ""
102-
103-#: src/qml/dialer-app.qml:244
104+#: src/qml/ContactsPage/ContactsPage.qml:71
105+msgid "All"
106+msgstr ""
107+
108+#: src/qml/dialer-app.qml:376
109 msgid "Call Barring"
110 msgstr ""
111
112-#: src/qml/dialer-app.qml:255
113+#: src/qml/dialer-app.qml:387
114 msgid "Call Forwarding"
115 msgstr ""
116
117-#: src/qml/dialer-app.qml:266
118+#: src/qml/dialer-app.qml:398
119 msgid "Call Waiting"
120 msgstr ""
121
122-#: src/qml/MainPage.qml:56
123-msgid "Call log"
124-msgstr ""
125-
126-#: src/qml/HistoryPage/CallLogContactDelegate.qml:114
127-msgid "Call now"
128-msgstr ""
129-
130-#: src/qml/dialer-app.qml:277
131+#: src/qml/dialer-app.qml:409
132 msgid "Calling Line Presentation"
133 msgstr ""
134
135-#: src/qml/dialer-app.qml:289
136+#: src/qml/dialer-app.qml:421
137 msgid "Calling Line Restriction"
138 msgstr ""
139
140-#: src/qml/HistoryPage/CallLogContactDelegate.qml:60
141+#: src/qml/ContactsPage/ContactsPage.qml:85
142 msgid "Cancel"
143 msgstr ""
144
145+#: src/qml/Dialogs/SetDefaultSIMCardDialog.qml:29
146+msgid "Change all Call associations to "
147+msgstr ""
148+
149+#: src/qml/Dialogs/NoSIMCardSelectedDialog.qml:30 src/qml/dialer-app.qml:270
150+msgid "Close"
151+msgstr ""
152+
153 #: src/qml/LiveCallPage/MultiCallDisplay.qml:114
154-#: src/qml/LiveCallPage/LiveCall.qml:49
155 msgid "Conference"
156 msgstr ""
157
158-#: src/qml/dialer-app.qml:283
159+#: src/qml/dialer-app.qml:415
160 msgid "Connected Line Presentation"
161 msgstr ""
162
163-#: src/qml/dialer-app.qml:295
164+#: src/qml/dialer-app.qml:427
165 msgid "Connected Line Restriction"
166 msgstr ""
167
168-#: src/qml/MainPage.qml:45
169+#: src/qml/ContactsPage/ContactsPage.qml:32
170+#: src/qml/DialerPage/DialerPage.qml:39
171 msgid "Contacts"
172 msgstr ""
173
174-#: src/qml/HistoryPage/CallLogContactDelegate.qml:51
175-msgid "Create new contact"
176-msgstr ""
177-
178-#: src/qml/DialerPage/Keypad.qml:108
179+#: src/qml/DialerPage/Keypad.qml:72
180 msgid "DEF"
181 msgstr ""
182
183-#: src/qml/HistoryPage/HistoryPage.qml:69
184+#: src/qml/HistoryPage/HistoryPage.qml:271
185 msgid "Delete"
186 msgstr ""
187
188-#: src/qml/dialer-app.qml:169 src/qml/dialer-app.qml:183
189+#: src/qml/HistoryPage/HistoryPage.qml:279
190+msgid "Details"
191+msgstr ""
192+
193+#: src/qml/dialer-app.qml:306 src/qml/dialer-app.qml:320
194 msgid "Dismiss"
195 msgstr ""
196
197-#: src/qml/DialerPage/DialerPage.qml:89
198+#: src/qml/Dialogs/SetDefaultSIMCardDialog.qml:66
199+msgid "Don't ask again"
200+msgstr ""
201+
202+#: src/qml/DialerPage/DialerPage.qml:223
203 msgid "Enter a number"
204 msgstr ""
205
206-#: src/qml/dialer-app.qml:166
207+#: src/qml/dialer-app.qml:303
208 msgid "Error"
209 msgstr ""
210
211-#: src/qml/DialerPage/Keypad.qml:118
212+#: src/qml/ContactsPage/ContactsPage.qml:71
213+msgid "Favorites"
214+msgstr ""
215+
216+#: src/qml/DialerPage/DialerPage.qml:51
217+msgid "Flight mode"
218+msgstr ""
219+
220+#: src/qml/DialerPage/Keypad.qml:83
221 msgid "GHI"
222 msgstr ""
223
224@@ -184,23 +196,27 @@
225 msgid "Hangup"
226 msgstr ""
227
228-#: src/qml/HistoryPage/CallLogContactDelegate.qml:39
229-msgid "How do you want to save the contact?"
230+#: src/qml/HistoryPage/HistoryDelegate.qml:60
231+msgid "Incoming"
232 msgstr ""
233
234-#: src/qml/dialer-app.qml:167
235+#: src/qml/dialer-app.qml:304
236 msgid "Invalid USSD code"
237 msgstr ""
238
239-#: src/qml/DialerPage/Keypad.qml:128
240+#: src/qml/DialerPage/Keypad.qml:94
241 msgid "JKL"
242 msgstr ""
243
244-#: src/qml/MainPage.qml:35
245+#: src/qml/DialerPage/DialerPage.qml:57
246 msgid "Keypad"
247 msgstr ""
248
249-#: src/qml/DialerPage/Keypad.qml:138
250+#: src/qml/Dialogs/NoDefaultSIMCardDialog.qml:80
251+msgid "Later"
252+msgstr ""
253+
254+#: src/qml/DialerPage/Keypad.qml:105
255 msgid "MNO"
256 msgstr ""
257
258@@ -208,15 +224,36 @@
259 msgid "Merge calls"
260 msgstr ""
261
262-#: src/qml/LiveCallPage/LiveCall.qml:75
263-msgid "New call"
264-msgstr ""
265-
266-#: src/qml/DialerPage/Keypad.qml:148
267+#: src/qml/HistoryPage/HistoryDelegate.qml:58
268+msgid "Missed"
269+msgstr ""
270+
271+#: src/qml/LiveCallPage/LiveCall.qml:60
272+msgid "New Call"
273+msgstr ""
274+
275+#: src/qml/Dialogs/NoDefaultSIMCardDialog.qml:70
276+#: src/qml/Dialogs/SetDefaultSIMCardDialog.qml:39
277+msgid "No"
278+msgstr ""
279+
280+#: src/qml/Dialogs/NoSIMCardSelectedDialog.qml:26
281+msgid "No SIM card selected"
282+msgstr ""
283+
284+#: src/qml/DialerPage/DialerPage.qml:59 src/qml/dialer-app.qml:265
285+msgid "No network"
286+msgstr ""
287+
288+#: src/qml/HistoryPage/HistoryDelegate.qml:62
289+msgid "Outgoing"
290+msgstr ""
291+
292+#: src/qml/DialerPage/Keypad.qml:116
293 msgid "PQRS"
294 msgstr ""
295
296-#: src/qml/dialer-app.qml:147
297+#: src/qml/dialer-app.qml:284
298 msgid "Please wait"
299 msgstr ""
300
301@@ -224,58 +261,96 @@
302 msgid "Private"
303 msgstr ""
304
305-#: src/qml/HistoryPage/CallLogContactDelegate.qml:38
306-#: src/qml/HistoryPage/CallLogContactDelegate.qml:134
307-msgid "Save contact"
308-msgstr ""
309-
310-#: src/qml/HistoryPage/CallLogContactDelegate.qml:124
311-msgid "Send text message"
312-msgstr ""
313-
314-#: src/qml/DialerPage/Keypad.qml:158
315+#: src/qml/HistoryPage/HistoryDelegate.qml:171
316+msgid "Private number"
317+msgstr ""
318+
319+#: src/qml/DialerPage/DialerPage.qml:83 src/qml/HistoryPage/HistoryPage.qml:43
320+msgid "Recent"
321+msgstr ""
322+
323+#: src/qml/ContactsPage/ContactsPage.qml:60
324+msgid "Search"
325+msgstr ""
326+
327+#: src/qml/ContactsPage/ContactsPage.qml:48
328+msgid "Search..."
329+msgstr ""
330+
331+#: src/qml/HistoryPage/HistoryPage.qml:43
332+msgid "Select"
333+msgstr ""
334+
335+#: src/qml/Dialogs/NoDefaultSIMCardDialog.qml:58
336+msgid ""
337+"Select a default SIM for all outgoing calls. You can always alter your "
338+"choice in <a href=\"system_settings\">System Settings</a>."
339+msgstr ""
340+
341+#: src/qml/HistoryPage/HistoryPage.qml:292
342+msgid "Send message"
343+msgstr ""
344+
345+#: src/qml/DialerPage/DialerPage.qml:44
346+msgid "Settings"
347+msgstr ""
348+
349+#: src/qml/Dialogs/NoDefaultSIMCardDialog.qml:27
350+msgid "Switch to default SIM:"
351+msgstr ""
352+
353+#: src/qml/DialerPage/Keypad.qml:127
354 msgid "TUV"
355 msgstr ""
356
357+#: src/qml/dialer-app.qml:266
358+#, qt-format
359+msgid "There is currently no network on %1"
360+msgstr ""
361+
362+#: src/qml/dialer-app.qml:267
363+msgid "There is currently no network."
364+msgstr ""
365+
366 #: src/qml/HistoryPage/dateUtils.js:41
367 msgid "Today"
368 msgstr ""
369
370-#: src/qml/LiveCallPage/LiveCall.qml:47
371-msgid "Two Calls"
372-msgstr ""
373-
374-#: src/qml/HistoryPage/HistoryDelegate.qml:139
375-msgid "Unknown"
376-msgstr ""
377-
378-#: src/qml/HistoryPage/CallLogContactDelegate.qml:134
379-msgid "View contact"
380+#: src/qml/HistoryPage/HistoryDelegate.qml:173
381+msgid "Unknown number"
382 msgstr ""
383
384 #: src/qml/LiveCallPage/MultiCallDisplay.qml:116
385 msgid "Voicemail"
386 msgstr ""
387
388-#: src/qml/DialerPage/Keypad.qml:168
389+#: src/qml/DialerPage/Keypad.qml:138
390 msgid "WXYZ"
391 msgstr ""
392
393+#: src/qml/Dialogs/SetDefaultSIMCardDialog.qml:49
394+msgid "Yes"
395+msgstr ""
396+
397 #: src/qml/HistoryPage/dateUtils.js:43
398 msgid "Yesterday"
399 msgstr ""
400
401+#: src/qml/Dialogs/NoSIMCardSelectedDialog.qml:27
402+msgid "You need to select a SIM card"
403+msgstr ""
404+
405+#: src/qml/LiveCallPage/ConferenceCallDisplay.qml:128
406 #: src/qml/LiveCallPage/MultiCallDisplay.qml:138
407-#: src/qml/LiveCallPage/ConferenceCallDisplay.qml:128
408 msgid "active"
409 msgstr ""
410
411+#: src/qml/LiveCallPage/LiveCall.qml:237
412 #: src/qml/LiveCallPage/MultiCallDisplay.qml:134
413-#: src/qml/LiveCallPage/LiveCall.qml:409
414 msgid "calling"
415 msgstr ""
416
417+#: src/qml/LiveCallPage/ConferenceCallDisplay.qml:128
418 #: src/qml/LiveCallPage/MultiCallDisplay.qml:136
419-#: src/qml/LiveCallPage/ConferenceCallDisplay.qml:128
420 msgid "on hold"
421 msgstr ""
422
423=== modified file 'src/qml/DialerPage/DialerPage.qml'
424--- src/qml/DialerPage/DialerPage.qml 2014-08-13 22:27:43 +0000
425+++ src/qml/DialerPage/DialerPage.qml 2014-08-19 19:47:22 +0000
426@@ -46,7 +46,18 @@
427 }
428 ]
429
430- title: i18n.tr("Keypad")
431+ title: {
432+ if (telepathyHelper.flightMode) {
433+ return i18n.tr("Flight mode")
434+ } else if (mainView.account && mainView.account.networkName != "") {
435+ return mainView.account.networkName
436+ } else if (multipleAccounts && !mainView.account) {
437+ // TODO: check what should be displayed when there are multiple accounts
438+ // but no default selected
439+ return i18n.tr("Keypad")
440+ }
441+ return i18n.tr("No network")
442+ }
443
444 // -------- Greeter mode ----------
445 states: [
446@@ -120,14 +131,11 @@
447 mainView.switchToKeypadView();
448 }
449 }
450- onAccountChanged: {
451- var newAccountIndex = accountIndex(account);
452- if (newAccountIndex >= 0 && newAccountIndex !== page.head.sections.selectedIndex) {
453- page.head.sections.selectedIndex = newAccountIndex
454- }
455- }
456+ onAccountChanged: head.sections.selectedIndex = accountIndex(mainView.account)
457 }
458
459+ Component.onCompleted: head.sections.selectedIndex = accountIndex(mainView.account)
460+
461 head.sections.model: {
462 // does not show dual sim switch if there is only one sim
463 if (!multipleAccounts) {
464@@ -135,24 +143,16 @@
465 }
466
467 var accountNames = []
468- for(var i=0; i < telepathyHelper.accounts.length; i++) {
469- accountNames.push(telepathyHelper.accounts[i].displayName)
470+ for(var i=0; i < telepathyHelper.activeAccounts.length; i++) {
471+ accountNames.push(telepathyHelper.activeAccounts[i].displayName)
472 }
473 return accountNames
474 }
475
476- // Account switcher
477- head.sections.selectedIndex: {
478- if (!mainView.account) {
479- return -1
480- }
481- return accountIndex(mainView.account)
482- }
483-
484 Connections {
485 target: page.head.sections
486 onSelectedIndexChanged: {
487- mainView.account = telepathyHelper.accounts[page.head.sections.selectedIndex]
488+ mainView.account = telepathyHelper.activeAccounts[page.head.sections.selectedIndex]
489 }
490 }
491
492@@ -341,7 +341,7 @@
493 // check if at least one account is selected
494 if (multipleAccounts && !mainView.account) {
495 Qt.inputMethod.hide()
496- PopupUtils.open(Qt.createObject("../Dialogs/NoSIMCardSelectedDialog.qml").createObject(page))
497+ PopupUtils.open(Qt.createComponent("../Dialogs/NoSIMCardSelectedDialog.qml").createObject(page))
498 return
499 }
500
501
502=== modified file 'src/qml/Dialogs/NoDefaultSIMCardDialog.qml'
503--- src/qml/Dialogs/NoDefaultSIMCardDialog.qml 2014-08-11 21:58:24 +0000
504+++ src/qml/Dialogs/NoDefaultSIMCardDialog.qml 2014-08-19 19:47:22 +0000
505@@ -35,7 +35,7 @@
506 anchors.horizontalCenter: parent.horizontalCenter
507 height: paintedHeight + units.gu(3)
508 Repeater {
509- model: telepathyHelper.accounts
510+ model: telepathyHelper.activeAccounts
511 delegate: Label {
512 text: modelData.displayName
513 color: UbuntuColors.orange
514
515=== modified file 'src/qml/LiveCallPage/LiveCall.qml'
516--- src/qml/LiveCallPage/LiveCall.qml 2014-07-31 08:22:43 +0000
517+++ src/qml/LiveCallPage/LiveCall.qml 2014-08-19 19:47:22 +0000
518@@ -70,6 +70,7 @@
519
520 title: caller
521 head.actions: greeter.greeterActive ? greeterModeActions : regularActions
522+ head.sections.model: multipleAccounts ? [call.account.displayName] : []
523 x: header ? header.height : 0
524
525 // if there are no calls, just reset the view
526
527=== modified file 'src/qml/dialer-app.qml'
528--- src/qml/dialer-app.qml 2014-08-13 22:27:59 +0000
529+++ src/qml/dialer-app.qml 2014-08-19 19:47:22 +0000
530@@ -30,14 +30,16 @@
531 property bool applicationActive: Qt.application.active
532 property string ussdResponseTitle: ""
533 property string ussdResponseText: ""
534- property bool multipleAccounts: telepathyHelper.accounts.length > 1
535- property QtObject account: {
536+ property bool multipleAccounts: telepathyHelper.activeAccounts.length > 1
537+ property QtObject account: defaultAccount()
538+
539+ function defaultAccount() {
540 // we only use the default account property if we have more
541 // than one account, otherwise we use always the first one
542 if (multipleAccounts) {
543 return telepathyHelper.defaultCallAccount
544 } else {
545- return telepathyHelper.accounts[0]
546+ return telepathyHelper.activeAccounts[0]
547 }
548 }
549
550@@ -72,6 +74,20 @@
551 }
552 }
553
554+ Connections {
555+ target: telepathyHelper
556+ onActiveAccountsChanged: {
557+ // check if the selected account is not active anymore
558+ for (var i in telepathyHelper.activeAccounts) {
559+ if (telepathyHelper.activeAccounts[i] == account) {
560+ return;
561+ }
562+ }
563+ account = Qt.binding(defaultAccount)
564+ }
565+ onDefaultCallAccountChanged: account = Qt.binding(defaultAccount)
566+ }
567+
568 Settings {
569 id: settings
570 category: "DualSim"

Subscribers

People subscribed via source and target branches