Merge lp:~bfiller/dialer-app/rtm-14.09-sim-presence into lp:dialer-app/rtm-14.09
- rtm-14.09-sim-presence
- Merge into rtm-14.09
Proposed by
Bill Filler
Status: | Merged |
---|---|
Approved by: | Bill Filler |
Approved revision: | 230 |
Merged at revision: | 230 |
Proposed branch: | lp:~bfiller/dialer-app/rtm-14.09-sim-presence |
Merge into: | lp:dialer-app/rtm-14.09 |
Diff against target: |
1369 lines (+700/-224) 11 files modified
po/dialer-app.pot (+162/-87) src/qml/DialerPage/DialerPage.qml (+47/-40) src/qml/Dialogs/NoDefaultSIMCardDialog.qml (+1/-1) src/qml/HistoryPage/HistoryDelegate.qml (+40/-9) src/qml/HistoryPage/HistoryDetailsPage.qml (+325/-0) src/qml/HistoryPage/HistoryPage.qml (+49/-13) src/qml/HistoryPage/Timeline.qml (+0/-65) src/qml/HistoryPage/dateUtils.js (+53/-4) src/qml/LiveCallPage/LiveCall.qml (+1/-0) src/qml/dialer-app.qml (+20/-3) tests/autopilot/dialer_app/tests/test_logs.py (+2/-2) |
To merge this branch: | bzr merge lp:~bfiller/dialer-app/rtm-14.09-sim-presence |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phablet Team | Pending | ||
Review via email: mp+231912@code.launchpad.net |
Commit message
sim presence and call grouping merge from trunk
Description of the change
sim presence and call grouping merge from trunk
To post a comment you must log in.
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-22 15:27:37 +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-22 15:27:37 +0000 |
426 | @@ -31,9 +31,8 @@ |
427 | |
428 | property alias dialNumber: keypadEntry.value |
429 | property alias input: keypadEntry.input |
430 | - objectName: "dialerPage" |
431 | - |
432 | - head.actions: [ |
433 | + property list<Action> actionsGreeter |
434 | + property list<Action> actionsNormal: [ |
435 | Action { |
436 | iconName: "contact" |
437 | text: i18n.tr("Contacts") |
438 | @@ -45,23 +44,48 @@ |
439 | onTriggered: Qt.openUrlExternally("settings:///system/phone") |
440 | } |
441 | ] |
442 | - |
443 | - title: i18n.tr("Keypad") |
444 | - |
445 | + head.actions: greeter.greeterActive ? actionsGreeter : actionsNormal |
446 | + |
447 | + objectName: "dialerPage" |
448 | + |
449 | + title: { |
450 | + if (telepathyHelper.flightMode) { |
451 | + return i18n.tr("Flight mode") |
452 | + } else if (mainView.account && mainView.account.networkName != "") { |
453 | + return mainView.account.networkName |
454 | + } else if (multipleAccounts && !mainView.account) { |
455 | + // TODO: check what should be displayed when there are multiple accounts |
456 | + // but no default selected |
457 | + return i18n.tr("Keypad") |
458 | + } |
459 | + return i18n.tr("No network") |
460 | + } |
461 | + |
462 | + state: greeter.greeterActive ? "greeterMode" : "normalMode" |
463 | // -------- Greeter mode ---------- |
464 | states: [ |
465 | State { |
466 | name: "greeterMode" |
467 | - when: greeter.greeterActive |
468 | - |
469 | - PropertyChanges { |
470 | - target: page.head |
471 | - actions: [] |
472 | - } |
473 | - PropertyChanges { |
474 | - target: contactLabel |
475 | - visible: false |
476 | - } |
477 | + PropertyChanges { |
478 | + target: contactLabel |
479 | + visible: false |
480 | + } |
481 | + PropertyChanges { |
482 | + target: addContact |
483 | + visible: false |
484 | + } |
485 | + }, |
486 | + State { |
487 | + name: "normalMode" |
488 | + PropertyChanges { |
489 | + target: contactLabel |
490 | + visible: true |
491 | + } |
492 | + PropertyChanges { |
493 | + target: addContact |
494 | + visible: true |
495 | + } |
496 | + |
497 | } |
498 | ] |
499 | |
500 | @@ -95,12 +119,6 @@ |
501 | } |
502 | } |
503 | |
504 | - onIsReadyChanged: { |
505 | - if (bottomEdgePage) { |
506 | - bottomEdgePage.fullView = isReady |
507 | - } |
508 | - } |
509 | - |
510 | function accountIndex(account) { |
511 | var index = -1; |
512 | for (var i in telepathyHelper.accounts) { |
513 | @@ -120,14 +138,11 @@ |
514 | mainView.switchToKeypadView(); |
515 | } |
516 | } |
517 | - onAccountChanged: { |
518 | - var newAccountIndex = accountIndex(account); |
519 | - if (newAccountIndex >= 0 && newAccountIndex !== page.head.sections.selectedIndex) { |
520 | - page.head.sections.selectedIndex = newAccountIndex |
521 | - } |
522 | - } |
523 | + onAccountChanged: head.sections.selectedIndex = accountIndex(mainView.account) |
524 | } |
525 | |
526 | + Component.onCompleted: head.sections.selectedIndex = accountIndex(mainView.account) |
527 | + |
528 | head.sections.model: { |
529 | // does not show dual sim switch if there is only one sim |
530 | if (!multipleAccounts) { |
531 | @@ -135,24 +150,16 @@ |
532 | } |
533 | |
534 | var accountNames = [] |
535 | - for(var i=0; i < telepathyHelper.accounts.length; i++) { |
536 | - accountNames.push(telepathyHelper.accounts[i].displayName) |
537 | + for(var i=0; i < telepathyHelper.activeAccounts.length; i++) { |
538 | + accountNames.push(telepathyHelper.activeAccounts[i].displayName) |
539 | } |
540 | return accountNames |
541 | } |
542 | |
543 | - // Account switcher |
544 | - head.sections.selectedIndex: { |
545 | - if (!mainView.account) { |
546 | - return -1 |
547 | - } |
548 | - return accountIndex(mainView.account) |
549 | - } |
550 | - |
551 | Connections { |
552 | target: page.head.sections |
553 | onSelectedIndexChanged: { |
554 | - mainView.account = telepathyHelper.accounts[page.head.sections.selectedIndex] |
555 | + mainView.account = telepathyHelper.activeAccounts[page.head.sections.selectedIndex] |
556 | } |
557 | } |
558 | |
559 | @@ -341,7 +348,7 @@ |
560 | // check if at least one account is selected |
561 | if (multipleAccounts && !mainView.account) { |
562 | Qt.inputMethod.hide() |
563 | - PopupUtils.open(Qt.createObject("../Dialogs/NoSIMCardSelectedDialog.qml").createObject(page)) |
564 | + PopupUtils.open(Qt.createComponent("../Dialogs/NoSIMCardSelectedDialog.qml").createObject(page)) |
565 | return |
566 | } |
567 | |
568 | |
569 | === modified file 'src/qml/Dialogs/NoDefaultSIMCardDialog.qml' |
570 | --- src/qml/Dialogs/NoDefaultSIMCardDialog.qml 2014-08-11 21:58:24 +0000 |
571 | +++ src/qml/Dialogs/NoDefaultSIMCardDialog.qml 2014-08-22 15:27:37 +0000 |
572 | @@ -35,7 +35,7 @@ |
573 | anchors.horizontalCenter: parent.horizontalCenter |
574 | height: paintedHeight + units.gu(3) |
575 | Repeater { |
576 | - model: telepathyHelper.accounts |
577 | + model: telepathyHelper.activeAccounts |
578 | delegate: Label { |
579 | text: modelData.displayName |
580 | color: UbuntuColors.orange |
581 | |
582 | === modified file 'src/qml/HistoryPage/HistoryDelegate.qml' |
583 | --- src/qml/HistoryPage/HistoryDelegate.qml 2014-08-11 19:27:34 +0000 |
584 | +++ src/qml/HistoryPage/HistoryDelegate.qml 2014-08-22 15:27:37 +0000 |
585 | @@ -95,7 +95,7 @@ |
586 | |
587 | function updateSubTypeLabel() { |
588 | var subLabel = contactWatcher.isUnknown |
589 | - if (model.participants[0]) { |
590 | + if (model.participants && model.participants[0]) { |
591 | var typeInfo = phoneTypeModel.get(phoneTypeModel.getTypeIndex(phoneDetail)) |
592 | if (typeInfo) { |
593 | subLabel = typeInfo.label |
594 | @@ -159,12 +159,14 @@ |
595 | id: titleLabel |
596 | anchors { |
597 | top: parent.top |
598 | + topMargin: units.gu(0.5) |
599 | left: avatar.right |
600 | leftMargin: units.gu(2) |
601 | right: time.left |
602 | + rightMargin: units.gu(1) + (countLabel.visible ? countLabel.width : 0) |
603 | } |
604 | height: units.gu(2) |
605 | - verticalAlignment: Text.AlignVCenter |
606 | + verticalAlignment: Text.AlignTop |
607 | fontSize: "medium" |
608 | text: { |
609 | if (contactWatcher.phoneNumber == "x-ofono-private") { |
610 | @@ -180,15 +182,41 @@ |
611 | color: UbuntuColors.lightAubergine |
612 | } |
613 | |
614 | + // this item has the width of the text above. It is used to be able to align |
615 | + Item { |
616 | + id: titleLabelArea |
617 | + anchors { |
618 | + top: titleLabel.top |
619 | + left: titleLabel.left |
620 | + bottom: titleLabel.bottom |
621 | + } |
622 | + width: titleLabel.paintedWidth |
623 | + } |
624 | + |
625 | + Label { |
626 | + id: countLabel |
627 | + anchors { |
628 | + left: titleLabelArea.right |
629 | + leftMargin: units.gu(0.5) |
630 | + top: titleLabel.top |
631 | + } |
632 | + height: units.gu(2) |
633 | + fontSize: "medium" |
634 | + visible: model.eventCount > 1 |
635 | + // TRANSLATORS: this is the count of events grouped into this single item |
636 | + text: i18n.tr("(%1)").arg(model.eventCount) |
637 | + } |
638 | + |
639 | Label { |
640 | id: phoneLabel |
641 | anchors { |
642 | - bottom: parent.bottom |
643 | + top: titleLabel.bottom |
644 | + topMargin: units.gu(1) |
645 | left: avatar.right |
646 | leftMargin: units.gu(2) |
647 | } |
648 | height: units.gu(2) |
649 | - verticalAlignment: Text.AlignVCenter |
650 | + verticalAlignment: Text.AlignTop |
651 | fontSize: "small" |
652 | // FIXME: handle conference call |
653 | text: phoneNumberSubTypeLabel |
654 | @@ -200,22 +228,25 @@ |
655 | id: time |
656 | anchors { |
657 | right: parent.right |
658 | - verticalCenter: titleLabel.verticalCenter |
659 | + bottom: titleLabel.bottom |
660 | } |
661 | height: units.gu(2) |
662 | - verticalAlignment: Text.AlignVCenter |
663 | + verticalAlignment: Text.AlignBottom |
664 | fontSize: "small" |
665 | - text: Qt.formatTime(model.timestamp, "hh:mm") |
666 | + // TRANSLATORS: this string is the time a call has happenend. It represents the format to be used, according to: |
667 | + // http://qt-project.org/doc/qt-5/qml-qtqml-qt.html#formatDate-method |
668 | + // please change according to your language |
669 | + text: Qt.formatTime(model.timestamp, i18n.tr("hh:mm ap")) |
670 | } |
671 | |
672 | Label { |
673 | id: callType |
674 | anchors { |
675 | right: parent.right |
676 | - verticalCenter: phoneLabel.verticalCenter |
677 | + bottom: phoneLabel.bottom |
678 | } |
679 | height: units.gu(2) |
680 | - verticalAlignment: Text.AlignVCenter |
681 | + verticalAlignment: Text.AlignBottom |
682 | fontSize: "small" |
683 | text: selectCallType() |
684 | } |
685 | |
686 | === added file 'src/qml/HistoryPage/HistoryDetailsPage.qml' |
687 | --- src/qml/HistoryPage/HistoryDetailsPage.qml 1970-01-01 00:00:00 +0000 |
688 | +++ src/qml/HistoryPage/HistoryDetailsPage.qml 2014-08-22 15:27:37 +0000 |
689 | @@ -0,0 +1,325 @@ |
690 | +/* |
691 | + * Copyright 2014 Canonical Ltd. |
692 | + * |
693 | + * This file is part of dialer-app. |
694 | + * |
695 | + * dialer-app is free software; you can redistribute it and/or modify |
696 | + * it under the terms of the GNU General Public License as published by |
697 | + * the Free Software Foundation; version 3. |
698 | + * |
699 | + * dialer-app is distributed in the hope that it will be useful, |
700 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
701 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
702 | + * GNU General Public License for more details. |
703 | + * |
704 | + * You should have received a copy of the GNU General Public License |
705 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
706 | + */ |
707 | + |
708 | +import QtQuick 2.0 |
709 | +import Ubuntu.Components 1.1 |
710 | +import Ubuntu.Components.ListItems 0.1 as ListItem |
711 | +import Ubuntu.Telephony 0.1 |
712 | +import Ubuntu.Telephony.PhoneNumber 0.1 as PhoneUtils |
713 | +import Ubuntu.Contacts 0.1 |
714 | +import QtContacts 5.0 |
715 | +import "dateUtils.js" as DateUtils |
716 | + |
717 | +Page { |
718 | + id: historyDetailsPage |
719 | + |
720 | + property alias phoneNumber: contactWatcher.phoneNumber |
721 | + property string phoneNumberSubTypeLabel |
722 | + property variant events: null |
723 | + property QtObject eventModel: null |
724 | + readonly property bool unknownContact: contactWatcher.contactId === "" |
725 | + property bool knownNumber: phoneNumber != "x-ofono-private" && phoneNumber != "x-ofono-unknown" |
726 | + |
727 | + objectName: "historyDetailsPage" |
728 | + anchors.fill: parent |
729 | + title: { |
730 | + if (contactWatcher.phoneNumber == "x-ofono-private") { |
731 | + return i18n.tr("Private number") |
732 | + } else if (contactWatcher.phoneNumber == "x-ofono-unknown") { |
733 | + return i18n.tr("Unknown number") |
734 | + } else if (contactWatcher.alias != "") { |
735 | + return contactWatcher.alias |
736 | + } |
737 | + return PhoneUtils.PhoneUtils.format(contactWatcher.phoneNumber) |
738 | + } |
739 | + |
740 | + head.actions: [ |
741 | + Action { |
742 | + iconName: unknownContact ? "contact-new" : "stock_contact" |
743 | + text: i18n.tr("Contact Details") |
744 | + visible: knownNumber |
745 | + onTriggered: { |
746 | + if (unknownContact) { |
747 | + mainView.addNewPhone(phoneNumber) |
748 | + } else { |
749 | + mainView.viewContact(contactWatcher.contactId) |
750 | + } |
751 | + } |
752 | + }, |
753 | + Action { |
754 | + iconName: "share" |
755 | + text: i18n.tr("Share") |
756 | + onTriggered: { |
757 | + // FIXME: implement |
758 | + } |
759 | + visible: false |
760 | + }, |
761 | + Action { |
762 | + iconName: "delete" |
763 | + text: i18n.tr("Delete") |
764 | + onTriggered: { |
765 | + for (var i in events) { |
766 | + eventModel.removeEvent(events[i].accountId, events[i].threadId, events[i].eventId, events[i].type); |
767 | + } |
768 | + pageStack.pop(); |
769 | + } |
770 | + } |
771 | + |
772 | + ] |
773 | + |
774 | + Item { |
775 | + id: helper |
776 | + |
777 | + function updateSubTypeLabel() { |
778 | + var subLabel = contactWatcher.isUnknown |
779 | + if (phoneNumber) { |
780 | + var typeInfo = phoneTypeModel.get(phoneTypeModel.getTypeIndex(phoneDetail)) |
781 | + if (typeInfo) { |
782 | + subLabel = typeInfo.label |
783 | + } |
784 | + } |
785 | + phoneNumberSubTypeLabel = subLabel |
786 | + } |
787 | + |
788 | + Component.onCompleted: updateSubTypeLabel() |
789 | + |
790 | + ContactWatcher { |
791 | + id: contactWatcher |
792 | + // FIXME: handle conf calls |
793 | + onPhoneNumberContextsChanged: helper.updateSubTypeLabel() |
794 | + onPhoneNumberSubTypesChanged: helper.updateSubTypeLabel() |
795 | + onIsUnknownChanged: helper.updateSubTypeLabel() |
796 | + } |
797 | + |
798 | + PhoneNumber { |
799 | + id: phoneDetail |
800 | + contexts: contactWatcher.phoneNumberContexts |
801 | + subTypes: contactWatcher.phoneNumberSubTypes |
802 | + } |
803 | + |
804 | + ContactDetailPhoneNumberTypeModel { |
805 | + id: phoneTypeModel |
806 | + Component.onCompleted: helper.updateSubTypeLabel() |
807 | + } |
808 | + } |
809 | + |
810 | + Rectangle { |
811 | + anchors.fill: parent |
812 | + color: Theme.palette.normal.background |
813 | + } |
814 | + |
815 | + ListView { |
816 | + id: eventsView |
817 | + anchors.fill: parent |
818 | + model: events |
819 | + header: Item { |
820 | + anchors { |
821 | + left: parent.left |
822 | + right: parent.right |
823 | + } |
824 | + height: units.gu(12) |
825 | + |
826 | + Label { |
827 | + id: phoneLabel |
828 | + anchors { |
829 | + top: parent.top |
830 | + topMargin: units.gu(2) |
831 | + left: parent.left |
832 | + leftMargin: units.gu(2) |
833 | + } |
834 | + verticalAlignment: Text.AlignTop |
835 | + fontSize: "medium" |
836 | + text: PhoneUtils.PhoneUtils.format(contactWatcher.phoneNumber) |
837 | + elide: Text.ElideRight |
838 | + color: UbuntuColors.lightAubergine |
839 | + height: units.gu(2) |
840 | + } |
841 | + |
842 | + Label { |
843 | + id: phoneTypeLabel |
844 | + anchors { |
845 | + top: phoneLabel.bottom |
846 | + left: phoneLabel.left |
847 | + } |
848 | + text: historyDetailsPage.phoneNumberSubTypeLabel |
849 | + height: units.gu(2) |
850 | + verticalAlignment: Text.AlignVCenter |
851 | + fontSize: "small" |
852 | + visible: contactWatcher.interactive && !contactWatcher.isUnknown // non-interactive entries are calls from unknown or private numbers |
853 | + } |
854 | + |
855 | + Label { |
856 | + id: dateLabel |
857 | + anchors { |
858 | + left: phoneLabel.left |
859 | + top: phoneTypeLabel.bottom |
860 | + topMargin: units.gu(2) |
861 | + } |
862 | + text: DateUtils.friendlyDay(historyDetailsPage.events[0].date) |
863 | + height: units.gu(3) |
864 | + fontSize: "medium" |
865 | + font.weight: Font.DemiBold |
866 | + verticalAlignment: Text.AlignVCenter |
867 | + } |
868 | + |
869 | + ListItem.ThinDivider { |
870 | + id: divider |
871 | + anchors { |
872 | + top: dateLabel.bottom |
873 | + left: parent.left |
874 | + leftMargin: units.gu(2) |
875 | + right: parent.right |
876 | + rightMargin: units.gu(2) |
877 | + } |
878 | + } |
879 | + |
880 | + AbstractButton { |
881 | + id: messageButton |
882 | + anchors { |
883 | + top: parent.top |
884 | + topMargin: units.gu(1) |
885 | + right: parent.right |
886 | + } |
887 | + width: units.gu(4) |
888 | + height: units.gu(4) |
889 | + visible: knownNumber |
890 | + enabled: knownNumber |
891 | + |
892 | + Icon { |
893 | + name: "message" |
894 | + width: units.gu(2) |
895 | + height: units.gu(2) |
896 | + anchors.centerIn: parent |
897 | + } |
898 | + |
899 | + onClicked: mainView.sendMessage(phoneNumber) |
900 | + } |
901 | + |
902 | + AbstractButton { |
903 | + id: callButton |
904 | + anchors { |
905 | + top: messageButton.top |
906 | + right: messageButton.left |
907 | + } |
908 | + width: units.gu(4) |
909 | + height: units.gu(4) |
910 | + visible: knownNumber |
911 | + Icon { |
912 | + name: "call-start" |
913 | + width: units.gu(2) |
914 | + height: units.gu(2) |
915 | + anchors.centerIn: parent |
916 | + } |
917 | + onClicked: { |
918 | + if (mainView.account) { |
919 | + mainView.call(phoneNumber, mainView.account.accountId); |
920 | + } else { |
921 | + mainView.populateDialpad(phoneNumber, mainView.account ? mainView.account.accountId : ""); |
922 | + } |
923 | + } |
924 | + } |
925 | + } |
926 | + |
927 | + delegate: ListItemWithActions { |
928 | + readonly property bool incoming: modelData.senderId !== "self" |
929 | + height: units.gu(5) |
930 | + anchors { |
931 | + left: parent.left |
932 | + right: parent.right |
933 | + } |
934 | + |
935 | + leftSideAction: Action { |
936 | + iconName: "delete" |
937 | + text: i18n.tr("Delete") |
938 | + onTriggered: { |
939 | + // remove from the history service |
940 | + eventModel.removeEvent(modelData.accountId, modelData.threadId, modelData.eventId, modelData.type) |
941 | + |
942 | + // as this page only displays an array of events, we need to update manually |
943 | + // the list of displayed events |
944 | + var updatedEvents = historyDetailsPage.events; |
945 | + updatedEvents.splice(index, 1); |
946 | + historyDetailsPage.events = updatedEvents; |
947 | + } |
948 | + } |
949 | + |
950 | + Label { |
951 | + id: timeLabel |
952 | + // TRANSLATORS: HH:mm is the time format, translate it according to: |
953 | + // http://qt-project.org/doc/qt-5/qml-qtqml-qt.html#formatDate-method |
954 | + text: Qt.formatTime(modelData.timestamp, i18n.tr("hh:mm ap")) |
955 | + anchors { |
956 | + left: parent.left |
957 | + verticalCenter: parent.verticalCenter |
958 | + } |
959 | + color: UbuntuColors.lightAubergine |
960 | + verticalAlignment: Qt.AlignVCenter |
961 | + } |
962 | + |
963 | + Label { |
964 | + id: simLabel |
965 | + anchors { |
966 | + left: timeLabel.right |
967 | + leftMargin: units.gu(1) |
968 | + verticalCenter: timeLabel.verticalCenter |
969 | + } |
970 | + |
971 | + height: units.gu(2) |
972 | + fontSize: "x-small" |
973 | + text: telepathyHelper.accountForId(modelData.accountId).displayName |
974 | + verticalAlignment: Text.AlignVCenter |
975 | + visible: telepathyHelper.activeAccounts.length > 1 |
976 | + } |
977 | + |
978 | + Label { |
979 | + id: durationLabel |
980 | + text: DateUtils.formatCallDuration(modelData.duration) |
981 | + anchors { |
982 | + right: parent.right |
983 | + top: parent.top |
984 | + topMargin: units.gu(-0.5) |
985 | + } |
986 | + verticalAlignment: Text.AlignTop |
987 | + visible: !modelData.missed |
988 | + fontSize: "small" |
989 | + height: units.gu(2) |
990 | + } |
991 | + |
992 | + Label { |
993 | + id: typeLabel |
994 | + text: { |
995 | + if (modelData.missed) { |
996 | + return i18n.tr("Missed"); |
997 | + } else if (incoming) { |
998 | + return i18n.tr("Incoming"); |
999 | + } else { |
1000 | + return i18n.tr("Outgoing"); |
1001 | + } |
1002 | + } |
1003 | + anchors { |
1004 | + right: parent.right |
1005 | + bottom: parent.bottom |
1006 | + bottomMargin: units.gu(-0.5) |
1007 | + } |
1008 | + verticalAlignment: Text.AlignBottom |
1009 | + fontSize: "x-small" |
1010 | + } |
1011 | + } |
1012 | + } |
1013 | + |
1014 | +} |
1015 | |
1016 | === modified file 'src/qml/HistoryPage/HistoryPage.qml' |
1017 | --- src/qml/HistoryPage/HistoryPage.qml 2014-07-31 12:35:17 +0000 |
1018 | +++ src/qml/HistoryPage/HistoryPage.qml 2014-08-22 15:27:37 +0000 |
1019 | @@ -30,7 +30,7 @@ |
1020 | |
1021 | property string searchTerm |
1022 | property int delegateHeight: delegate.height |
1023 | - property bool fullView: false |
1024 | + property bool fullView: currentIndex == -1 |
1025 | property alias currentIndex: historyList.currentIndex |
1026 | property alias selectionMode: historyList.isInSelectionMode |
1027 | |
1028 | @@ -114,8 +114,9 @@ |
1029 | } |
1030 | } |
1031 | |
1032 | - HistoryEventModel { |
1033 | + HistoryGroupedEventsModel { |
1034 | id: historyEventModel |
1035 | + groupingProperties: ["participants", "date"] |
1036 | type: HistoryThreadModel.EventTypeVoice |
1037 | sort: HistorySort { |
1038 | sortField: "timestamp" |
1039 | @@ -124,13 +125,6 @@ |
1040 | filter: HistoryFilter {} |
1041 | } |
1042 | |
1043 | - SortProxyModel { |
1044 | - id: sortProxy |
1045 | - sortRole: HistoryEventModel.TimestampRole |
1046 | - sourceModel: historyEventModel |
1047 | - ascending: false |
1048 | - } |
1049 | - |
1050 | MultipleSelectionListView { |
1051 | id: historyList |
1052 | objectName: "historyList" |
1053 | @@ -174,7 +168,7 @@ |
1054 | |
1055 | currentIndex: -1 |
1056 | anchors.fill: parent |
1057 | - listModel: sortProxy |
1058 | + listModel: historyEventModel |
1059 | |
1060 | onSelectionDone: { |
1061 | for (var i=0; i < items.count; i++) { |
1062 | @@ -189,6 +183,34 @@ |
1063 | } |
1064 | } |
1065 | |
1066 | + Component { |
1067 | + id: sectionComponent |
1068 | + Label { |
1069 | + anchors { |
1070 | + left: parent.left |
1071 | + leftMargin: units.gu(2) |
1072 | + right: parent.right |
1073 | + rightMargin: units.gu(2) |
1074 | + } |
1075 | + text: DateUtils.friendlyDay(section) |
1076 | + height: units.gu(5) |
1077 | + fontSize: "medium" |
1078 | + font.weight: Font.DemiBold |
1079 | + verticalAlignment: Text.AlignVCenter |
1080 | + ListItem.ThinDivider { |
1081 | + anchors { |
1082 | + left: parent.left |
1083 | + right: parent.right |
1084 | + bottom: parent.bottom |
1085 | + bottomMargin: units.gu(0.5) |
1086 | + } |
1087 | + } |
1088 | + } |
1089 | + } |
1090 | + |
1091 | + section.property: "date" |
1092 | + section.delegate: fullView ? sectionComponent : null |
1093 | + |
1094 | listDelegate: delegateComponent |
1095 | |
1096 | Component { |
1097 | @@ -269,14 +291,28 @@ |
1098 | leftSideAction: Action { |
1099 | iconName: "delete" |
1100 | text: i18n.tr("Delete") |
1101 | - onTriggered: historyEventModel.removeEvent(model.accountId, model.threadId, model.eventId, model.type) |
1102 | + onTriggered: { |
1103 | + var events = model.events; |
1104 | + for (var i in events) { |
1105 | + historyEventModel.removeEvent(events[i].accountId, events[i].threadId, events[i].eventId, events[i].type) |
1106 | + } |
1107 | + } |
1108 | } |
1109 | property bool knownNumber: participants[0] != "x-ofono-private" && participants[0] != "x-ofono-unknown" |
1110 | rightSideActions: [ |
1111 | - // FIXME: the first action should go to contac call log details page |
1112 | + Action { |
1113 | + iconName: "info" |
1114 | + text: i18n.tr("Details") |
1115 | + onTriggered: { |
1116 | + pageStack.push(Qt.resolvedUrl("HistoryDetailsPage.qml"), |
1117 | + { phoneNumber: participants[0], |
1118 | + events: model.events, |
1119 | + eventModel: historyEventModel}) |
1120 | + } |
1121 | + }, |
1122 | Action { |
1123 | iconName: unknownContact ? "contact-new" : "stock_contact" |
1124 | - text: i18n.tr("Details") |
1125 | + text: i18n.tr("Contact Details") |
1126 | onTriggered: { |
1127 | if (unknownContact) { |
1128 | mainView.addNewPhone(phoneNumber) |
1129 | |
1130 | === removed file 'src/qml/HistoryPage/Timeline.qml' |
1131 | --- src/qml/HistoryPage/Timeline.qml 2014-07-23 10:13:32 +0000 |
1132 | +++ src/qml/HistoryPage/Timeline.qml 1970-01-01 00:00:00 +0000 |
1133 | @@ -1,65 +0,0 @@ |
1134 | -/* |
1135 | - * Copyright 2012-2013 Canonical Ltd. |
1136 | - * |
1137 | - * This file is part of dialer-app. |
1138 | - * |
1139 | - * dialer-app is free software; you can redistribute it and/or modify |
1140 | - * it under the terms of the GNU General Public License as published by |
1141 | - * the Free Software Foundation; version 3. |
1142 | - * |
1143 | - * dialer-app is distributed in the hope that it will be useful, |
1144 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1145 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1146 | - * GNU General Public License for more details. |
1147 | - * |
1148 | - * You should have received a copy of the GNU General Public License |
1149 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1150 | - */ |
1151 | - |
1152 | -import QtQuick 2.0 |
1153 | -import Ubuntu.Components 1.1 |
1154 | - |
1155 | -Item { |
1156 | - property bool isFirst: false |
1157 | - property alias mainAreaHeight: mainArea.height |
1158 | - |
1159 | - width: units.gu(2) |
1160 | - height: units.gu(9) |
1161 | - |
1162 | - Item { |
1163 | - id: mainArea |
1164 | - anchors { |
1165 | - left: parent.left |
1166 | - right: parent.right |
1167 | - top: parent.top |
1168 | - } |
1169 | - height: units.gu(9) |
1170 | - } |
1171 | - |
1172 | - BorderImage { |
1173 | - id: topLine |
1174 | - visible: !isFirst |
1175 | - anchors.top: parent.top |
1176 | - anchors.bottom: circle.top |
1177 | - anchors.horizontalCenter: parent.horizontalCenter |
1178 | - source: "../assets/timeline_vertical_line.sci" |
1179 | - smooth: true |
1180 | - } |
1181 | - |
1182 | - Image { |
1183 | - id: circle |
1184 | - anchors.verticalCenter: mainArea.verticalCenter |
1185 | - anchors.horizontalCenter: parent.horizontalCenter |
1186 | - source: "../assets/timeline_circle.png" |
1187 | - smooth: true |
1188 | - } |
1189 | - |
1190 | - BorderImage { |
1191 | - id: bottomLine |
1192 | - anchors.top: circle.bottom |
1193 | - anchors.bottom: parent.bottom |
1194 | - anchors.horizontalCenter: mainArea.horizontalCenter |
1195 | - source: "../assets/timeline_vertical_line.sci" |
1196 | - smooth: true |
1197 | - } |
1198 | -} |
1199 | |
1200 | === modified file 'src/qml/HistoryPage/dateUtils.js' |
1201 | --- src/qml/HistoryPage/dateUtils.js 2014-01-24 20:38:22 +0000 |
1202 | +++ src/qml/HistoryPage/dateUtils.js 2014-08-22 15:27:37 +0000 |
1203 | @@ -33,7 +33,11 @@ |
1204 | } |
1205 | |
1206 | function friendlyDay(timestamp) { |
1207 | - var date = new Date(timestamp); |
1208 | + var year = Qt.formatDate(timestamp, "yyyy"); |
1209 | + var month = Qt.formatDate(timestamp, "MM"); |
1210 | + var day = Qt.formatDate(timestamp, "dd"); |
1211 | + // NOTE: it is very weird, but javascript Date() object expects months to be between 0 and 11 |
1212 | + var date = new Date(year, month-1, day); |
1213 | var today = new Date(); |
1214 | var yesterday = new Date(); |
1215 | yesterday.setDate(today.getDate()-1); |
1216 | @@ -50,12 +54,39 @@ |
1217 | return Qt.formatTime(timestamp, Qt.DefaultLocaleShortDate) + " - " + friendlyDay(timestamp); |
1218 | } |
1219 | |
1220 | +function dateFromDuration(duration) { |
1221 | + var durationTime = new Date(); |
1222 | + var processedDuration = duration; |
1223 | + var seconds = processedDuration % 60; |
1224 | + var minutes = 0; |
1225 | + var hours = 0; |
1226 | + |
1227 | + |
1228 | + // divide by 60 to get the minutes |
1229 | + processedDuration = Math.floor(processedDuration / 60); |
1230 | + if (processedDuration > 0) { |
1231 | + minutes = processedDuration % 60; |
1232 | + |
1233 | + // divide again to get the hours |
1234 | + processedDuration = Math.floor(processedDuration / 60); |
1235 | + hours = processedDuration; |
1236 | + } |
1237 | + |
1238 | + durationTime.setHours(hours); |
1239 | + durationTime.setMinutes(minutes); |
1240 | + durationTime.setSeconds(seconds); |
1241 | + |
1242 | + return durationTime; |
1243 | +} |
1244 | + |
1245 | function formatFriendlyCallDuration(duration) { |
1246 | var text = ""; |
1247 | |
1248 | - var hours = parseInt(Qt.formatTime(duration, "hh")); |
1249 | - var minutes = parseInt(Qt.formatTime(duration, "mm")); |
1250 | - var seconds = parseInt(Qt.formatTime(duration, "ss")); |
1251 | + var durationTime = dateFromDuration(duration); |
1252 | + |
1253 | + var hours = parseInt(Qt.formatTime(durationTime, "hh")); |
1254 | + var minutes = parseInt(Qt.formatTime(durationTime, "mm")); |
1255 | + var seconds = parseInt(Qt.formatTime(durationTime, "ss")); |
1256 | |
1257 | if (hours > 0) { |
1258 | text = i18n.tr("%1 hour", "%1 hours", hours).arg(hours) |
1259 | @@ -67,3 +98,21 @@ |
1260 | |
1261 | return text; |
1262 | } |
1263 | + |
1264 | +function formatCallDuration(duration) { |
1265 | + var text = "" |
1266 | + var durationTime = dateFromDuration(duration); |
1267 | + |
1268 | + var hours = parseInt(Qt.formatTime(durationTime, "hh")); |
1269 | + var minutes = parseInt(Qt.formatTime(durationTime, "mm")); |
1270 | + var seconds = parseInt(Qt.formatTime(durationTime, "ss")); |
1271 | + |
1272 | + if (hours > 0) { |
1273 | + // TRANSLATORS: this is the duration time format when the call lasted more than an hour |
1274 | + text = Qt.formatTime(durationTime, i18n.tr("hh:mm:ss")); |
1275 | + } else { |
1276 | + // TRANSLATORS: this is the duration time format when the call lasted less than an hour |
1277 | + text = Qt.formatTime(durationTime, i18n.tr("mm:ss")); |
1278 | + } |
1279 | + return text; |
1280 | +} |
1281 | |
1282 | === modified file 'src/qml/LiveCallPage/LiveCall.qml' |
1283 | --- src/qml/LiveCallPage/LiveCall.qml 2014-07-31 08:22:43 +0000 |
1284 | +++ src/qml/LiveCallPage/LiveCall.qml 2014-08-22 15:27:37 +0000 |
1285 | @@ -70,6 +70,7 @@ |
1286 | |
1287 | title: caller |
1288 | head.actions: greeter.greeterActive ? greeterModeActions : regularActions |
1289 | + head.sections.model: multipleAccounts ? [call.account.displayName] : [] |
1290 | x: header ? header.height : 0 |
1291 | |
1292 | // if there are no calls, just reset the view |
1293 | |
1294 | === modified file 'src/qml/assets/dialer_background_full@27.png' |
1295 | Binary files src/qml/assets/dialer_background_full@27.png 2014-05-21 08:40:25 +0000 and src/qml/assets/dialer_background_full@27.png 2014-08-22 15:27:37 +0000 differ |
1296 | === modified file 'src/qml/dialer-app.qml' |
1297 | --- src/qml/dialer-app.qml 2014-08-13 22:27:59 +0000 |
1298 | +++ src/qml/dialer-app.qml 2014-08-22 15:27:37 +0000 |
1299 | @@ -30,14 +30,16 @@ |
1300 | property bool applicationActive: Qt.application.active |
1301 | property string ussdResponseTitle: "" |
1302 | property string ussdResponseText: "" |
1303 | - property bool multipleAccounts: telepathyHelper.accounts.length > 1 |
1304 | - property QtObject account: { |
1305 | + property bool multipleAccounts: telepathyHelper.activeAccounts.length > 1 |
1306 | + property QtObject account: defaultAccount() |
1307 | + |
1308 | + function defaultAccount() { |
1309 | // we only use the default account property if we have more |
1310 | // than one account, otherwise we use always the first one |
1311 | if (multipleAccounts) { |
1312 | return telepathyHelper.defaultCallAccount |
1313 | } else { |
1314 | - return telepathyHelper.accounts[0] |
1315 | + return telepathyHelper.activeAccounts[0] |
1316 | } |
1317 | } |
1318 | |
1319 | @@ -72,6 +74,20 @@ |
1320 | } |
1321 | } |
1322 | |
1323 | + Connections { |
1324 | + target: telepathyHelper |
1325 | + onActiveAccountsChanged: { |
1326 | + // check if the selected account is not active anymore |
1327 | + for (var i in telepathyHelper.activeAccounts) { |
1328 | + if (telepathyHelper.activeAccounts[i] == account) { |
1329 | + return; |
1330 | + } |
1331 | + } |
1332 | + account = Qt.binding(defaultAccount) |
1333 | + } |
1334 | + onDefaultCallAccountChanged: account = Qt.binding(defaultAccount) |
1335 | + } |
1336 | + |
1337 | Settings { |
1338 | id: settings |
1339 | category: "DualSim" |
1340 | @@ -256,6 +272,7 @@ |
1341 | } |
1342 | |
1343 | source: Qt.resolvedUrl("assets/dialer_background_full.png") |
1344 | + asynchronous: true |
1345 | } |
1346 | |
1347 | Component { |
1348 | |
1349 | === modified file 'tests/autopilot/dialer_app/tests/test_logs.py' |
1350 | --- tests/autopilot/dialer_app/tests/test_logs.py 2014-08-10 07:55:47 +0000 |
1351 | +++ tests/autopilot/dialer_app/tests/test_logs.py 2014-08-22 15:27:37 +0000 |
1352 | @@ -59,7 +59,7 @@ |
1353 | """ |
1354 | delegate = self.main_view.wait_select_single( |
1355 | ListItemWithActions.HistoryDelegate, objectName='historyDelegate0') |
1356 | - delegate.active_action(2) |
1357 | + delegate.active_action(3) |
1358 | self.addCleanup(subprocess.call, ['pkill', '-f', 'messaging-app']) |
1359 | |
1360 | msg_app = self._get_app_proxy_object('messaging-app') |
1361 | @@ -78,7 +78,7 @@ |
1362 | """ |
1363 | delegate = self.main_view.wait_select_single( |
1364 | ListItemWithActions.HistoryDelegate, objectName='historyDelegate0') |
1365 | - delegate.active_action(1) |
1366 | + delegate.active_action(2) |
1367 | self.addCleanup(subprocess.call, ['pkill', '-f', 'address-book-app']) |
1368 | |
1369 | cntct_app = self._get_app_proxy_object('address-book-app') |