Merge lp:dialer-app/staging into lp:dialer-app

Proposed by Gustavo Pichorim Boiko
Status: Approved
Approved by: Gustavo Pichorim Boiko
Approved revision: 559
Proposed branch: lp:dialer-app/staging
Merge into: lp:dialer-app
Diff against target: 4385 lines (+2739/-259)
63 files modified
CMakeLists.txt (+1/-0)
TODO (+1/-0)
accounts/CMakeLists.txt (+2/-0)
accounts/dialer-app.application (+12/-0)
debian/dialer-app.install (+2/-0)
po/dialer-app.pot (+253/-111)
src/dialer-app.desktop.in.in (+0/-1)
src/qml/AccountsModel.qml (+1/-1)
src/qml/CMakeLists.txt (+1/-0)
src/qml/ContactsPage/ContactsPage.qml (+1/-1)
src/qml/ContactsPage/KeyboardRectagle.qml (+1/-1)
src/qml/DialerPage/CallButton.qml (+1/-1)
src/qml/DialerPage/CustomButton.qml (+1/-1)
src/qml/DialerPage/DialerBottomEdge.qml (+1/-1)
src/qml/DialerPage/DialerPage.qml (+67/-14)
src/qml/DialerPage/Keypad.qml (+108/-34)
src/qml/DialerPage/KeypadButton.qml (+20/-20)
src/qml/DialerPage/KeypadEntry.qml (+34/-6)
src/qml/Dialogs/DisableFlightModeDialog.qml (+1/-1)
src/qml/Dialogs/FlightModeProgressDialog.qml (+1/-1)
src/qml/Dialogs/NoDefaultSIMCardDialog.qml (+1/-1)
src/qml/Dialogs/NotificationDialog.qml (+1/-1)
src/qml/Dialogs/SetDefaultSIMCardDialog.qml (+1/-1)
src/qml/Dialogs/SimLockedDialog.qml (+1/-1)
src/qml/Dialogs/UssdErrorDialog.qml (+1/-1)
src/qml/Dialogs/UssdProgressDialog.qml (+1/-1)
src/qml/Dialogs/UssdResponseDialog.qml (+1/-1)
src/qml/HistoryPage/ExpandableButton.qml (+1/-1)
src/qml/HistoryPage/HistoryDelegate.qml (+1/-1)
src/qml/HistoryPage/HistoryDetailsPage.qml (+1/-1)
src/qml/HistoryPage/HistoryPage.qml (+11/-2)
src/qml/HistoryPage/SwipeItemDemo.qml (+1/-1)
src/qml/InputInfo.qml (+1/-1)
src/qml/LiveCallPage/ConferenceCallDisplay.qml (+1/-1)
src/qml/LiveCallPage/HangupButton.qml (+1/-1)
src/qml/LiveCallPage/LiveCall.qml (+56/-35)
src/qml/LiveCallPage/LiveCallKeypadButton.qml (+1/-1)
src/qml/LiveCallPage/MultiCallDisplay.qml (+1/-1)
src/qml/LiveCallPage/StopWatch.qml (+1/-1)
src/qml/MMI/IMEI.qml (+1/-1)
src/qml/MMI/IMEIDialog.qml (+1/-1)
src/qml/SettingsPage/AccountSettings/CMakeLists.txt (+6/-0)
src/qml/SettingsPage/AccountSettings/SipNumberRewrite.qml (+177/-0)
src/qml/SettingsPage/AccountSettings/sip.qml (+30/-0)
src/qml/SettingsPage/CMakeLists.txt (+8/-0)
src/qml/SettingsPage/CallForwardItem.qml (+240/-0)
src/qml/SettingsPage/CallForwarding.qml (+393/-0)
src/qml/SettingsPage/CallWaiting.qml (+108/-0)
src/qml/SettingsPage/KeyboardRectangle.qml (+77/-0)
src/qml/SettingsPage/MultiSim.qml (+113/-0)
src/qml/SettingsPage/NoSims.qml (+46/-0)
src/qml/SettingsPage/Ofono.qml (+69/-0)
src/qml/SettingsPage/OnlineAccountsHelper.qml (+96/-0)
src/qml/SettingsPage/ServiceInfo.qml (+133/-0)
src/qml/SettingsPage/Services.qml (+74/-0)
src/qml/SettingsPage/SettingsItemTitle.qml (+44/-0)
src/qml/SettingsPage/SettingsPage.qml (+158/-0)
src/qml/SettingsPage/SettingsTextField.qml (+29/-0)
src/qml/SettingsPage/SingleSim.qml (+69/-0)
src/qml/SettingsPage/VCardParser.qml (+55/-0)
src/qml/SettingsPage/callForwardingUtils.js (+126/-0)
src/qml/SettingsPage/dateUtils.js (+69/-0)
src/qml/dialer-app.qml (+24/-9)
To merge this branch: bzr merge lp:dialer-app/staging
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
system-apps-ci-bot continuous-integration Approve
Review via email: mp+320691@code.launchpad.net

Commit message

- Adapt to work with VOIP accounts.
- Install 'IM' account application file. Make sure that dialer-app appear on the application list for 'IM' services.
- Allow to expand the keypad.
- Move the phone settings from ubuntu-system-settings to dialer-app.

Description of the change

- Adapt to work with VOIP accounts.
- Install 'IM' account application file. Make sure that dialer-app appear on the application list for 'IM' services.
- Allow to expand the keypad.
- Move the phone settings from ubuntu-system-settings to dialer-app.

To post a comment you must log in.
lp:dialer-app/staging updated
559. By Gustavo Pichorim Boiko

Move the phone settings from ubuntu-system-settings to dialer-app.

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:559
https://jenkins.canonical.com/system-apps/job/lp-dialer-app-ci/2/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/2339
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/2338
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2160
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2160/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=zesty/2160
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=zesty/2160/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2160
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2160/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=zesty/2160
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=zesty/2160/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/2160
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/2160/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=zesty/2160
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=zesty/2160/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-dialer-app-ci/2/rebuild

review: Approve (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

The changes were reviewed individually and tested from this branch, so approving.

review: Approve
lp:dialer-app/staging updated
560. By Tiago Salem Herrmann

Use HistoryUnionFilter to force history model query the server

561. By Gustavo Pichorim Boiko

Only try to assing previously set values if they are available.

562. By Gustavo Pichorim Boiko

Avoid placing multiple calls when pressing enter by removing the focus of the view

Unmerged revisions

562. By Gustavo Pichorim Boiko

Avoid placing multiple calls when pressing enter by removing the focus of the view

561. By Gustavo Pichorim Boiko

Only try to assing previously set values if they are available.

560. By Tiago Salem Herrmann

Use HistoryUnionFilter to force history model query the server

559. By Gustavo Pichorim Boiko

Move the phone settings from ubuntu-system-settings to dialer-app.

558. By Gustavo Pichorim Boiko

Allow to expand the keypad.

557. By Gustavo Pichorim Boiko

Install 'IM' account application file.

Make sure that dialer-app appear on the application list for 'IM' services.

556. By Gustavo Pichorim Boiko

Adapt to work with VOIP accounts.

555. By Gustavo Pichorim Boiko

Sync with trunk.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-08-15 09:08:45 +0000
3+++ CMakeLists.txt 2017-04-05 17:09:12 +0000
4@@ -73,4 +73,5 @@
5
6 add_subdirectory(po)
7 add_subdirectory(src)
8+add_subdirectory(accounts)
9 add_subdirectory(tests)
10
11=== added file 'TODO'
12--- TODO 1970-01-01 00:00:00 +0000
13+++ TODO 2017-04-05 17:09:12 +0000
14@@ -0,0 +1,1 @@
15+- port the settings page to use the new SDK ListItem to fix keyboard navigation
16
17=== added directory 'accounts'
18=== added file 'accounts/CMakeLists.txt'
19--- accounts/CMakeLists.txt 1970-01-01 00:00:00 +0000
20+++ accounts/CMakeLists.txt 2017-04-05 17:09:12 +0000
21@@ -0,0 +1,2 @@
22+file(GLOB APPLICATION_FILES *.application)
23+install(FILES ${APPLICATION_FILES} DESTINATION share/accounts/applications/)
24
25=== added file 'accounts/dialer-app.application'
26--- accounts/dialer-app.application 1970-01-01 00:00:00 +0000
27+++ accounts/dialer-app.application 2017-04-05 17:09:12 +0000
28@@ -0,0 +1,12 @@
29+<?xml version="1.0" encoding="UTF-8"?>
30+<application id="dialer-app">
31+ <description>Dialer</description>
32+ <desktop-entry>dialer-app.desktop</desktop-entry>
33+ <translations>dialer</translations>
34+
35+ <services>
36+ <service id="telephony-sip-im">
37+ <description>Allow SIP calls from dialer app</description>
38+ </service>
39+ </services>
40+</application>
41
42=== modified file 'debian/dialer-app.install'
43--- debian/dialer-app.install 2015-04-30 18:10:29 +0000
44+++ debian/dialer-app.install 2017-04-05 17:09:12 +0000
45@@ -8,7 +8,9 @@
46 usr/share/dialer-app/ContactsPage
47 usr/share/dialer-app/ContactViewPage
48 usr/share/dialer-app/ContactEditorPage
49+usr/share/dialer-app/SettingsPage
50 usr/share/dialer-app/Dialogs
51 usr/share/dialer-app/assets
52 usr/share/dialer-app/MMI
53+usr/share/accounts/applications/*
54 usr/bin/*dialer-app*
55
56=== modified file 'po/dialer-app.pot'
57--- po/dialer-app.pot 2015-07-15 13:54:05 +0000
58+++ po/dialer-app.pot 2017-04-05 17:09:12 +0000
59@@ -8,7 +8,7 @@
60 msgstr ""
61 "Project-Id-Version: PACKAGE VERSION\n"
62 "Report-Msgid-Bugs-To: \n"
63-"POT-Creation-Date: 2015-07-15 10:53-0300\n"
64+"POT-Creation-Date: 2017-01-12 16:58-0200\n"
65 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
66 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
67 "Language-Team: LANGUAGE <LL@li.org>\n"
68@@ -18,17 +18,25 @@
69 "Content-Transfer-Encoding: 8bit\n"
70 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
71
72-#: ../src/qml/DialerPage/Keypad.qml:174
73+#: ../src/qml/DialerPage/Keypad.qml:242
74 msgid "#"
75 msgstr ""
76
77 #. TRANSLATORS: %1 is the call duration here.
78-#: ../src/qml/LiveCallPage/LiveCall.qml:443
79+#: ../src/qml/LiveCallPage/LiveCall.qml:454
80 #, qt-format
81 msgid "%1 - on hold"
82 msgstr ""
83
84+#. TRANSLATORS: %1 is the name of the (network) carrier
85+#: ../src/qml/SettingsPage/Services.qml:34
86+#: ../src/qml/SettingsPage/SingleSim.qml:51
87+#, qt-format
88+msgid "%1 Services"
89+msgstr ""
90+
91 #: ../src/qml/HistoryPage/dateUtils.js:92
92+#: ../src/qml/SettingsPage/dateUtils.js:61
93 #, qt-format
94 msgid "%1 hour"
95 msgid_plural "%1 hours"
96@@ -36,6 +44,7 @@
97 msgstr[1] ""
98
99 #: ../src/qml/HistoryPage/dateUtils.js:94
100+#: ../src/qml/SettingsPage/dateUtils.js:63
101 #, qt-format
102 msgid "%1 min"
103 msgid_plural "%1 mins"
104@@ -43,6 +52,7 @@
105 msgstr[1] ""
106
107 #: ../src/qml/HistoryPage/dateUtils.js:96
108+#: ../src/qml/SettingsPage/dateUtils.js:65
109 #, qt-format
110 msgid "%1 sec"
111 msgid_plural "%1 secs"
112@@ -50,61 +60,62 @@
113 msgstr[1] ""
114
115 #. TRANSLATORS: this is the count of events grouped into this single item
116-#: ../src/qml/HistoryPage/HistoryDelegate.qml:201
117+#: ../src/qml/HistoryPage/HistoryDelegate.qml:206
118 #: ../src/qml/HistoryPage/SwipeItemDemo.qml:150
119 #, qt-format
120 msgid "(%1)"
121 msgstr ""
122
123-#: ../src/qml/DialerPage/Keypad.qml:150
124+#: ../src/qml/DialerPage/Keypad.qml:206
125 msgid "*"
126 msgstr ""
127
128-#: ../src/qml/DialerPage/Keypad.qml:161
129+#: ../src/qml/DialerPage/DialerBottomEdge.qml:26
130+#: ../src/qml/DialerPage/Keypad.qml:223
131 msgid "+"
132 msgstr ""
133
134-#: ../src/qml/DialerPage/Keypad.qml:160
135+#: ../src/qml/DialerPage/Keypad.qml:222
136 msgid "0"
137 msgstr ""
138
139-#: ../src/qml/DialerPage/Keypad.qml:49
140+#: ../src/qml/DialerPage/Keypad.qml:51
141 msgid "1"
142 msgstr ""
143
144-#: ../src/qml/DialerPage/Keypad.qml:60
145+#: ../src/qml/DialerPage/Keypad.qml:68
146 msgid "2"
147 msgstr ""
148
149-#: ../src/qml/DialerPage/Keypad.qml:71
150+#: ../src/qml/DialerPage/Keypad.qml:85
151 msgid "3"
152 msgstr ""
153
154-#: ../src/qml/DialerPage/Keypad.qml:82
155+#: ../src/qml/DialerPage/Keypad.qml:102
156 msgid "4"
157 msgstr ""
158
159-#: ../src/qml/DialerPage/Keypad.qml:93
160+#: ../src/qml/DialerPage/Keypad.qml:119
161 msgid "5"
162 msgstr ""
163
164-#: ../src/qml/DialerPage/Keypad.qml:104
165+#: ../src/qml/DialerPage/Keypad.qml:136
166 msgid "6"
167 msgstr ""
168
169-#: ../src/qml/DialerPage/Keypad.qml:115
170+#: ../src/qml/DialerPage/Keypad.qml:153
171 msgid "7"
172 msgstr ""
173
174-#: ../src/qml/DialerPage/Keypad.qml:126
175+#: ../src/qml/DialerPage/Keypad.qml:170
176 msgid "8"
177 msgstr ""
178
179-#: ../src/qml/DialerPage/Keypad.qml:137
180+#: ../src/qml/DialerPage/Keypad.qml:187
181 msgid "9"
182 msgstr ""
183
184-#: ../src/qml/DialerPage/Keypad.qml:61
185+#: ../src/qml/DialerPage/Keypad.qml:69
186 msgid "ABC"
187 msgstr ""
188
189@@ -112,61 +123,94 @@
190 msgid "Active"
191 msgstr ""
192
193-#: ../src/qml/HistoryPage/HistoryPage.qml:49
194+#: ../src/qml/HistoryPage/HistoryPage.qml:68
195 msgctxt "All Calls"
196 msgid "All"
197 msgstr ""
198
199-#: ../src/qml/ContactsPage/ContactsPage.qml:92
200+#: ../src/qml/ContactsPage/ContactsPage.qml:95
201 msgctxt "All Contacts"
202 msgid "All"
203 msgstr ""
204
205-#: ../src/qml/LiveCallPage/LiveCall.qml:326
206+#: ../src/qml/SettingsPage/CallForwarding.qml:378
207+msgid "All calls"
208+msgstr ""
209+
210+#: ../src/qml/LiveCallPage/LiveCall.qml:341
211 msgid "Bluetooth device"
212 msgstr ""
213
214-#: ../src/qml/dialer-app.qml:596
215+#: ../src/qml/SettingsPage/ServiceInfo.qml:125
216+msgid "Call"
217+msgstr ""
218+
219+#: ../src/qml/dialer-app.qml:570
220 msgid "Call Barring"
221 msgstr ""
222
223-#: ../src/qml/dialer-app.qml:607
224+#: ../src/qml/dialer-app.qml:581
225 msgid "Call Forwarding"
226 msgstr ""
227
228-#: ../src/qml/dialer-app.qml:618
229+#: ../src/qml/dialer-app.qml:592
230 msgid "Call Waiting"
231 msgstr ""
232
233-#: ../src/qml/LiveCallPage/LiveCall.qml:134
234+#: ../src/qml/LiveCallPage/LiveCall.qml:152
235 msgid "Call ended"
236 msgstr ""
237
238-#: ../src/qml/LiveCallPage/LiveCall.qml:283
239+#: ../src/qml/LiveCallPage/LiveCall.qml:297
240 msgid "Call failed"
241 msgstr ""
242
243-#: ../src/qml/LiveCallPage/LiveCall.qml:142
244+#: ../src/qml/SettingsPage/CallForwarding.qml:44
245+#: ../src/qml/SettingsPage/MultiSim.qml:51
246+#: ../src/qml/SettingsPage/NoSims.qml:28
247+#: ../src/qml/SettingsPage/SingleSim.qml:39
248+msgid "Call forwarding"
249+msgstr ""
250+
251+#: ../src/qml/SettingsPage/CallForwardItem.qml:218
252+msgid "Call forwarding can't be changed right now."
253+msgstr ""
254+
255+#: ../src/qml/SettingsPage/CallForwarding.qml:154
256+msgid "Call forwarding status can't be checked "
257+msgstr ""
258+
259+#: ../src/qml/LiveCallPage/LiveCall.qml:160
260 msgid "Call holding failure"
261 msgstr ""
262
263-#: ../src/qml/LiveCallPage/ConferenceCallDisplay.qml:110
264-#: ../src/qml/LiveCallPage/LiveCall.qml:445
265+#: ../src/qml/SettingsPage/CallWaiting.qml:31
266+#: ../src/qml/SettingsPage/CallWaiting.qml:86
267+#: ../src/qml/SettingsPage/MultiSim.qml:41
268+#: ../src/qml/SettingsPage/NoSims.qml:34
269+#: ../src/qml/SettingsPage/SingleSim.qml:32
270+msgid "Call waiting"
271+msgstr ""
272+
273+#: ../src/qml/DialerPage/DialerPage.qml:509
274+#: ../src/qml/LiveCallPage/ConferenceCallDisplay.qml:113
275+#: ../src/qml/LiveCallPage/LiveCall.qml:456
276 #: ../src/qml/LiveCallPage/MultiCallDisplay.qml:108
277 msgid "Calling"
278 msgstr ""
279
280-#: ../src/qml/dialer-app.qml:629
281+#: ../src/qml/dialer-app.qml:603
282 msgid "Calling Line Presentation"
283 msgstr ""
284
285-#: ../src/qml/dialer-app.qml:641
286+#: ../src/qml/dialer-app.qml:615
287 msgid "Calling Line Restriction"
288 msgstr ""
289
290 #: ../src/qml/ContactEditorPage/DialerContactEditorPage.qml:35
291-#: ../src/qml/ContactsPage/ContactsPage.qml:106
292+#: ../src/qml/ContactsPage/ContactsPage.qml:145
293 #: ../src/qml/Dialogs/DisableFlightModeDialog.qml:38
294+#: ../src/qml/SettingsPage/CallForwarding.qml:236
295 msgid "Cancel"
296 msgstr ""
297
298@@ -176,49 +220,61 @@
299 msgid "Change all Call associations to %1?"
300 msgstr ""
301
302-#: ../src/qml/DialerPage/DialerPage.qml:55
303+#: ../src/qml/DialerPage/DialerPage.qml:78
304 #: ../src/qml/Dialogs/NotificationDialog.qml:29
305 msgid "Close"
306 msgstr ""
307
308-#: ../src/qml/LiveCallPage/LiveCall.qml:48
309+#: ../src/qml/LiveCallPage/LiveCall.qml:52
310 #: ../src/qml/LiveCallPage/MultiCallDisplay.qml:89
311 msgid "Conference"
312 msgstr ""
313
314-#: ../src/qml/LiveCallPage/LiveCall.qml:113
315+#: ../src/qml/LiveCallPage/LiveCall.qml:131
316 msgid "Conference call failure"
317 msgstr ""
318
319-#: ../src/qml/dialer-app.qml:635
320+#: ../src/qml/dialer-app.qml:609
321 msgid "Connected Line Presentation"
322 msgstr ""
323
324-#: ../src/qml/dialer-app.qml:647
325+#: ../src/qml/dialer-app.qml:621
326 msgid "Connected Line Restriction"
327 msgstr ""
328
329-#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:54
330-#: ../src/qml/HistoryPage/HistoryPage.qml:343
331+#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:66
332+#: ../src/qml/HistoryPage/HistoryPage.qml:369
333 msgid "Contact Details"
334 msgstr ""
335
336-#: ../src/qml/ContactsPage/ContactsPage.qml:53
337-#: ../src/qml/DialerPage/DialerPage.qml:42
338+#: ../src/qml/SettingsPage/CallForwarding.qml:299
339+msgid "Contact not associated with any phone number."
340+msgstr ""
341+
342+#: ../src/qml/ContactsPage/ContactsPage.qml:77
343+#: ../src/qml/DialerPage/DialerPage.qml:59
344 msgid "Contacts"
345 msgstr ""
346
347-#: ../src/qml/DialerPage/Keypad.qml:72
348+#: ../src/qml/SettingsPage/CallForwarding.qml:223
349+msgid "Contacts..."
350+msgstr ""
351+
352+#: ../src/qml/SettingsPage/CallForwarding.qml:298
353+msgid "Could not forward to this contact"
354+msgstr ""
355+
356+#: ../src/qml/DialerPage/Keypad.qml:86
357 msgid "DEF"
358 msgstr ""
359
360-#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:74
361-#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:238
362-#: ../src/qml/HistoryPage/HistoryPage.qml:315
363+#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:86
364+#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:253
365+#: ../src/qml/HistoryPage/HistoryPage.qml:341
366 msgid "Delete"
367 msgstr ""
368
369-#: ../src/qml/HistoryPage/HistoryPage.qml:324
370+#: ../src/qml/HistoryPage/HistoryPage.qml:350
371 msgid "Details"
372 msgstr ""
373
374@@ -226,12 +282,13 @@
375 msgid "Disable"
376 msgstr ""
377
378-#: ../src/qml/dialer-app.qml:451
379+#: ../src/qml/Dialogs/FlightModeProgressDialog.qml:29
380 msgid "Disabling flight mode"
381 msgstr ""
382
383-#: ../src/qml/MMI/IMEI.qml:48 ../src/qml/dialer-app.qml:514
384-#: ../src/qml/dialer-app.qml:528
385+#: ../src/qml/Dialogs/UssdErrorDialog.qml:31
386+#: ../src/qml/Dialogs/UssdResponseDialog.qml:30
387+#: ../src/qml/MMI/IMEIDialog.qml:40
388 msgid "Dismiss"
389 msgstr ""
390
391@@ -239,47 +296,64 @@
392 msgid "Don't ask again"
393 msgstr ""
394
395-#: ../src/qml/ContactViewPage/DialerContactViewPage.qml:69
396+#: ../src/qml/ContactViewPage/DialerContactViewPage.qml:70
397 msgid "Edit"
398 msgstr ""
399
400-#: ../src/qml/DialerPage/DialerPage.qml:72
401+#: ../src/qml/DialerPage/DialerPage.qml:132
402+#: ../src/qml/DialerPage/DialerPage.qml:142
403 msgid "Emergency Calls"
404 msgstr ""
405
406-#: ../src/qml/DialerPage/DialerPage.qml:277
407+#: ../src/qml/DialerPage/DialerPage.qml:467
408+msgid "Emergency call"
409+msgstr ""
410+
411+#: ../src/qml/DialerPage/DialerPage.qml:303
412+#: ../src/qml/SettingsPage/CallForwardItem.qml:171
413 msgid "Enter a number"
414 msgstr ""
415
416-#: ../src/qml/dialer-app.qml:511
417+#: ../src/qml/Dialogs/UssdErrorDialog.qml:28
418 msgid "Error"
419 msgstr ""
420
421-#: ../src/qml/LiveCallPage/LiveCall.qml:143
422+#: ../src/qml/LiveCallPage/LiveCall.qml:161
423 msgid "Failed to activate the call."
424 msgstr ""
425
426-#: ../src/qml/LiveCallPage/LiveCall.qml:114
427+#: ../src/qml/LiveCallPage/LiveCall.qml:132
428 msgid "Failed to create a conference call."
429 msgstr ""
430
431-#: ../src/qml/LiveCallPage/LiveCall.qml:144
432+#: ../src/qml/LiveCallPage/LiveCall.qml:162
433 msgid "Failed to place the active call on hold."
434 msgstr ""
435
436-#: ../src/qml/ContactsPage/ContactsPage.qml:92
437+#: ../src/qml/ContactsPage/ContactsPage.qml:95
438 msgid "Favorites"
439 msgstr ""
440
441+#: ../src/qml/DialerPage/DialerPage.qml:137
442 #: ../src/qml/Dialogs/DisableFlightModeDialog.qml:27
443 msgid "Flight Mode"
444 msgstr ""
445
446-#: ../src/qml/DialerPage/DialerPage.qml:77
447-msgid "Flight mode"
448-msgstr ""
449-
450-#: ../src/qml/DialerPage/Keypad.qml:83
451+#: ../src/qml/SettingsPage/CallForwarding.qml:127
452+msgid "Forward every incoming call"
453+msgstr ""
454+
455+#: ../src/qml/SettingsPage/CallForwarding.qml:162
456+msgid "Forward incoming calls when:"
457+msgstr ""
458+
459+#. TRANSLATORS: This string will be truncated on smaller displays.
460+#: ../src/qml/SettingsPage/CallForwardItem.qml:157
461+#: ../src/qml/SettingsPage/CallForwardItem.qml:202
462+msgid "Forward to"
463+msgstr ""
464+
465+#: ../src/qml/DialerPage/Keypad.qml:103
466 msgid "GHI"
467 msgstr ""
468
469@@ -287,43 +361,62 @@
470 msgid "Got it"
471 msgstr ""
472
473-#: ../src/qml/MMI/IMEI.qml:36
474+#: ../src/qml/SettingsPage/CallForwarding.qml:182
475+msgid "I don't answer"
476+msgstr ""
477+
478+#: ../src/qml/SettingsPage/CallForwarding.qml:171
479+msgid "I'm on another call"
480+msgstr ""
481+
482+#: ../src/qml/MMI/IMEIDialog.qml:27
483 msgid "IMEI"
484 msgstr ""
485
486-#: ../src/qml/HistoryPage/HistoryDelegate.qml:64
487-#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:315
488+#: ../src/qml/HistoryPage/HistoryDelegate.qml:65
489+#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:330
490 #: ../src/qml/HistoryPage/SwipeItemDemo.qml:189
491 msgid "Incoming"
492 msgstr ""
493
494-#: ../src/qml/dialer-app.qml:512
495+#: ../src/qml/DialerPage/DialerPage.qml:129
496+msgid "Initializing..."
497+msgstr ""
498+
499+#: ../src/qml/Dialogs/UssdErrorDialog.qml:29
500 msgid "Invalid USSD code"
501 msgstr ""
502
503-#: ../src/qml/DialerPage/Keypad.qml:94
504+#: ../src/qml/DialerPage/Keypad.qml:120
505 msgid "JKL"
506 msgstr ""
507
508-#: ../src/qml/DialerPage/DialerPage.qml:85
509-msgid "Keypad"
510+#: ../src/qml/SettingsPage/ServiceInfo.qml:115
511+#, qt-format
512+msgid "Last called %1"
513 msgstr ""
514
515 #: ../src/qml/Dialogs/NoDefaultSIMCardDialog.qml:80
516 msgid "Later"
517 msgstr ""
518
519-#: ../src/qml/DialerPage/Keypad.qml:105
520+#: ../src/qml/SettingsPage/CallWaiting.qml:101
521+msgid ""
522+"Lets you answer or start a new call while on another call, and switch "
523+"between them"
524+msgstr ""
525+
526+#: ../src/qml/DialerPage/Keypad.qml:137
527 msgid "MNO"
528 msgstr ""
529
530-#: ../src/qml/LiveCallPage/LiveCall.qml:548
531+#: ../src/qml/LiveCallPage/LiveCall.qml:573
532 msgid "Merge calls"
533 msgstr ""
534
535-#: ../src/qml/HistoryPage/HistoryDelegate.qml:62
536-#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:313
537-#: ../src/qml/HistoryPage/HistoryPage.qml:49
538+#: ../src/qml/HistoryPage/HistoryDelegate.qml:63
539+#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:328
540+#: ../src/qml/HistoryPage/HistoryPage.qml:68
541 msgid "Missed"
542 msgstr ""
543
544@@ -331,29 +424,45 @@
545 msgid "Mobile"
546 msgstr ""
547
548+#: ../src/qml/SettingsPage/CallForwarding.qml:193
549+msgid "My phone is unreachable"
550+msgstr ""
551+
552 #: ../src/qml/Dialogs/NoDefaultSIMCardDialog.qml:70
553 #: ../src/qml/Dialogs/SetDefaultSIMCardDialog.qml:40
554 msgid "No"
555 msgstr ""
556
557-#: ../src/qml/dialer-app.qml:316
558+#: ../src/qml/dialer-app.qml:355
559 msgid "No SIM card selected"
560 msgstr ""
561
562-#: ../src/qml/LiveCallPage/LiveCall.qml:104
563+#: ../src/qml/LiveCallPage/LiveCall.qml:122
564 msgid "No calls"
565 msgstr ""
566
567-#: ../src/qml/DialerPage/DialerPage.qml:87 ../src/qml/dialer-app.qml:337
568-#: ../src/qml/dialer-app.qml:342
569+#: ../src/qml/DialerPage/DialerPage.qml:151 ../src/qml/dialer-app.qml:374
570+#: ../src/qml/dialer-app.qml:379
571 msgid "No network"
572 msgstr ""
573
574-#: ../src/qml/HistoryPage/HistoryPage.qml:219
575+#: ../src/qml/HistoryPage/HistoryPage.qml:245
576 msgid "No recent calls"
577 msgstr ""
578
579-#: ../src/qml/Dialogs/SimLockedDialog.qml:49
580+#: ../src/qml/SettingsPage/CallForwarding.qml:279
581+msgid "Numbers"
582+msgstr ""
583+
584+#: ../src/qml/SettingsPage/CallForwarding.qml:301
585+msgid "OK"
586+msgstr ""
587+
588+#: ../src/qml/SettingsPage/CallForwarding.qml:382
589+msgid "Off"
590+msgstr ""
591+
592+#: ../src/qml/Dialogs/SimLockedDialog.qml:50
593 msgid "Ok"
594 msgstr ""
595
596@@ -361,15 +470,17 @@
597 msgid "On hold"
598 msgstr ""
599
600-#: ../src/qml/HistoryPage/HistoryDelegate.qml:66
601-#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:317
602+#: ../src/qml/HistoryPage/HistoryDelegate.qml:67
603+#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:332
604 msgid "Outgoing"
605 msgstr ""
606
607-#: ../src/qml/DialerPage/Keypad.qml:116
608+#: ../src/qml/DialerPage/Keypad.qml:154
609 msgid "PQRS"
610 msgstr ""
611
612+#: ../src/qml/DialerPage/DialerPage.qml:149
613+#: ../src/qml/SettingsPage/SettingsPage.qml:29
614 #: ../src/dialer-app.desktop.in.in.h:1
615 msgid "Phone"
616 msgstr ""
617@@ -378,7 +489,7 @@
618 msgid "Phone App"
619 msgstr ""
620
621-#: ../src/qml/LiveCallPage/LiveCall.qml:330
622+#: ../src/qml/LiveCallPage/LiveCall.qml:345
623 msgid "Phone Speaker"
624 msgstr ""
625
626@@ -390,36 +501,48 @@
627 msgid "Phone;Dialer;Dial;Call;Keypad"
628 msgstr ""
629
630-#: ../src/qml/Dialogs/SimLockedDialog.qml:37
631+#: ../src/qml/SettingsPage/CallForwarding.qml:270
632+msgid "Please select a phone number"
633+msgstr ""
634+
635+#: ../src/qml/Dialogs/SimLockedDialog.qml:38
636 msgid ""
637 "Please unlock your SIM card to call or send a message. You can unlock your "
638 "SIM card from the Network Indicator at the top of the screen or by visiting "
639 "<a href=\"system_settings\">System Settings &gt; Security &amp; Privacy</a>."
640 msgstr ""
641
642-#: ../src/qml/dialer-app.qml:491
643+#: ../src/qml/Dialogs/UssdProgressDialog.qml:28
644 msgid "Please wait"
645 msgstr ""
646
647-#: ../src/qml/LiveCallPage/ConferenceCallDisplay.qml:138
648+#: ../src/qml/LiveCallPage/ConferenceCallDisplay.qml:141
649 msgid "Private"
650 msgstr ""
651
652-#: ../src/qml/HistoryPage/HistoryDelegate.qml:167
653-#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:42
654+#: ../src/qml/HistoryPage/HistoryDelegate.qml:168
655+#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:43
656 msgid "Private number"
657 msgstr ""
658
659-#: ../src/qml/DialerPage/DialerPage.qml:122
660-#: ../src/qml/HistoryPage/HistoryPage.qml:45
661+#: ../src/qml/DialerPage/DialerPage.qml:522
662+#: ../src/qml/HistoryPage/HistoryPage.qml:47
663 msgid "Recent"
664 msgstr ""
665
666-#: ../src/qml/Dialogs/SimLockedDialog.qml:26
667+#: ../src/qml/SettingsPage/CallForwarding.qml:142
668+msgid "Redirects all phone calls to another number."
669+msgstr ""
670+
671+#: ../src/qml/SettingsPage/SingleSim.qml:28
672+msgid "SIM"
673+msgstr ""
674+
675+#: ../src/qml/Dialogs/SimLockedDialog.qml:27
676 msgid "SIM Card is locked"
677 msgstr ""
678
679-#: ../src/qml/DialerPage/DialerPage.qml:79
680+#: ../src/qml/DialerPage/DialerPage.qml:140
681 msgid "SIM Locked"
682 msgstr ""
683
684@@ -427,15 +550,15 @@
685 msgid "Save"
686 msgstr ""
687
688-#: ../src/qml/ContactsPage/ContactsPage.qml:80
689+#: ../src/qml/ContactsPage/ContactsPage.qml:119
690 msgid "Search"
691 msgstr ""
692
693-#: ../src/qml/ContactsPage/ContactsPage.qml:68
694+#: ../src/qml/ContactsPage/ContactsPage.qml:67
695 msgid "Search..."
696 msgstr ""
697
698-#: ../src/qml/HistoryPage/HistoryPage.qml:45
699+#: ../src/qml/HistoryPage/HistoryPage.qml:47
700 msgid "Select"
701 msgstr ""
702
703@@ -445,19 +568,32 @@
704 "choice in <a href=\"system_settings\">System Settings</a>."
705 msgstr ""
706
707-#: ../src/qml/HistoryPage/HistoryPage.qml:334
708+#: ../src/qml/HistoryPage/HistoryPage.qml:360
709 msgid "Send message"
710 msgstr ""
711
712-#: ../src/qml/DialerPage/DialerPage.qml:47
713+#: ../src/qml/SettingsPage/MultiSim.qml:62
714+#: ../src/qml/SettingsPage/NoSims.qml:42
715+msgid "Services"
716+msgstr ""
717+
718+#: ../src/qml/SettingsPage/CallForwarding.qml:249
719+msgid "Set"
720+msgstr ""
721+
722+#: ../src/qml/DialerPage/DialerPage.qml:64
723 msgid "Settings"
724 msgstr ""
725
726-#: ../src/qml/ContactViewPage/DialerContactViewPage.qml:60
727-#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:66
728+#: ../src/qml/ContactViewPage/DialerContactViewPage.qml:61
729+#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:78
730 msgid "Share"
731 msgstr ""
732
733+#: ../src/qml/SettingsPage/CallForwarding.qml:380
734+msgid "Some calls"
735+msgstr ""
736+
737 #: ../src/qml/HistoryPage/SwipeItemDemo.qml:326
738 msgid "Swipe to delete"
739 msgstr ""
740@@ -466,11 +602,11 @@
741 msgid "Swipe to reveal actions"
742 msgstr ""
743
744-#: ../src/qml/LiveCallPage/LiveCall.qml:159
745+#: ../src/qml/LiveCallPage/LiveCall.qml:177
746 msgid "Switch audio source:"
747 msgstr ""
748
749-#: ../src/qml/LiveCallPage/LiveCall.qml:533
750+#: ../src/qml/LiveCallPage/LiveCall.qml:558
751 msgid "Switch calls"
752 msgstr ""
753
754@@ -478,42 +614,47 @@
755 msgid "Switch to default SIM:"
756 msgstr ""
757
758-#: ../src/qml/DialerPage/Keypad.qml:127
759+#: ../src/qml/DialerPage/Keypad.qml:171
760 msgid "TUV"
761 msgstr ""
762
763-#: ../src/qml/dialer-app.qml:343
764+#: ../src/qml/dialer-app.qml:380
765 #, qt-format
766 msgid "There is currently no network on %1"
767 msgstr ""
768
769-#: ../src/qml/dialer-app.qml:337 ../src/qml/dialer-app.qml:344
770+#: ../src/qml/dialer-app.qml:374 ../src/qml/dialer-app.qml:381
771 msgid "There is currently no network."
772 msgstr ""
773
774+#: ../src/qml/DialerPage/DialerPage.qml:467
775+msgid "This is not an emergency number."
776+msgstr ""
777+
778 #: ../src/qml/HistoryPage/dateUtils.js:45
779+#: ../src/qml/SettingsPage/dateUtils.js:41
780 msgid "Today"
781 msgstr ""
782
783-#: ../src/qml/LiveCallPage/LiveCall.qml:328
784+#: ../src/qml/LiveCallPage/LiveCall.qml:343
785 msgid "Ubuntu Phone"
786 msgstr ""
787
788-#: ../src/qml/LiveCallPage/LiveCall.qml:332
789+#: ../src/qml/LiveCallPage/LiveCall.qml:347
790 msgid "Unknown device"
791 msgstr ""
792
793-#: ../src/qml/HistoryPage/HistoryDelegate.qml:169
794-#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:44
795+#: ../src/qml/HistoryPage/HistoryDelegate.qml:170
796+#: ../src/qml/HistoryPage/HistoryDetailsPage.qml:45
797 msgid "Unknown number"
798 msgstr ""
799
800-#: ../src/qml/LiveCallPage/ConferenceCallDisplay.qml:72
801+#: ../src/qml/LiveCallPage/ConferenceCallDisplay.qml:73
802 #: ../src/qml/LiveCallPage/MultiCallDisplay.qml:91
803 msgid "Voicemail"
804 msgstr ""
805
806-#: ../src/qml/DialerPage/Keypad.qml:138
807+#: ../src/qml/DialerPage/Keypad.qml:188
808 msgid "WXYZ"
809 msgstr ""
810
811@@ -522,6 +663,7 @@
812 msgstr ""
813
814 #: ../src/qml/HistoryPage/dateUtils.js:47
815+#: ../src/qml/SettingsPage/dateUtils.js:43
816 msgid "Yesterday"
817 msgstr ""
818
819@@ -529,7 +671,7 @@
820 msgid "You have to disable flight mode in order to make calls"
821 msgstr ""
822
823-#: ../src/qml/dialer-app.qml:316
824+#: ../src/qml/dialer-app.qml:355
825 msgid "You need to select a SIM card"
826 msgstr ""
827
828
829=== modified file 'src/dialer-app.desktop.in.in'
830--- src/dialer-app.desktop.in.in 2015-04-29 12:54:24 +0000
831+++ src/dialer-app.desktop.in.in 2017-04-05 17:09:12 +0000
832@@ -14,4 +14,3 @@
833 X-Ubuntu-Default-Department-ID=accessories
834 X-Ubuntu-Splash-Show-Header=true
835 X-Screenshot=@CMAKE_INSTALL_PREFIX@/@DIALER_APP_DIR@/assets/dialer-app-screenshot.png
836-X-Ubuntu-Supported-Orientations=portrait
837
838=== modified file 'src/qml/AccountsModel.qml'
839--- src/qml/AccountsModel.qml 2016-10-19 11:45:45 +0000
840+++ src/qml/AccountsModel.qml 2017-04-05 17:09:12 +0000
841@@ -16,7 +16,7 @@
842 * along with this program. If not, see <http://www.gnu.org/licenses/>.
843 */
844
845-import QtQuick 2.0
846+import QtQuick 2.4
847 import Ubuntu.Telephony 0.1
848
849 Item {
850
851=== modified file 'src/qml/CMakeLists.txt'
852--- src/qml/CMakeLists.txt 2015-04-30 15:42:48 +0000
853+++ src/qml/CMakeLists.txt 2017-04-05 17:09:12 +0000
854@@ -19,3 +19,4 @@
855 add_subdirectory(ContactViewPage)
856 add_subdirectory(ContactEditorPage)
857 add_subdirectory(Dialogs)
858+add_subdirectory(SettingsPage)
859
860=== modified file 'src/qml/ContactsPage/ContactsPage.qml'
861--- src/qml/ContactsPage/ContactsPage.qml 2016-07-27 23:51:39 +0000
862+++ src/qml/ContactsPage/ContactsPage.qml 2017-04-05 17:09:12 +0000
863@@ -16,7 +16,7 @@
864 * along with this program. If not, see <http://www.gnu.org/licenses/>.
865 */
866
867-import QtQuick 2.0
868+import QtQuick 2.4
869 import Ubuntu.Components 1.3
870 import Ubuntu.Components.ListItems 1.3 as ListItem
871 import Ubuntu.Components.Popups 1.3
872
873=== modified file 'src/qml/ContactsPage/KeyboardRectagle.qml'
874--- src/qml/ContactsPage/KeyboardRectagle.qml 2014-07-08 00:34:36 +0000
875+++ src/qml/ContactsPage/KeyboardRectagle.qml 2017-04-05 17:09:12 +0000
876@@ -16,7 +16,7 @@
877 * along with this program. If not, see <http://www.gnu.org/licenses/>.
878 */
879
880-import QtQuick 2.0
881+import QtQuick 2.4
882
883 Item {
884 id: keyboardRect
885
886=== modified file 'src/qml/DialerPage/CallButton.qml'
887--- src/qml/DialerPage/CallButton.qml 2016-08-24 17:50:38 +0000
888+++ src/qml/DialerPage/CallButton.qml 2017-04-05 17:09:12 +0000
889@@ -16,7 +16,7 @@
890 * along with this program. If not, see <http://www.gnu.org/licenses/>.
891 */
892
893-import QtQuick 2.0
894+import QtQuick 2.4
895 import Ubuntu.Components 1.3
896
897 AbstractButton {
898
899=== modified file 'src/qml/DialerPage/CustomButton.qml'
900--- src/qml/DialerPage/CustomButton.qml 2016-08-24 17:50:38 +0000
901+++ src/qml/DialerPage/CustomButton.qml 2017-04-05 17:09:12 +0000
902@@ -16,7 +16,7 @@
903 * along with this program. If not, see <http://www.gnu.org/licenses/>.
904 */
905
906-import QtQuick 2.0
907+import QtQuick 2.4
908 import Ubuntu.Components 1.3
909
910 Button {
911
912=== modified file 'src/qml/DialerPage/DialerBottomEdge.qml'
913--- src/qml/DialerPage/DialerBottomEdge.qml 2016-08-24 17:53:12 +0000
914+++ src/qml/DialerPage/DialerBottomEdge.qml 2017-04-05 17:09:12 +0000
915@@ -16,7 +16,7 @@
916 * along with this program. If not, see <http://www.gnu.org/licenses/>.
917 */
918
919-import QtQuick 2.0
920+import QtQuick 2.4
921 import Ubuntu.Components 1.3
922
923 BottomEdge {
924
925=== modified file 'src/qml/DialerPage/DialerPage.qml'
926--- src/qml/DialerPage/DialerPage.qml 2016-10-18 09:28:54 +0000
927+++ src/qml/DialerPage/DialerPage.qml 2017-04-05 17:09:12 +0000
928@@ -17,7 +17,7 @@
929 */
930
931 import QtContacts 5.0
932-import QtQuick 2.0
933+import QtQuick 2.4
934 import Ubuntu.Components 1.3
935 import Ubuntu.Components.Popups 1.3
936 import Ubuntu.Telephony 0.1
937@@ -36,6 +36,17 @@
938 property alias callAnimationRunning: callAnimation.running
939 property bool greeterMode: false
940 property var mmiPlugins: []
941+ readonly property bool compactView: page.height <= units.gu(60)
942+
943+ function selectAccount(accountId) {
944+ for (var i in accountsModel.activeAccounts) {
945+ var account = accountsModel.activeAccounts[i]
946+ if (account.accountId === accountId) {
947+ headerSections.selectedIndex = i
948+ return
949+ }
950+ }
951+ }
952
953 header: PageHeader {
954 id: pageHeader
955@@ -51,15 +62,23 @@
956 Action {
957 iconName: "settings"
958 text: i18n.tr("Settings")
959- onTriggered: Qt.openUrlExternally("settings:///system/phone")
960+ onTriggered: pageStackNormalMode.push(Qt.resolvedUrl("../SettingsPage/SettingsPage.qml"))
961 }
962
963 ]
964 title: page.title
965+ focus: false
966 trailingActionBar {
967 actions: mainView.greeterMode ? actionsGreeter : actionsNormal
968 }
969
970+ // make sure the SIM selector never gets focus
971+ onFocusChanged: {
972+ if (focus) {
973+ focus = false
974+ }
975+ }
976+
977 leadingActionBar {
978 property list<QtObject> backActionList: [
979 Action {
980@@ -95,6 +114,7 @@
981 id: headerSections
982 model: mainView.multiplePhoneAccounts ? accountsModel.activeAccountNames : []
983 selectedIndex: accountsModel.defaultCallAccountIndex
984+ focus: false
985 onSelectedIndexChanged: {
986 if (selectedIndex >= 0) {
987 mainView.account = accountsModel.activeAccounts[selectedIndex]
988@@ -111,7 +131,6 @@
989 }
990
991 objectName: "dialerPage"
992-
993 title: {
994 // avoid clearing the title when app is inactive
995 // under some states
996@@ -130,8 +149,11 @@
997 var oldTitle = i18n.tr("SIM Locked")
998 // show Emergency Calls for sim locked too. There is going to be an icon indicating it is locked
999 return i18n.tr("Emergency Calls")
1000- } else if (mainView.account && mainView.account.networkName != "") {
1001+ } else if (mainView.account && mainView.account.networkName && mainView.account.networkName != "") {
1002 return mainView.account.networkName
1003+ } else if (mainView.account && mainView.account.type != AccountEntry.PhoneAccount) {
1004+ return mainView.account.protocolInfo.serviceDisplayName != "" ? mainView.account.protocolInfo.serviceDisplayName :
1005+ mainView.account.protocolInfo.name
1006 } else if (multiplePhoneAccounts && !mainView.account) {
1007 return i18n.tr("Phone")
1008 }
1009@@ -165,6 +187,20 @@
1010 }
1011 ]
1012
1013+ // Forward key presses
1014+ Keys.onPressed: {
1015+ if (!active) {
1016+ return
1017+ }
1018+
1019+ // in case Enter is pressed, remove focus from the view to prevent multiple calls to get placed
1020+ if (event.key == Qt.Key_Return || event.key == Qt.Key_Enter) {
1021+ page.focus = false;
1022+ }
1023+
1024+ keypad.keyPressed(event.key, event.text)
1025+ }
1026+
1027 function triggerCallAnimation() {
1028 callAnimation.start();
1029 }
1030@@ -231,7 +267,10 @@
1031 id: keypadContainer
1032
1033 anchors {
1034- fill: parent
1035+ top: parent.top
1036+ left: parent.left
1037+ right: parent.right
1038+ bottom: footer.top
1039 topMargin: pageHeader.height
1040 }
1041 focus: true
1042@@ -246,16 +285,16 @@
1043 right: parent.right
1044 rightMargin: units.gu(2)
1045 }
1046- height: units.gu(10)
1047+ height: page.compactView ? units.gu(7) : units.gu(10)
1048
1049 CustomButton {
1050 id: addContact
1051
1052 anchors {
1053 left: parent.left
1054- verticalCenter: parent.verticalCenter
1055+ verticalCenter: keypadEntry.verticalCenter
1056 }
1057- width: opacity > 0 ? units.gu(4) : 0
1058+ width: opacity > 0 ? (page.compactView ? units.gu(4) : units.gu(3)) : 0
1059 height: (keypadEntry.value !== "" && contactWatcher.isUnknown) ? parent.height : 0
1060 icon: "contact-new"
1061 iconWidth: units.gu(3)
1062@@ -283,11 +322,15 @@
1063 left: addContact.right
1064 right: backspace.left
1065 }
1066- height: units.gu(4)
1067 focus: true
1068 placeHolder: i18n.tr("Enter a number")
1069 Keys.forwardTo: [callButton]
1070 value: mainView.pendingNumberToDial
1071+ height: page.compactView ? units.gu(2) : units.gu(4)
1072+ maximumFontSize: page.compactView ? units.dp(20) : units.dp(30)
1073+ onCommitRequested: {
1074+ callButton.clicked()
1075+ }
1076 }
1077
1078 CustomButton {
1079@@ -295,9 +338,9 @@
1080 objectName: "eraseButton"
1081 anchors {
1082 right: parent.right
1083- verticalCenter: parent.verticalCenter
1084+ verticalCenter: keypadEntry.verticalCenter
1085 }
1086- width: opacity > 0 ? units.gu(4) : 0
1087+ width: opacity > 0 ? (page.compactView ? units.gu(4) : units.gu(3)) : 0
1088 height: input.text !== "" ? parent.height : 0
1089 icon: "erase"
1090 iconWidth: units.gu(3)
1091@@ -363,11 +406,21 @@
1092
1093 anchors {
1094 top: divider.bottom
1095- topMargin: units.gu(2)
1096- horizontalCenter: parent.horizontalCenter
1097+ left: parent.left
1098+ right: parent.right
1099+ bottom: parent.bottom
1100+ margins: units.gu(2)
1101 }
1102-
1103+ labelPixelSize: page.compactView ? units.dp(20) : units.dp(30)
1104+ spacing: page.compactView ? 0 : 5
1105 onKeyPressed: {
1106+ // handle special keys (backspace, arrows, etc)
1107+ keypadEntry.handleKeyEvent(keycode, keychar)
1108+
1109+ if (keycode == Qt.Key_Space) {
1110+ return
1111+ }
1112+
1113 callManager.playTone(keychar);
1114 input.insert(input.cursorPosition, keychar)
1115 if(checkMMI(dialNumber)) {
1116
1117=== modified file 'src/qml/DialerPage/Keypad.qml'
1118--- src/qml/DialerPage/Keypad.qml 2016-08-24 17:51:16 +0000
1119+++ src/qml/DialerPage/Keypad.qml 2017-04-05 17:09:12 +0000
1120@@ -16,165 +16,239 @@
1121 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1122 */
1123
1124-import QtQuick 2.0
1125+import QtQuick 2.3
1126+import QtQuick.Layouts 1.1
1127 import Ubuntu.Components 1.3
1128 import Ubuntu.Components.ListItems 1.3 as ListItems
1129
1130 Item {
1131 id: keypad
1132
1133- property int keysWidth: units.gu(11)
1134- property int keysHeight: units.gu(8)
1135+ readonly property int keysWidth: Math.min(units.gu(11), (keypad.width / (keys.columns + 1)))
1136+ readonly property int keysHeight: Math.min(units.gu(8), (keypad.height / (keys.rows + 1)))
1137+ property double labelPixelSize: units.dp(30)
1138 property bool showVoicemail: false
1139-
1140- width: keys.width
1141- height: keys.height
1142+ property alias spacing: keys.columnSpacing
1143
1144 signal keyPressed(int keycode, string keychar)
1145 signal keyPressAndHold(int keycode, string keychar)
1146
1147- Grid {
1148+ GridLayout {
1149 id: keys
1150
1151 rows: 4
1152 columns: 3
1153- columnSpacing: units.gu(2.0)
1154- rowSpacing: units.gu(0.5)
1155- anchors.centerIn: parent
1156+ rowSpacing: columnSpacing
1157+ anchors.fill: parent
1158+ //horizontalItemAlignment: Grid.AlignHCenter
1159+ //verticalItemAlignment: Grid.AlignVCenter
1160+
1161
1162 KeypadButton {
1163 objectName: "buttonOne"
1164- width: keysWidth
1165- height: keysHeight
1166+ implicitWidth: keysWidth
1167+ implicitHeight: keysHeight
1168 label: i18n.tr("1")
1169 keycode: Qt.Key_1
1170 onPressed: keypad.keyPressed(keycode, "1")
1171 onPressAndHold: keypad.keyPressAndHold(keycode, "1")
1172 iconSource: showVoicemail ? "voicemail" : ""
1173+ labelFont.pixelSize: keypad.labelPixelSize
1174+
1175+ // Layout
1176+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
1177+ Layout.fillHeight: false
1178+ Layout.fillWidth: false
1179 }
1180
1181 KeypadButton {
1182 objectName: "buttonTwo"
1183- width: keysWidth
1184- height: keysHeight
1185+ implicitWidth: keysWidth
1186+ implicitHeight: keysHeight
1187 label: i18n.tr("2")
1188 sublabel: i18n.tr("ABC")
1189 keycode: Qt.Key_2
1190 onPressed: keypad.keyPressed(keycode, "2")
1191 onPressAndHold: keypad.keyPressAndHold(keycode, "2")
1192+ labelFont.pixelSize: keypad.labelPixelSize
1193+
1194+ // Layout
1195+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
1196+ Layout.fillHeight: false
1197+ Layout.fillWidth: false
1198 }
1199
1200 KeypadButton {
1201 objectName: "buttonThree"
1202- width: keysWidth
1203- height: keysHeight
1204+ implicitWidth: keysWidth
1205+ implicitHeight: keysHeight
1206 label: i18n.tr("3")
1207 sublabel: i18n.tr("DEF")
1208 keycode: Qt.Key_3
1209 onPressed: keypad.keyPressed(keycode, "3")
1210 onPressAndHold: keypad.keyPressAndHold(keycode, "3")
1211+ labelFont.pixelSize: keypad.labelPixelSize
1212+
1213+ // Layout
1214+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
1215+ Layout.fillHeight: false
1216+ Layout.fillWidth: false
1217 }
1218
1219 KeypadButton {
1220 objectName: "buttonFour"
1221- width: keysWidth
1222- height: keysHeight
1223+ implicitWidth: keysWidth
1224+ implicitHeight: keysHeight
1225 label: i18n.tr("4")
1226 sublabel: i18n.tr("GHI")
1227 keycode: Qt.Key_4
1228 onPressed: keypad.keyPressed(keycode, "4")
1229 onPressAndHold: keypad.keyPressAndHold(keycode, "4")
1230+ labelFont.pixelSize: keypad.labelPixelSize
1231+
1232+ // Layout
1233+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
1234+ Layout.fillHeight: false
1235+ Layout.fillWidth: false
1236 }
1237
1238 KeypadButton {
1239 objectName: "buttonFive"
1240- width: keysWidth
1241- height: keysHeight
1242+ implicitWidth: keysWidth
1243+ implicitHeight: keysHeight
1244 label: i18n.tr("5")
1245 sublabel: i18n.tr("JKL")
1246 keycode: Qt.Key_5
1247 onPressed: keypad.keyPressed(keycode, "5")
1248 onPressAndHold: keypad.keyPressAndHold(keycode, "5")
1249+ labelFont.pixelSize: keypad.labelPixelSize
1250+
1251+ // Layout
1252+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
1253+ Layout.fillHeight: false
1254+ Layout.fillWidth: false
1255 }
1256
1257 KeypadButton {
1258 objectName: "buttonSix"
1259- width: keysWidth
1260- height: keysHeight
1261+ implicitWidth: keysWidth
1262+ implicitHeight: keysHeight
1263 label: i18n.tr("6")
1264 sublabel: i18n.tr("MNO")
1265 keycode: Qt.Key_6
1266 onPressed: keypad.keyPressed(keycode, "6")
1267 onPressAndHold: keypad.keyPressAndHold(keycode, "6")
1268+ labelFont.pixelSize: keypad.labelPixelSize
1269+
1270+ // Layout
1271+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
1272+ Layout.fillHeight: false
1273+ Layout.fillWidth: false
1274 }
1275
1276 KeypadButton {
1277 objectName: "buttonSeven"
1278- width: keysWidth
1279- height: keysHeight
1280+ implicitWidth: keysWidth
1281+ implicitHeight: keysHeight
1282 label: i18n.tr("7")
1283 sublabel: i18n.tr("PQRS")
1284 keycode: Qt.Key_7
1285 onPressed: keypad.keyPressed(keycode, "7")
1286 onPressAndHold: keypad.keyPressAndHold(keycode, "7")
1287+ labelFont.pixelSize: keypad.labelPixelSize
1288+
1289+ // Layout
1290+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
1291+ Layout.fillHeight: false
1292+ Layout.fillWidth: false
1293 }
1294
1295 KeypadButton {
1296 objectName: "buttonEight"
1297- width: keysWidth
1298- height: keysHeight
1299+ implicitWidth: keysWidth
1300+ implicitHeight: keysHeight
1301 label: i18n.tr("8")
1302 sublabel: i18n.tr("TUV")
1303 keycode: Qt.Key_8
1304 onPressed: keypad.keyPressed(keycode, "8")
1305 onPressAndHold: keypad.keyPressAndHold(keycode, "8")
1306+ labelFont.pixelSize: keypad.labelPixelSize
1307+
1308+ // Layout
1309+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
1310+ Layout.fillHeight: false
1311+ Layout.fillWidth: false
1312 }
1313
1314 KeypadButton {
1315 objectName: "buttonNine"
1316- width: keysWidth
1317- height: keysHeight
1318+ implicitWidth: keysWidth
1319+ implicitHeight: keysHeight
1320 label: i18n.tr("9")
1321 sublabel: i18n.tr("WXYZ")
1322 keycode: Qt.Key_9
1323 onPressed: keypad.keyPressed(keycode, "9")
1324 onPressAndHold: keypad.keyPressAndHold(keycode, "9")
1325+ labelFont.pixelSize: keypad.labelPixelSize
1326+
1327+ // Layout
1328+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
1329+ Layout.fillHeight: false
1330+ Layout.fillWidth: false
1331 }
1332
1333 KeypadButton {
1334 objectName: "buttonAsterisk"
1335- width: keysWidth
1336- height: keysHeight
1337+ implicitWidth: keysWidth
1338+ implicitHeight: keysHeight
1339 isCorner: true
1340 corner: Qt.BottomLeftCorner
1341 label: i18n.tr("*")
1342 keycode: Qt.Key_Asterisk
1343 onPressed: keypad.keyPressed(keycode, "*")
1344 onPressAndHold: keypad.keyPressAndHold(keycode, "*")
1345+ labelFont.pixelSize: keypad.labelPixelSize
1346+
1347+ // Layout
1348+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
1349+ Layout.fillHeight: false
1350+ Layout.fillWidth: false
1351 }
1352
1353 KeypadButton {
1354 objectName: "buttonZero"
1355- width: keysWidth
1356- height: keysHeight
1357+ implicitWidth: keysWidth
1358+ implicitHeight: keysHeight
1359 label: i18n.tr("0")
1360 sublabel: i18n.tr("+")
1361 sublabelSize: "medium"
1362 keycode: Qt.Key_0
1363 onPressed: keypad.keyPressed(keycode, "0")
1364 onPressAndHold: keypad.keyPressAndHold(keycode, "0")
1365+ labelFont.pixelSize: keypad.labelPixelSize
1366+
1367+ // Layout
1368+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
1369+ Layout.fillHeight: false
1370+ Layout.fillWidth: false
1371 }
1372
1373 KeypadButton {
1374 objectName: "buttonHash"
1375- width: keysWidth
1376- height: keysHeight
1377+ implicitWidth: keysWidth
1378+ implicitHeight: keysHeight
1379 isCorner: true
1380 corner: Qt.BottomRightCorner
1381 label: i18n.tr("#")
1382 keycode: Qt.Key_ssharp
1383 onPressed: keypad.keyPressed(keycode, "#")
1384 onPressAndHold: keypad.keyPressAndHold(keycode, "#")
1385+ labelFont.pixelSize: keypad.labelPixelSize
1386+
1387+ // Layout
1388+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
1389+ Layout.fillHeight: false
1390+ Layout.fillWidth: false
1391 }
1392 }
1393 }
1394
1395=== modified file 'src/qml/DialerPage/KeypadButton.qml'
1396--- src/qml/DialerPage/KeypadButton.qml 2016-08-25 06:54:07 +0000
1397+++ src/qml/DialerPage/KeypadButton.qml 2017-04-05 17:09:12 +0000
1398@@ -16,19 +16,17 @@
1399 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1400 */
1401
1402-import QtQuick 2.0
1403+import QtQuick 2.4
1404 import Ubuntu.Components 1.3
1405
1406 MouseArea {
1407 id: button
1408
1409- width: units.gu(11.33)
1410- height: units.gu(7)
1411-
1412 property alias label: labelItem.text
1413 property alias sublabel: sublabelItem.text
1414 property alias sublabelSize: sublabelItem.fontSize
1415 property alias iconSource: subImage.name
1416+ property alias labelFont: labelItem.font
1417 property int keycode
1418 property bool isCorner: false
1419 property int corner
1420@@ -47,9 +45,7 @@
1421
1422 Item {
1423 objectName: "keypadButtonLabelsContainer"
1424- height: childrenRect.height
1425- width: parent.width
1426- anchors.centerIn: parent
1427+ anchors.fill: parent
1428 scale: button.pressed ? 0.9 : 1
1429
1430 Behavior on scale {
1431@@ -61,23 +57,25 @@
1432 Label {
1433 id: labelItem
1434
1435- anchors.top: parent.top
1436- anchors.horizontalCenter: parent.horizontalCenter
1437- anchors.verticalCenterOffset: -units.gu(0.5)
1438- horizontalAlignment: Text.AlignHCenter
1439- height: paintedHeight
1440+ anchors {
1441+ horizontalCenter: parent.horizontalCenter
1442+ verticalCenter: parent.verticalCenter
1443+ verticalCenterOffset: -units.gu(0.5)
1444+ }
1445+
1446 font.pixelSize: units.dp(30)
1447- verticalAlignment: Text.AlignTop
1448 color: UbuntuColors.darkGrey
1449 }
1450
1451 Label {
1452 id: sublabelItem
1453
1454- anchors.top: labelItem.bottom
1455- anchors.topMargin: units.dp(1.5)
1456- anchors.horizontalCenter: parent.horizontalCenter
1457- horizontalAlignment: Text.AlignHCenter
1458+ anchors {
1459+ top: labelItem.bottom
1460+ topMargin: units.dp(1.5)
1461+ horizontalCenter: labelItem.horizontalCenter
1462+ }
1463+
1464 fontSize: "x-small"
1465 color: UbuntuColors.darkGrey
1466 }
1467@@ -85,9 +83,11 @@
1468 Icon {
1469 id: subImage
1470 visible: name != ""
1471- anchors.top: labelItem.bottom
1472- anchors.horizontalCenter: parent.horizontalCenter
1473- anchors.topMargin: units.dp(1.5)
1474+ anchors {
1475+ top: labelItem.bottom
1476+ horizontalCenter: labelItem.horizontalCenter
1477+ topMargin: units.dp(1.5)
1478+ }
1479 opacity: 0.8
1480 width: units.gu(2)
1481 height: units.gu(2)
1482
1483=== modified file 'src/qml/DialerPage/KeypadEntry.qml'
1484--- src/qml/DialerPage/KeypadEntry.qml 2016-08-24 17:52:19 +0000
1485+++ src/qml/DialerPage/KeypadEntry.qml 2017-04-05 17:09:12 +0000
1486@@ -16,7 +16,7 @@
1487 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1488 */
1489
1490-import QtQuick 2.0
1491+import QtQuick 2.4
1492 import Ubuntu.Components 1.3
1493 import Ubuntu.Components.ListItems 1.3 as ListItems
1494 import Ubuntu.Components.Themes.Ambiance 1.3
1495@@ -30,19 +30,47 @@
1496 property alias input: input
1497 property alias placeHolder: hint.text
1498 property alias placeHolderPixelFontSize: hint.font.pixelSize
1499+ property double maximumFontSize: units.dp(30)
1500+
1501 // this is used by tests. do not remove it
1502 property alias selectedText: input.selectedText
1503
1504+ signal commitRequested()
1505+
1506+ function handleKeyEvent(key, text) {
1507+ if (input.length == 0) {
1508+ return
1509+ }
1510+
1511+ switch (key) {
1512+ case Qt.Key_Backspace:
1513+ input.remove(input.cursorPosition-1, input.cursorPosition)
1514+ break
1515+ case Qt.Key_Delete:
1516+ input.remove(input.cursorPosition, input.cursorPosition+1)
1517+ break
1518+ case Qt.Key_Left:
1519+ input.cursorPosition--
1520+ break
1521+ case Qt.Key_Right:
1522+ input.cursorPosition++
1523+ break
1524+ case Qt.Key_Enter:
1525+ case Qt.Key_Return:
1526+ keypadEntry.commitRequested()
1527+ break
1528+ }
1529+ }
1530+
1531 onValueChanged: input.deselect()
1532+ onMaximumFontSizeChanged: input.adjustTextSize()
1533
1534 PhoneNumberField {
1535 id: input
1536
1537 property bool __adjusting: false
1538- readonly property double maximumFontSize: units.dp(30)
1539 readonly property double minimumFontSize: FontUtils.sizeToPixels("large")
1540
1541-
1542 style: TextFieldStyle {
1543 background: null
1544 frameSpacing: 0
1545@@ -58,7 +86,7 @@
1546 __adjusting = true;
1547
1548 // start by resetting the font size to discover the scale that should be used
1549- font.pixelSize = maximumFontSize
1550+ font.pixelSize = keypadEntry.maximumFontSize
1551
1552 // check if it really needs to be scaled
1553 if (contentWidth > width) {
1554@@ -76,7 +104,6 @@
1555 verticalCenter: parent.verticalCenter
1556 }
1557 horizontalAlignment: (text.length < 19 ? TextInput.AlignHCenter : TextInput.AlignRight)
1558- font.pixelSize: maximumFontSize
1559 font.family: "Ubuntu"
1560 color: UbuntuColors.darkGrey
1561 focus: false
1562@@ -108,6 +135,7 @@
1563 target: units
1564 onGridUnitChanged: input.adjustTextSize()
1565 }
1566+ Component.onCompleted: input.adjustTextSize()
1567 }
1568
1569 MouseArea {
1570@@ -132,7 +160,7 @@
1571 }
1572
1573 text: ""
1574- font.pixelSize: input.maximumFontSize
1575+ font.pixelSize: input.font.pixelSize
1576 fontSizeMode: Text.HorizontalFit
1577 color: UbuntuColors.darkGrey
1578 opacity: 0.9
1579
1580=== modified file 'src/qml/Dialogs/DisableFlightModeDialog.qml'
1581--- src/qml/Dialogs/DisableFlightModeDialog.qml 2016-08-25 16:01:46 +0000
1582+++ src/qml/Dialogs/DisableFlightModeDialog.qml 2017-04-05 17:09:12 +0000
1583@@ -16,7 +16,7 @@
1584 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1585 */
1586
1587-import QtQuick 2.0
1588+import QtQuick 2.4
1589 import Ubuntu.Components 1.3
1590 import Ubuntu.Components.Popups 1.3
1591 import Ubuntu.Telephony 0.1
1592
1593=== modified file 'src/qml/Dialogs/FlightModeProgressDialog.qml'
1594--- src/qml/Dialogs/FlightModeProgressDialog.qml 2016-08-24 17:52:19 +0000
1595+++ src/qml/Dialogs/FlightModeProgressDialog.qml 2017-04-05 17:09:12 +0000
1596@@ -16,7 +16,7 @@
1597 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1598 */
1599
1600-import QtQuick 2.0
1601+import QtQuick 2.4
1602
1603 import Ubuntu.Components 1.3
1604 import Ubuntu.Components.Popups 1.3
1605
1606=== modified file 'src/qml/Dialogs/NoDefaultSIMCardDialog.qml'
1607--- src/qml/Dialogs/NoDefaultSIMCardDialog.qml 2016-10-19 11:45:45 +0000
1608+++ src/qml/Dialogs/NoDefaultSIMCardDialog.qml 2017-04-05 17:09:12 +0000
1609@@ -16,7 +16,7 @@
1610 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1611 */
1612
1613-import QtQuick 2.0
1614+import QtQuick 2.4
1615 import Ubuntu.Components 1.3
1616 import Ubuntu.Components.Popups 1.3
1617 import Ubuntu.Telephony 0.1
1618
1619=== modified file 'src/qml/Dialogs/NotificationDialog.qml'
1620--- src/qml/Dialogs/NotificationDialog.qml 2015-09-07 15:40:45 +0000
1621+++ src/qml/Dialogs/NotificationDialog.qml 2017-04-05 17:09:12 +0000
1622@@ -16,7 +16,7 @@
1623 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1624 */
1625
1626-import QtQuick 2.0
1627+import QtQuick 2.4
1628 import Ubuntu.Components 1.3
1629 import Ubuntu.Components.Popups 1.3
1630
1631
1632=== modified file 'src/qml/Dialogs/SetDefaultSIMCardDialog.qml'
1633--- src/qml/Dialogs/SetDefaultSIMCardDialog.qml 2016-10-01 00:29:13 +0000
1634+++ src/qml/Dialogs/SetDefaultSIMCardDialog.qml 2017-04-05 17:09:12 +0000
1635@@ -16,7 +16,7 @@
1636 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1637 */
1638
1639-import QtQuick 2.0
1640+import QtQuick 2.4
1641 import Ubuntu.Components 1.3
1642 import Ubuntu.Components.Popups 1.3
1643 import Ubuntu.Telephony 0.1
1644
1645=== modified file 'src/qml/Dialogs/SimLockedDialog.qml'
1646--- src/qml/Dialogs/SimLockedDialog.qml 2016-04-29 21:29:29 +0000
1647+++ src/qml/Dialogs/SimLockedDialog.qml 2017-04-05 17:09:12 +0000
1648@@ -16,7 +16,7 @@
1649 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1650 */
1651
1652-import QtQuick 2.0
1653+import QtQuick 2.4
1654 import Ubuntu.Components 1.3
1655 import Ubuntu.Components.Popups 1.3
1656
1657
1658=== modified file 'src/qml/Dialogs/UssdErrorDialog.qml'
1659--- src/qml/Dialogs/UssdErrorDialog.qml 2016-08-24 17:52:19 +0000
1660+++ src/qml/Dialogs/UssdErrorDialog.qml 2017-04-05 17:09:12 +0000
1661@@ -16,7 +16,7 @@
1662 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1663 */
1664
1665-import QtQuick 2.0
1666+import QtQuick 2.4
1667
1668 import Ubuntu.Components 1.3
1669 import Ubuntu.Components.Popups 1.3
1670
1671=== modified file 'src/qml/Dialogs/UssdProgressDialog.qml'
1672--- src/qml/Dialogs/UssdProgressDialog.qml 2016-08-24 17:52:19 +0000
1673+++ src/qml/Dialogs/UssdProgressDialog.qml 2017-04-05 17:09:12 +0000
1674@@ -16,7 +16,7 @@
1675 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1676 */
1677
1678-import QtQuick 2.0
1679+import QtQuick 2.4
1680
1681 import Ubuntu.Components 1.3
1682 import Ubuntu.Components.Popups 1.3
1683
1684=== modified file 'src/qml/Dialogs/UssdResponseDialog.qml'
1685--- src/qml/Dialogs/UssdResponseDialog.qml 2016-08-24 17:52:19 +0000
1686+++ src/qml/Dialogs/UssdResponseDialog.qml 2017-04-05 17:09:12 +0000
1687@@ -16,7 +16,7 @@
1688 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1689 */
1690
1691-import QtQuick 2.0
1692+import QtQuick 2.4
1693
1694 import Ubuntu.Components 1.3
1695 import Ubuntu.Components.Popups 1.3
1696
1697=== modified file 'src/qml/HistoryPage/ExpandableButton.qml'
1698--- src/qml/HistoryPage/ExpandableButton.qml 2016-08-24 17:50:38 +0000
1699+++ src/qml/HistoryPage/ExpandableButton.qml 2017-04-05 17:09:12 +0000
1700@@ -14,7 +14,7 @@
1701 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1702 */
1703
1704-import QtQuick 2.0
1705+import QtQuick 2.4
1706 import Ubuntu.Components 1.3
1707 import Ubuntu.Components.ListItems 1.3 as ListItem
1708
1709
1710=== modified file 'src/qml/HistoryPage/HistoryDelegate.qml'
1711--- src/qml/HistoryPage/HistoryDelegate.qml 2016-07-27 16:18:56 +0000
1712+++ src/qml/HistoryPage/HistoryDelegate.qml 2017-04-05 17:09:12 +0000
1713@@ -16,7 +16,7 @@
1714 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1715 */
1716
1717-import QtQuick 2.0
1718+import QtQuick 2.4
1719 import Ubuntu.Components 1.3
1720 import Ubuntu.Components.ListItems 1.3 as ListItem
1721 import Ubuntu.Components.Popups 1.3
1722
1723=== modified file 'src/qml/HistoryPage/HistoryDetailsPage.qml'
1724--- src/qml/HistoryPage/HistoryDetailsPage.qml 2016-10-19 11:45:45 +0000
1725+++ src/qml/HistoryPage/HistoryDetailsPage.qml 2017-04-05 17:09:12 +0000
1726@@ -16,7 +16,7 @@
1727 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1728 */
1729
1730-import QtQuick 2.0
1731+import QtQuick 2.4
1732 import Ubuntu.Components 1.3
1733 import Ubuntu.Components.ListItems 1.3 as ListItem
1734 import Ubuntu.Telephony 0.1
1735
1736=== modified file 'src/qml/HistoryPage/HistoryPage.qml'
1737--- src/qml/HistoryPage/HistoryPage.qml 2016-07-27 16:18:56 +0000
1738+++ src/qml/HistoryPage/HistoryPage.qml 2017-04-05 17:09:12 +0000
1739@@ -16,7 +16,7 @@
1740 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1741 */
1742
1743-import QtQuick 2.0
1744+import QtQuick 2.4
1745 import Ubuntu.Components 1.3
1746 import Ubuntu.Components.ListItems 1.3 as ListItem
1747 import Ubuntu.History 0.1
1748@@ -147,8 +147,17 @@
1749 }
1750 }
1751
1752- HistoryFilter {
1753+ // FIXME: this is a workaround to force the model perform the query
1754+ HistoryUnionFilter {
1755 id: emptyFilter
1756+ HistoryFilter {
1757+ filterProperty: "missed"
1758+ filterValue: true
1759+ }
1760+ HistoryFilter {
1761+ filterProperty: "missed"
1762+ filterValue: false
1763+ }
1764 }
1765
1766 HistoryFilter {
1767
1768=== modified file 'src/qml/HistoryPage/SwipeItemDemo.qml'
1769--- src/qml/HistoryPage/SwipeItemDemo.qml 2016-02-11 17:58:29 +0000
1770+++ src/qml/HistoryPage/SwipeItemDemo.qml 2017-04-05 17:09:12 +0000
1771@@ -16,7 +16,7 @@
1772 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1773 */
1774
1775-import QtQuick 2.0
1776+import QtQuick 2.4
1777 import QtQuick.Layouts 1.1
1778 import Qt.labs.settings 1.0
1779
1780
1781=== modified file 'src/qml/InputInfo.qml'
1782--- src/qml/InputInfo.qml 2016-03-08 02:27:36 +0000
1783+++ src/qml/InputInfo.qml 2017-04-05 17:09:12 +0000
1784@@ -16,7 +16,7 @@
1785 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1786 */
1787
1788-import QtQuick 2.0
1789+import QtQuick 2.4
1790 import QtSystemInfo 5.5
1791
1792 Item {
1793
1794=== modified file 'src/qml/LiveCallPage/ConferenceCallDisplay.qml'
1795--- src/qml/LiveCallPage/ConferenceCallDisplay.qml 2016-08-24 17:50:38 +0000
1796+++ src/qml/LiveCallPage/ConferenceCallDisplay.qml 2017-04-05 17:09:12 +0000
1797@@ -16,7 +16,7 @@
1798 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1799 */
1800
1801-import QtQuick 2.0
1802+import QtQuick 2.4
1803 import Ubuntu.Components 1.3
1804 import Ubuntu.Components.ListItems 1.3 as ListItem
1805 import Ubuntu.Telephony 0.1
1806
1807=== modified file 'src/qml/LiveCallPage/HangupButton.qml'
1808--- src/qml/LiveCallPage/HangupButton.qml 2016-08-24 17:50:38 +0000
1809+++ src/qml/LiveCallPage/HangupButton.qml 2017-04-05 17:09:12 +0000
1810@@ -16,7 +16,7 @@
1811 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1812 */
1813
1814-import QtQuick 2.0
1815+import QtQuick 2.4
1816 import Ubuntu.Components 1.3
1817
1818 AbstractButton {
1819
1820=== modified file 'src/qml/LiveCallPage/LiveCall.qml'
1821--- src/qml/LiveCallPage/LiveCall.qml 2016-03-08 02:10:46 +0000
1822+++ src/qml/LiveCallPage/LiveCall.qml 2017-04-05 17:09:12 +0000
1823@@ -16,7 +16,7 @@
1824 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1825 */
1826
1827-import QtQuick 2.0
1828+import QtQuick 2.4
1829 import Ubuntu.Components 1.3
1830 import Ubuntu.Components.ListItems 1.3 as ListItems
1831 import Ubuntu.Components.Popups 1.3
1832@@ -30,6 +30,8 @@
1833 id: liveCall
1834 objectName: "pageLiveCall"
1835
1836+ readonly property bool compactView: liveCall.height <= units.gu(60)
1837+
1838 property var call: callManager.foregroundCall
1839 property var calls: callManager.calls
1840 property string dtmfEntry: ""
1841@@ -50,8 +52,8 @@
1842 return i18n.tr("Conference");
1843 } else if (contactWatcher.alias !== "") {
1844 return contactWatcher.alias;
1845- } else if (contactWatcher.identifier !== "") {
1846- return contactWatcher.identifier;
1847+ } else if (call && call.phoneNumber !== "") {
1848+ return call.phoneNumber;
1849 } else if (!call && initialNumber != "") {
1850 return initialNumber
1851 } else {
1852@@ -90,6 +92,14 @@
1853 extension: multiplePhoneAccounts ? headerSections : null
1854 }
1855
1856+ Keys.onPressed: {
1857+ if (!dtmfVisible) {
1858+ dtmfVisible = true
1859+ }
1860+
1861+ keypad.keyPressed(event.key, event.text)
1862+ }
1863+
1864 function reportStatus(callObject, text) {
1865 // if a previous status was already set, do not overwrite it
1866 if (statusLabel.text !== "" || callManager.hasCalls) {
1867@@ -140,7 +150,7 @@
1868 callObject["active"] = true;
1869 callObject["voicemail"] = call.voicemail;
1870 callObject["account"] = call.account;
1871- callObject["phoneNumber"] = call.phoneNumber;
1872+ callObject["phoneNumber"] = contactWatcher.identifier;
1873 callObject["held"] = call.held;
1874 callObject["muted"] = call.muted;
1875 callObject["activeAudioOutput"] = call.activeAudioOutput;
1876@@ -282,6 +292,7 @@
1877
1878 Component.onCompleted: {
1879 callManager.callIndicatorVisible = !active && callManager.hasCalls;
1880+ forceActiveFocus();
1881 }
1882
1883 Timer {
1884@@ -381,7 +392,15 @@
1885 ContactWatcher {
1886 id: contactWatcher
1887 // FIXME: handle conf calls
1888- identifier: call ? call.phoneNumber : ""
1889+ identifier: {
1890+ if (initialNumber != "") {
1891+ return initialNumber
1892+ } else if (call) {
1893+ return call.phoneNumber
1894+ }
1895+ return ""
1896+ }
1897+
1898 onDetailPropertiesChanged: helper.updateSubTypeLabel()
1899 onIsUnknownChanged: helper.updateSubTypeLabel()
1900 // FIXME: if we implement VOIP, get the addressable fields from the account itself
1901@@ -444,20 +463,26 @@
1902 horizontalAlignment: Qt.AlignHCenter
1903 width: units.gu(11)
1904 text: {
1905+ var duration = ""
1906 if (dtmfVisible && dtmfLabelHelper.text !== "") {
1907- return dtmfLabelHelper.text;
1908+ duration = dtmfLabelHelper.text;
1909 } else if (call && call.active) {
1910 // TRANSLATORS: %1 is the call duration here.
1911- return call.held ? i18n.tr("%1 - on hold").arg(stopWatch.elapsed) : stopWatch.elapsed;
1912+ duration = call.held ? i18n.tr("%1 - on hold").arg(stopWatch.elapsed) : stopWatch.elapsed;
1913 } else if (call && !call.incoming) {
1914- return i18n.tr("Calling")
1915+ duration = i18n.tr("Calling")
1916 } else if (!call && initialStatus !== "") {
1917- return initialStatus
1918+ duration = initialStatus
1919 } else {
1920- return " "
1921+ duration = " "
1922 }
1923+
1924+ if (liveCall.compactView)
1925+ return "%1 (%2)".arg(duration).arg(caller)
1926+ else
1927+ return duration
1928 }
1929- fontSize: "x-large"
1930+ fontSize: liveCall.compactView ? "large" : "x-large"
1931 }
1932
1933 Label {
1934@@ -469,8 +494,11 @@
1935 horizontalCenter: parent.horizontalCenter
1936 }
1937 text: caller
1938- fontSize: "large"
1939 color: UbuntuColors.darkGrey
1940+
1941+ fontSize:"large"
1942+ visible: !liveCall.compactView
1943+ height: visible ? implicitHeight : 0
1944 }
1945
1946 MultiCallDisplay {
1947@@ -490,7 +518,7 @@
1948 left: parent.left
1949 right: parent.right
1950 top: callerLabel.bottom
1951- topMargin: units.gu(2)
1952+ topMargin: liveCall.compactView ? units.gu(0.5) : units.gu(2)
1953 }
1954 }
1955
1956@@ -500,7 +528,9 @@
1957 anchors {
1958 top: divider.bottom
1959 topMargin: units.gu(2)
1960- horizontalCenter: parent.horizontalCenter
1961+ left: parent.left
1962+ right: parent.right
1963+ bottom: parent.bottom
1964 }
1965 onKeyPressed: {
1966 if (call) {
1967@@ -511,8 +541,8 @@
1968
1969 visible: opacity > 0.0
1970 opacity: 0.0
1971- keysWidth: units.gu(11)
1972- keysHeight: units.gu(7)
1973+ labelPixelSize: liveCall.compactView ? units.dp(20) : units.dp(30)
1974+ spacing: liveCall.compactView ? 0 : 5
1975 }
1976 }
1977
1978@@ -571,7 +601,7 @@
1979
1980 anchors {
1981 horizontalCenter: parent.horizontalCenter
1982- bottom: footer.top
1983+ bottom: hangupButton.top
1984 bottomMargin: units.gu(1)
1985 }
1986
1987@@ -617,6 +647,7 @@
1988 }
1989 }
1990 }
1991+ enabled: audioOutputs.length > 1
1992 }
1993
1994 LiveCallKeypadButton {
1995@@ -675,25 +706,15 @@
1996 }
1997 }
1998
1999- Item {
2000- id: footer
2001- height: units.gu(10)
2002+ HangupButton {
2003+ id: hangupButton
2004+ objectName: "hangupButton"
2005+
2006 anchors {
2007+ horizontalCenter: parent.horizontalCenter
2008 bottom: parent.bottom
2009- left: parent.left
2010- right: parent.right
2011- }
2012-
2013- HangupButton {
2014- id: hangupButton
2015- objectName: "hangupButton"
2016-
2017- anchors {
2018- horizontalCenter: parent.horizontalCenter
2019- bottom: parent.bottom
2020- bottomMargin: units.gu(5)
2021- }
2022- onClicked: endCall()
2023- }
2024+ bottomMargin: liveCall.compactView ? units.gu(1) : units.gu(5)
2025+ }
2026+ onClicked: endCall()
2027 }
2028 }
2029
2030=== modified file 'src/qml/LiveCallPage/LiveCallKeypadButton.qml'
2031--- src/qml/LiveCallPage/LiveCallKeypadButton.qml 2016-08-24 17:50:38 +0000
2032+++ src/qml/LiveCallPage/LiveCallKeypadButton.qml 2017-04-05 17:09:12 +0000
2033@@ -16,7 +16,7 @@
2034 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2035 */
2036
2037-import QtQuick 2.0
2038+import QtQuick 2.4
2039 import Ubuntu.Components 1.3
2040
2041 AbstractButton {
2042
2043=== modified file 'src/qml/LiveCallPage/MultiCallDisplay.qml'
2044--- src/qml/LiveCallPage/MultiCallDisplay.qml 2015-09-07 15:40:45 +0000
2045+++ src/qml/LiveCallPage/MultiCallDisplay.qml 2017-04-05 17:09:12 +0000
2046@@ -16,7 +16,7 @@
2047 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2048 */
2049
2050-import QtQuick 2.0
2051+import QtQuick 2.4
2052 import Ubuntu.Components 1.3
2053 import Ubuntu.Components.ListItems 1.3 as ListItems
2054 import Ubuntu.Contacts 0.1
2055
2056=== modified file 'src/qml/LiveCallPage/StopWatch.qml'
2057--- src/qml/LiveCallPage/StopWatch.qml 2015-09-07 15:40:45 +0000
2058+++ src/qml/LiveCallPage/StopWatch.qml 2017-04-05 17:09:12 +0000
2059@@ -16,7 +16,7 @@
2060 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2061 */
2062
2063-import QtQuick 2.0
2064+import QtQuick 2.4
2065 import Ubuntu.Components 1.3
2066
2067 Item {
2068
2069=== modified file 'src/qml/MMI/IMEI.qml'
2070--- src/qml/MMI/IMEI.qml 2016-08-24 17:52:19 +0000
2071+++ src/qml/MMI/IMEI.qml 2017-04-05 17:09:12 +0000
2072@@ -16,7 +16,7 @@
2073 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2074 */
2075
2076-import QtQuick 2.0
2077+import QtQuick 2.4
2078 import Ubuntu.Components 1.3
2079 import Ubuntu.Components.Popups 1.3
2080
2081
2082=== modified file 'src/qml/MMI/IMEIDialog.qml'
2083--- src/qml/MMI/IMEIDialog.qml 2016-10-18 09:28:54 +0000
2084+++ src/qml/MMI/IMEIDialog.qml 2017-04-05 17:09:12 +0000
2085@@ -16,7 +16,7 @@
2086 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2087 */
2088
2089-import QtQuick 2.0
2090+import QtQuick 2.4
2091 import Ubuntu.Telephony 0.1
2092 import Ubuntu.Components 1.3
2093 import Ubuntu.Components.Popups 1.3
2094
2095=== added directory 'src/qml/SettingsPage'
2096=== added directory 'src/qml/SettingsPage/AccountSettings'
2097=== added file 'src/qml/SettingsPage/AccountSettings/CMakeLists.txt'
2098--- src/qml/SettingsPage/AccountSettings/CMakeLists.txt 1970-01-01 00:00:00 +0000
2099+++ src/qml/SettingsPage/AccountSettings/CMakeLists.txt 2017-04-05 17:09:12 +0000
2100@@ -0,0 +1,6 @@
2101+file(GLOB ACCOUNT_SETTINGS_QML_JS_FILES *.qml *.js)
2102+
2103+# make the files visible on qtcreator
2104+add_custom_target(dialer__account_settings_QMlFiles ALL SOURCES ${ACCOUNT_SETTINGS_QML_JS_FILES})
2105+
2106+install(FILES ${ACCOUNT_SETTINGS_QML_JS_FILES} DESTINATION ${DIALER_APP_DIR}/SettingsPage/AccountSettings)
2107
2108=== added file 'src/qml/SettingsPage/AccountSettings/SipNumberRewrite.qml'
2109--- src/qml/SettingsPage/AccountSettings/SipNumberRewrite.qml 1970-01-01 00:00:00 +0000
2110+++ src/qml/SettingsPage/AccountSettings/SipNumberRewrite.qml 2017-04-05 17:09:12 +0000
2111@@ -0,0 +1,177 @@
2112+/*
2113+ * This file is part of dialer-app
2114+ *
2115+ * Copyright (C) 2017 Canonical Ltd.
2116+ *
2117+ * Authors: Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
2118+ *
2119+ * This program is free software: you can redistribute it and/or modify it
2120+ * under the terms of the GNU General Public License version 3, as published
2121+ * by the Free Software Foundation.
2122+ *
2123+ * This program is distributed in the hope that it will be useful, but
2124+ * WITHOUT ANY WARRANTY; without even the implied warranties of
2125+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
2126+ * PURPOSE. See the GNU General Public License for more details.
2127+ *
2128+ * You should have received a copy of the GNU General Public License along
2129+ * with this program. If not, see <http://www.gnu.org/licenses/>.
2130+ */
2131+
2132+import QtQuick 2.4
2133+import Ubuntu.Components 1.3
2134+import Ubuntu.Components.ListItems 1.3 as ListItems
2135+import Ubuntu.Components.Themes.Ambiance 0.1
2136+import "../"
2137+
2138+Page {
2139+ id: page
2140+ // TRANSLATORS: %1 is the displayname of the account
2141+ title: i18n.tr("%1 Number Rewrite").arg(account.displayName)
2142+ header: PageHeader {
2143+ title: page.title
2144+ flickable: contentFlickable
2145+ }
2146+
2147+ property var account: null
2148+ property bool updating: false
2149+ onAccountChanged: {
2150+ if (!account) {
2151+ return
2152+ }
2153+
2154+
2155+ var props = account.accountProperties
2156+ for (var i in props) {
2157+ console.log(i + ": " + props[i])
2158+ console.log(props.defaultAreaCode)
2159+ }
2160+
2161+ updating = true
2162+ numberRewriteSwitch.checked = props.numberRewrite ? props.numberRewrite : false
2163+ countryCodeField.text = props.defaultCountryCode ? props.defaultCountryCode : ""
2164+ areaCodeField.text = props.defaultAreaCode ? props.defaultAreaCode : ""
2165+ removeInputField.text = props.removeCharacters ? props.removeCharacters : ""
2166+ prefixInputField.text = props.prefix ? props.prefix : ""
2167+ updating = false
2168+ }
2169+
2170+ function setAccountProperty(prop, value) {
2171+ if (updating) {
2172+ return
2173+ }
2174+
2175+ var properties = account.accountProperties
2176+ properties[prop] = value
2177+ account.accountProperties = properties
2178+ }
2179+
2180+ Flickable {
2181+ id: contentFlickable
2182+ anchors.fill: parent
2183+ Column {
2184+ height: childrenRect.height
2185+ spacing: units.gu(1)
2186+ anchors {
2187+ left: parent.left
2188+ right: parent.right
2189+ }
2190+
2191+ ListItems.Standard {
2192+ control: Switch {
2193+ id: numberRewriteSwitch
2194+ objectName: "numberRewriteSwitch"
2195+ onCheckedChanged: {
2196+ setAccountProperty("numberRewrite", checked)
2197+ }
2198+ }
2199+ text: i18n.tr("Number rewrite")
2200+ showDivider: !numberRewriteSwitch.checked
2201+ }
2202+
2203+ ListItems.Standard {
2204+ id: countryCodeItem
2205+ height: visible ? units.gu(6) : 0
2206+ visible: numberRewriteSwitch.checked
2207+ text: i18n.tr("Default country code")
2208+ control: SettingsTextField {
2209+ id: countryCodeField
2210+ objectName: "countryCodeField"
2211+ placeholderText: i18n.tr("Enter a country code")
2212+ onTextChanged: {
2213+ setAccountProperty("defaultCountryCode", text)
2214+ }
2215+ }
2216+ Behavior on height {
2217+ NumberAnimation {
2218+ duration: UbuntuAnimation.SnapDuration
2219+ }
2220+ }
2221+ }
2222+
2223+ ListItems.Standard {
2224+ id: areaCodeItem
2225+ height: visible ? units.gu(6) : 0
2226+ // FIXME: re-enable the area code when we get libphonenumber detection fixed
2227+ //visible: numberRewriteSwitch.checked
2228+ visible: false
2229+ text: i18n.tr("Default area code")
2230+ control: SettingsTextField {
2231+ id: areaCodeField
2232+ objectName: "areaCodeField"
2233+ placeholderText: i18n.tr("Enter an area code")
2234+ onTextChanged: {
2235+ setAccountProperty("defaultAreaCode", text)
2236+ }
2237+ }
2238+ Behavior on height {
2239+ NumberAnimation {
2240+ duration: UbuntuAnimation.SnapDuration
2241+ }
2242+ }
2243+ }
2244+
2245+ ListItems.Standard {
2246+ id: removeInput
2247+ visible: numberRewriteSwitch.checked
2248+ height: visible ? units.gu(6) : 0
2249+ text: i18n.tr("Characters to remove")
2250+ control: SettingsTextField {
2251+ id: removeInputField
2252+ objectName: "removeInputField"
2253+ placeholderText: i18n.tr("Enter the characters to remove")
2254+ onTextChanged: {
2255+ setAccountProperty("removeCharacters", text)
2256+ }
2257+ }
2258+
2259+ Behavior on height {
2260+ NumberAnimation {
2261+ duration: UbuntuAnimation.SnapDuration
2262+ }
2263+ }
2264+ }
2265+
2266+ ListItems.Standard {
2267+ id: prefixInput
2268+ visible: numberRewriteSwitch.checked
2269+ height: visible ? units.gu(6) : 0
2270+ text: i18n.tr("Prefix")
2271+ control: SettingsTextField {
2272+ id: prefixInputField
2273+ objectName: "prefixInputField"
2274+ placeholderText: i18n.tr("Enter a prefix")
2275+ onTextChanged: {
2276+ setAccountProperty("prefix", text)
2277+ }
2278+ }
2279+
2280+ Behavior on height {
2281+ NumberAnimation {
2282+ duration: UbuntuAnimation.SnapDuration
2283+ }
2284+ }
2285+ }
2286+ }
2287+ }
2288+}
2289
2290=== added file 'src/qml/SettingsPage/AccountSettings/sip.qml'
2291--- src/qml/SettingsPage/AccountSettings/sip.qml 1970-01-01 00:00:00 +0000
2292+++ src/qml/SettingsPage/AccountSettings/sip.qml 2017-04-05 17:09:12 +0000
2293@@ -0,0 +1,30 @@
2294+/*
2295+ * This file is part of dialer-app
2296+ *
2297+ * Copyright (C) 2017 Canonical Ltd.
2298+ *
2299+ * Authors: Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
2300+ *
2301+ * This program is free software: you can redistribute it and/or modify it
2302+ * under the terms of the GNU General Public License version 3, as published
2303+ * by the Free Software Foundation.
2304+ *
2305+ * This program is distributed in the hope that it will be useful, but
2306+ * WITHOUT ANY WARRANTY; without even the implied warranties of
2307+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
2308+ * PURPOSE. See the GNU General Public License for more details.
2309+ *
2310+ * You should have received a copy of the GNU General Public License along
2311+ * with this program. If not, see <http://www.gnu.org/licenses/>.
2312+ */
2313+
2314+import Ubuntu.Components 1.3
2315+import Ubuntu.Components.ListItems 1.3 as ListItems
2316+
2317+ListItems.SingleValue {
2318+ property var account: null
2319+ text: i18n.tr("%1 Number Rewrite").arg(account.displayName)
2320+ progression: true
2321+ value: account.accountProperties.numberRewrite ? i18n.tr("On") : i18n.tr("Off")
2322+ onClicked: pageStackNormalMode.push(Qt.resolvedUrl("SipNumberRewrite.qml"), { "account": account })
2323+}
2324
2325=== added file 'src/qml/SettingsPage/CMakeLists.txt'
2326--- src/qml/SettingsPage/CMakeLists.txt 1970-01-01 00:00:00 +0000
2327+++ src/qml/SettingsPage/CMakeLists.txt 2017-04-05 17:09:12 +0000
2328@@ -0,0 +1,8 @@
2329+file(GLOB SETTINGS_QML_JS_FILES *.qml *.js)
2330+
2331+# make the files visible on qtcreator
2332+add_custom_target(dialer_settings_QMlFiles ALL SOURCES ${SETTINGS_QML_JS_FILES})
2333+
2334+install(FILES ${SETTINGS_QML_JS_FILES} DESTINATION ${DIALER_APP_DIR}/SettingsPage)
2335+
2336+add_subdirectory(AccountSettings)
2337
2338=== added file 'src/qml/SettingsPage/CallForwardItem.qml'
2339--- src/qml/SettingsPage/CallForwardItem.qml 1970-01-01 00:00:00 +0000
2340+++ src/qml/SettingsPage/CallForwardItem.qml 2017-04-05 17:09:12 +0000
2341@@ -0,0 +1,240 @@
2342+/*
2343+ * This file is part of dialer-app
2344+ *
2345+ * Copyright (C) 2015-2017 Canonical Ltd.
2346+ *
2347+ * Contact: Jonas G. Drange <jonas.drange@canonical.com>
2348+ *
2349+ * This program is free software: you can redistribute it and/or modify it
2350+ * under the terms of the GNU General Public License version 3, as published
2351+ * by the Free Software Foundation.
2352+ *
2353+ * This program is distributed in the hope that it will be useful, but
2354+ * WITHOUT ANY WARRANTY; without even the implied warranties of
2355+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
2356+ * PURPOSE. See the GNU General Public License for more details.
2357+ *
2358+ * You should have received a copy of the GNU General Public License along
2359+ * with this program. If not, see <http://www.gnu.org/licenses/>.
2360+ */
2361+
2362+import QtQuick 2.4
2363+import Ubuntu.Components 1.3
2364+import Ubuntu.Components.ListItems 1.3 as ListItem
2365+import Ubuntu.Components.Themes.Ambiance 0.1
2366+import MeeGo.QOfono 0.2
2367+import "callForwardingUtils.js" as Utils
2368+
2369+Column {
2370+ id: item
2371+
2372+ property OfonoCallForwarding callForwarding
2373+ property bool enabled: true
2374+ property string rule
2375+
2376+ property alias checked: check.checked
2377+ property alias busy: d._pending
2378+ property alias text: control.text
2379+ property alias value: current.value
2380+ property alias field: field
2381+
2382+ signal checked ()
2383+ signal failed ()
2384+ signal enteredEditMode ()
2385+ signal leftEditMode ()
2386+
2387+ /**
2388+ * Saves the rule.
2389+ */
2390+ function save () {
2391+ d._pending = true;
2392+ if (!Utils.requestRule(field.text)) {
2393+ d._pending = false;
2394+ d._editing = false;
2395+ checked: callForwarding[rule] !== "";
2396+ }
2397+ }
2398+
2399+ /**
2400+ * Cancels editing the rule.
2401+ */
2402+ function cancel () {
2403+ d._editing = false;
2404+ check.checked = callForwarding[rule] !== "";
2405+ }
2406+
2407+ /**
2408+ * Private object that keeps track of state of the UI.
2409+ */
2410+ QtObject {
2411+ id: d
2412+
2413+ /**
2414+ * Server is working.
2415+ */
2416+ property bool _pending: !callForwarding.ready
2417+
2418+ /**
2419+ * Server failed to change/fetch setting.
2420+ */
2421+ property bool _failed: false
2422+
2423+ /**
2424+ * We're editing.
2425+ */
2426+ property bool _editing: false
2427+ on_EditingChanged: Utils.editingChanged()
2428+
2429+ /**
2430+ * Whether or not the forwarding rule is active.
2431+ */
2432+ property bool _active: callForwarding[rule] !== ""
2433+ }
2434+
2435+ states: [
2436+ State {
2437+ name: "failed"
2438+ when: d._failed
2439+ PropertyChanges { target: control; enabled: false; control: check }
2440+ PropertyChanges { target: check; checked: false }
2441+ PropertyChanges { target: failed; visible: true }
2442+ PropertyChanges { target: activity; visible: false }
2443+ },
2444+ State {
2445+ name: "disabled"
2446+ when: !enabled
2447+ PropertyChanges { target: control; enabled: false }
2448+ PropertyChanges { target: check; enabled: false }
2449+ PropertyChanges { target: current; enabled: false }
2450+ },
2451+ State {
2452+ name: "requesting"
2453+ when: d._editing && d._pending
2454+ PropertyChanges { target: control; control: activity }
2455+ PropertyChanges { target: check; enabled: false; visible: false }
2456+ PropertyChanges { target: current; enabled: false; visible: true }
2457+ },
2458+ State {
2459+ name: "pending"
2460+ when: d._pending
2461+ PropertyChanges { target: control; control: activity }
2462+ PropertyChanges { target: check; enabled: false; visible: false }
2463+ PropertyChanges { target: current; enabled: false; visible: false }
2464+ },
2465+ State {
2466+ name: "editing"
2467+ when: d._editing
2468+ PropertyChanges { target: check; enabled: false }
2469+ PropertyChanges { target: current; visible: false }
2470+ PropertyChanges { target: input; visible: true }
2471+ },
2472+ State {
2473+ name: "active"
2474+ when: d._active
2475+ PropertyChanges { target: current; visible: true }
2476+ }
2477+ ]
2478+
2479+ ListItem.ThinDivider { anchors { left: parent.left; right: parent.right }}
2480+
2481+ ListItem.Standard {
2482+ id: control
2483+ onClicked: check.trigger(!check.checked)
2484+ control: CheckBox {
2485+ id: check
2486+ objectName: "check_" + rule
2487+ checked: callForwarding[rule] !== ""
2488+ onTriggered: Utils.checked(checked)
2489+ visible: !activity.running
2490+ }
2491+ }
2492+
2493+ ListItem.Standard {
2494+ id: input
2495+ visible: false
2496+ height: visible ? units.gu(6) : 0
2497+ /* TRANSLATORS: This string will be truncated on smaller displays. */
2498+ text: i18n.tr("Forward to")
2499+ control: TextField {
2500+ id: field
2501+ objectName: "field_" + rule
2502+ horizontalAlignment: TextInput.AlignRight
2503+ inputMethodHints: Qt.ImhDialableCharactersOnly
2504+ text: callForwarding[rule]
2505+ font.pixelSize: units.dp(18)
2506+ font.weight: Font.Light
2507+ font.family: "Ubuntu"
2508+ color: "#AAAAAA"
2509+ maximumLength: 20
2510+ focus: true
2511+ cursorVisible: text === "" || text !== callForwarding[rule]
2512+ placeholderText: i18n.tr("Enter a number")
2513+ style: TextFieldStyle {
2514+ overlaySpacing: units.gu(0.5)
2515+ frameSpacing: 0
2516+ background: Rectangle {
2517+ property bool error: (field.hasOwnProperty("errorHighlight") &&
2518+ field.errorHighlight &&
2519+ !field.acceptableInput)
2520+ onErrorChanged: error ? theme.palette.normal.negative : color
2521+ color: Theme.palette.normal.background
2522+ anchors.fill: parent
2523+ visible: field.activeFocus
2524+ }
2525+ }
2526+
2527+ onVisibleChanged:
2528+ if (visible === true) forceActiveFocus()
2529+ }
2530+
2531+ Behavior on height {
2532+ NumberAnimation {
2533+ duration: UbuntuAnimation.SnapDuration
2534+ }
2535+ }
2536+ }
2537+
2538+ ListItem.SingleValue {
2539+ id: current
2540+ objectName: "current_" + rule
2541+ visible: value
2542+ /* TRANSLATORS: This string will be truncated on smaller displays. */
2543+ text: i18n.tr("Forward to")
2544+ value: callForwarding[rule]
2545+ onClicked: d._editing = true
2546+ }
2547+
2548+ /* Error message shown when updating fails. */
2549+ Label {
2550+ id: failed
2551+ anchors {
2552+ left: parent.left; right: parent.right; margins: units.gu(2);
2553+ }
2554+ visible: false
2555+ height: contentHeight + units.gu(4)
2556+ horizontalAlignment: Text.AlignHCenter
2557+ verticalAlignment: Text.AlignVCenter
2558+ color: theme.palette.normal.negative
2559+ text: i18n.tr("Call forwarding can't be changed right now.")
2560+ }
2561+
2562+ ActivityIndicator {
2563+ id: activity
2564+ running: d._pending
2565+ visible: running
2566+ }
2567+
2568+ Connections {
2569+ target: item
2570+ Component.onCompleted: {
2571+ item.callForwarding[item.rule + 'Changed'].connect(Utils.ruleChanged);
2572+ item.callForwarding[item.rule + 'Complete'].connect(Utils.ruleComplete);
2573+ item.callForwarding.readyChanged.connect(Utils.ruleReadyChanged);
2574+ }
2575+ Component.onDestruction: {
2576+ item.callForwarding[item.rule + 'Changed'].disconnect(Utils.ruleChanged);
2577+ item.callForwarding[item.rule + 'Complete'].disconnect(Utils.ruleComplete);
2578+ item.callForwarding.readyChanged.disconnect(Utils.ruleReadyChanged);
2579+ }
2580+ }
2581+}
2582
2583=== added file 'src/qml/SettingsPage/CallForwarding.qml'
2584--- src/qml/SettingsPage/CallForwarding.qml 1970-01-01 00:00:00 +0000
2585+++ src/qml/SettingsPage/CallForwarding.qml 2017-04-05 17:09:12 +0000
2586@@ -0,0 +1,393 @@
2587+/*
2588+ * This file is part of dialer-app
2589+ *
2590+ * Copyright (C) 2013-2017 Canonical Ltd.
2591+ *
2592+ * Contact:
2593+ * Sebastien Bacher <sebastien.bacher@canonical.com>
2594+ * Jonas G. Drange <jonas.drange@canonical.com>
2595+ *
2596+ * This program is free software: you can redistribute it and/or modify it
2597+ * under the terms of the GNU General Public License version 3, as published
2598+ * by the Free Software Foundation.
2599+ *
2600+ * This program is distributed in the hope that it will be useful, but
2601+ * WITHOUT ANY WARRANTY; without even the implied warranties of
2602+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
2603+ * PURPOSE. See the GNU General Public License for more details.
2604+ *
2605+ * You should have received a copy of the GNU General Public License along
2606+ * with this program. If not, see <http://www.gnu.org/licenses/>.
2607+ *
2608+ * TODO: Add centrally stored setting for each call forwarding that describes a
2609+ * contact. lp:1467816
2610+ *
2611+ * TODO: If a setting failed to be set, the error text should be followed by
2612+ * “Contact {carrier name} for more information.”.
2613+ */
2614+
2615+import QtQuick 2.4
2616+import QtContacts 5.0
2617+import MeeGo.QOfono 0.2
2618+import Ubuntu.Components 1.3
2619+import Ubuntu.Components.ListItems 1.3 as ListItem
2620+import Ubuntu.Components.Popups 1.3
2621+import Ubuntu.Components.Themes.Ambiance 0.1
2622+import Ubuntu.Content 1.3
2623+import "callForwardingUtils.js" as Utils
2624+
2625+Page {
2626+ id: page
2627+ objectName: "callForwardingPage"
2628+ title: headerTitle
2629+ property var sim
2630+ property string headerTitle: i18n.tr("Call forwarding")
2631+ property QtObject editing: null
2632+ property QtObject activeItem: null
2633+ property var activeTransfer
2634+
2635+ header: PageHeader {
2636+ id: pageHeader
2637+ title: page.title
2638+ flickable: flick
2639+ }
2640+
2641+ states: [
2642+ State {
2643+ name: "forwardBusy"
2644+ PropertyChanges { target: fwdSomeTitle; enabled: false }
2645+ PropertyChanges { target: fwdAll; enabled: false; }
2646+ PropertyChanges { target: fwdBusy; enabled: false; }
2647+ PropertyChanges { target: fwdLost; enabled: false; }
2648+ PropertyChanges { target: fwdUnreachable; enabled: false; }
2649+ when: fwdAll.busy || fwdBusy.busy || fwdLost.busy || fwdUnreachable.busy
2650+ },
2651+ State {
2652+ name: "forwardFailed"
2653+ PropertyChanges { target: fwdSomeTitle; enabled: false }
2654+ PropertyChanges { target: fwdFailedLabel; visible: true }
2655+ PropertyChanges { target: fwdAll; enabled: false; }
2656+ PropertyChanges { target: fwdBusy; enabled: false; }
2657+ PropertyChanges { target: fwdLost; enabled: false; }
2658+ PropertyChanges { target: fwdUnreachable; enabled: false; }
2659+ },
2660+ State {
2661+ name: "editing"
2662+ PropertyChanges { target: fwdAll; enabled: false; explicit: true }
2663+ PropertyChanges { target: fwdBusy; enabled: false; explicit: true }
2664+ PropertyChanges { target: fwdLost; enabled: false; explicit: true }
2665+ PropertyChanges { target: fwdUnreachable; enabled: false; explicit: true }
2666+ PropertyChanges { target: fwdSomeTitle; enabled: false }
2667+ StateChangeScript {
2668+ name: "editingEnabled"
2669+ script: {
2670+ editing.opacity = 1;
2671+ editing.enabled = true;
2672+ }
2673+ }
2674+ when: editing !== null
2675+ },
2676+ State {
2677+ name: "forwardAll"
2678+ PropertyChanges { target: fwdSomeTitle; }
2679+ PropertyChanges { target: fwdBusy; enabled: false; value: ""; checked: false }
2680+ PropertyChanges { target: fwdLost; enabled: false; value: ""; checked: false }
2681+ PropertyChanges { target: fwdUnreachable; enabled: false; value: ""; checked: false }
2682+ when: fwdAll.value !== ""
2683+ }
2684+ ]
2685+
2686+ Flickable {
2687+ id: flick
2688+
2689+ // this is necessary to avoid the page to appear below the header
2690+ clip: true
2691+ flickableDirection: Flickable.VerticalFlick
2692+ anchors {
2693+ fill: parent
2694+ bottomMargin: keyboardButtons.height + keyboard.height
2695+ }
2696+ contentHeight: contents.height + units.gu(2)
2697+ contentWidth: parent.width
2698+
2699+ // after add a new field we need to wait for the contentHeight to
2700+ // change to scroll to the correct position
2701+ onContentHeightChanged: Utils.show(page.activeItem)
2702+
2703+ Column {
2704+ id: contents
2705+ anchors { left: parent.left; right: parent.right }
2706+ spacing: units.gu(1)
2707+
2708+ CallForwardItem {
2709+ id: fwdAll
2710+ anchors { left: parent.left; right: parent.right }
2711+ rule: "voiceUnconditional"
2712+ callForwarding: callForwarding
2713+ text: i18n.tr("Forward every incoming call")
2714+ onEnteredEditMode: {page.editing = fwdAll; Utils.show(field)}
2715+ onLeftEditMode: page.editing = null
2716+ }
2717+
2718+ Label {
2719+ id: fwdAllCaption
2720+ anchors {
2721+ left: parent.left; right: parent.right; margins: units.gu(1)
2722+ }
2723+ width: parent.width
2724+ wrapMode: Text.WordWrap
2725+ fontSize: "small"
2726+ horizontalAlignment: Text.AlignHCenter
2727+ verticalAlignment: Text.AlignVCenter
2728+ text: i18n.tr("Redirects all phone calls to another number.")
2729+ opacity: 0.8
2730+ }
2731+
2732+ Label {
2733+ id: fwdFailedLabel
2734+ anchors {
2735+ left: parent.left; right: parent.right; margins: units.gu(2)
2736+ }
2737+ width: parent.width
2738+ wrapMode: Text.WordWrap
2739+ visible: false
2740+ text: i18n.tr("Call forwarding status can't be checked " +
2741+ "now. Try again later.")
2742+ color: theme.palette.normal.negative
2743+ horizontalAlignment: Text.AlignHCenter
2744+ }
2745+
2746+ SettingsItemTitle {
2747+ id: fwdSomeTitle
2748+ text: i18n.tr("Forward incoming calls when:")
2749+ }
2750+
2751+ CallForwardItem {
2752+ id: fwdBusy
2753+ objectName: "fwdBusy"
2754+ anchors { left: parent.left; right: parent.right }
2755+ callForwarding: callForwarding
2756+ rule: "voiceBusy"
2757+ text: i18n.tr("I'm on another call")
2758+ onEnteredEditMode: {page.editing = fwdBusy; Utils.show(field)}
2759+ onLeftEditMode: page.editing = null
2760+ }
2761+
2762+ CallForwardItem {
2763+ id: fwdLost
2764+ objectName: "fwdLost"
2765+ anchors { left: parent.left; right: parent.right }
2766+ callForwarding: callForwarding
2767+ rule: "voiceNoReply"
2768+ text: i18n.tr("I don't answer")
2769+ onEnteredEditMode: {page.editing = fwdLost; Utils.show(field)}
2770+ onLeftEditMode: page.editing = null
2771+ }
2772+
2773+ CallForwardItem {
2774+ id: fwdUnreachable
2775+ objectName: "fwdUnreachable"
2776+ anchors { left: parent.left; right: parent.right }
2777+ callForwarding: callForwarding
2778+ rule: "voiceNotReachable"
2779+ text: i18n.tr("My phone is unreachable")
2780+ onEnteredEditMode: {
2781+ page.editing = fwdUnreachable;
2782+ Utils.show(field);
2783+ }
2784+ onLeftEditMode: page.editing = null
2785+ }
2786+ }
2787+ } // Flickable
2788+
2789+ Rectangle {
2790+ id: keyboardButtons
2791+ anchors {
2792+ left: parent.left
2793+ right: parent.right
2794+ bottom: keyboard.top
2795+ }
2796+ color: Theme.palette.selected.background
2797+ visible: editing !== null
2798+ height: units.gu(6)
2799+ Button {
2800+ id: kbdContacts
2801+ objectName: "contactsButton"
2802+ anchors {
2803+ left: parent.left
2804+ leftMargin: units.gu(1)
2805+ verticalCenter: parent.verticalCenter
2806+ }
2807+ activeFocusOnPress: false
2808+ enabled: editing && !editing.busy
2809+ text: i18n.tr("Contacts...")
2810+ onClicked: page.activeTransfer = contactPicker.request()
2811+ }
2812+
2813+ Button {
2814+ id: kbdCancel
2815+ objectName: "cancelButton"
2816+ anchors {
2817+ right: kbdSet.left
2818+ rightMargin: units.gu(1)
2819+ verticalCenter: parent.verticalCenter
2820+ }
2821+ enabled: editing && !editing.busy
2822+ text: i18n.tr("Cancel")
2823+ onClicked: editing.cancel()
2824+ }
2825+
2826+ Button {
2827+ id: kbdSet
2828+ objectName: "setButton"
2829+ anchors {
2830+ right: parent.right
2831+ rightMargin: units.gu(1)
2832+ verticalCenter: parent.verticalCenter
2833+ }
2834+ enabled: editing && !editing.busy && editing.field.text
2835+ text: i18n.tr("Set")
2836+ activeFocusOnPress: false
2837+ onClicked: editing.save()
2838+ }
2839+ }
2840+
2841+ KeyboardRectangle {
2842+ id: keyboard
2843+ anchors.bottom: parent.bottom
2844+ onHeightChanged: {
2845+ if (page.activeItem) {
2846+ Utils.show(page.activeItem);
2847+ }
2848+ }
2849+ }
2850+
2851+ Component {
2852+ id: chooseNumberDialog
2853+ Dialog {
2854+ id: dialog
2855+ property var contact
2856+ title: i18n.tr("Please select a phone number")
2857+
2858+ ListItem.ItemSelector {
2859+ anchors {
2860+ left: parent.left
2861+ right: parent.right
2862+ }
2863+ activeFocusOnPress: false
2864+ expanded: true
2865+ text: i18n.tr("Numbers")
2866+ model: contact.phoneNumbers
2867+ selectedIndex: -1
2868+ delegate: OptionSelectorDelegate {
2869+ text: modelData.number
2870+ activeFocusOnPress: false
2871+ }
2872+ onDelegateClicked: {
2873+ editing.field.text = contact.phoneNumbers[index].number;
2874+ PopupUtils.close(dialog);
2875+ }
2876+ }
2877+ }
2878+ }
2879+
2880+ Component {
2881+ id: hadNoNumberDialog
2882+ Dialog {
2883+ id: dialog
2884+ title: i18n.tr("Could not forward to this contact")
2885+ text: i18n.tr("Contact not associated with any phone number.")
2886+ Button {
2887+ text: i18n.tr("OK")
2888+ activeFocusOnPress: false
2889+ onClicked: PopupUtils.close(dialog)
2890+ }
2891+ }
2892+ }
2893+
2894+ VCardParser {
2895+ id: contactParser
2896+
2897+ function parseContact(vcardContact) {
2898+ return vcardContact;
2899+ }
2900+
2901+ onVcardParsed: {
2902+ var contact;
2903+ if (contacts.length === 0) {
2904+ console.warn('no contacts parsed');
2905+ return;
2906+ } else {
2907+ contact = parseContact(contacts[0]);
2908+ if (contact.phoneNumbers.length < 1) {
2909+ PopupUtils.open(hadNoNumberDialog);
2910+ } else if (contact.phoneNumbers.length > 1) {
2911+ PopupUtils.open(chooseNumberDialog, page, {
2912+ 'contact': contact
2913+ });
2914+ } else {
2915+ editing.field.text = contact.phoneNumber.number;
2916+ }
2917+ }
2918+ }
2919+ }
2920+
2921+ ContentTransferHint {
2922+ id: importHint
2923+ anchors.fill: parent
2924+ activeTransfer: page.activeTransfer
2925+ }
2926+
2927+ ContentPeer {
2928+ id: contactPicker
2929+ contentType: ContentType.Contacts
2930+ handler: ContentHandler.Source
2931+ selectionType: ContentTransfer.Single
2932+ }
2933+
2934+ Connections {
2935+ target: page.activeTransfer ? page.activeTransfer : null
2936+ onStateChanged: {
2937+ if (page.activeTransfer.state === ContentTransfer.Charged) {
2938+ contactParser.vCardUrl = page.activeTransfer.items[0].url;
2939+ }
2940+ }
2941+ }
2942+
2943+ Connections {
2944+ target: callForwarding
2945+ onGetPropertiesFailed: page.state = "forwardFailed";
2946+ }
2947+
2948+ OfonoCallForwarding {
2949+ id: callForwarding
2950+ modemPath: sim.path
2951+ function updateSummary () {
2952+ var val;
2953+
2954+ // Clear the summary and exit if any of the values are unknown.
2955+ if (typeof voiceUnconditional === 'undefined' ||
2956+ typeof voiceBusy === 'undefined' ||
2957+ typeof voiceNoReply === 'undefined' ||
2958+ typeof voiceNotReachable === 'undefined') {
2959+ sim.setCallForwardingSummary('');
2960+ return;
2961+ }
2962+
2963+ if (voiceUnconditional) {
2964+ val = i18n.tr("All calls");
2965+ } else if (voiceBusy || voiceNoReply || voiceNotReachable) {
2966+ val = i18n.tr("Some calls")
2967+ } else {
2968+ val = i18n.tr("Off")
2969+ }
2970+ sim.setCallForwardingSummary(val);
2971+ }
2972+
2973+ Component.onCompleted: updateSummary()
2974+ onVoiceUnconditionalChanged: updateSummary()
2975+ onVoiceBusyChanged: updateSummary()
2976+ onVoiceNoReplyChanged: updateSummary()
2977+ onVoiceNotReachableChanged: updateSummary()
2978+ }
2979+}
2980
2981=== added file 'src/qml/SettingsPage/CallWaiting.qml'
2982--- src/qml/SettingsPage/CallWaiting.qml 1970-01-01 00:00:00 +0000
2983+++ src/qml/SettingsPage/CallWaiting.qml 2017-04-05 17:09:12 +0000
2984@@ -0,0 +1,108 @@
2985+/*
2986+ * This file is part of dialer-app
2987+ *
2988+ * Copyright (C) 2013-2017 Canonical Ltd.
2989+ *
2990+ * Contact: Iain Lane <iain.lane@canonical.com>
2991+ *
2992+ * This program is free software: you can redistribute it and/or modify it
2993+ * under the terms of the GNU General Public License version 3, as published
2994+ * by the Free Software Foundation.
2995+ *
2996+ * This program is distributed in the hope that it will be useful, but
2997+ * WITHOUT ANY WARRANTY; without even the implied warranties of
2998+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
2999+ * PURPOSE. See the GNU General Public License for more details.
3000+ *
3001+ * You should have received a copy of the GNU General Public License along
3002+ * with this program. If not, see <http://www.gnu.org/licenses/>.
3003+ */
3004+
3005+import QtQuick 2.4
3006+import Ubuntu.Components 1.3
3007+import Ubuntu.Components.ListItems 1.3 as ListItem
3008+import MeeGo.QOfono 0.2
3009+
3010+Page {
3011+ id: page
3012+ objectName: "callWaitingPage"
3013+ title: headerTitle
3014+ property var sim
3015+ property string headerTitle: i18n.tr("Call waiting")
3016+ property bool attached: sim.netReg.status === "registered" || sim.netReg.status === "roaming"
3017+
3018+ header: PageHeader {
3019+ id: pageHeader
3020+ title: page.title
3021+ }
3022+
3023+ OfonoCallSettings {
3024+ id: callSettings
3025+ modemPath: sim.path
3026+ onVoiceCallWaitingChanged: {
3027+ callWaitingIndicator.running = false;
3028+ }
3029+ onGetPropertiesFailed: {
3030+ console.warn('callSettings, onGetPropertiesFailed');
3031+ callWaitingIndicator.running = false;
3032+ }
3033+ onVoiceCallWaitingComplete: {
3034+ //When the property change is complete, the value of checked should always be in sync with serverChecked
3035+ callWaitingSwitch.checked = callWaitingSwitch.serverChecked
3036+ /* Log some additional output to help debug when things don't work */
3037+ console.warn('callSettings, onVoiceCallWaitingComplete modem: ' + modemPath + ' success: ' + success + ' ' + voiceCallWaiting);
3038+ callWaitingIndicator.running = false;
3039+ }
3040+ }
3041+
3042+ ActivityIndicator {
3043+ id: callWaitingIndicator
3044+ running: true
3045+ visible: running && attached
3046+ }
3047+
3048+ Switch {
3049+ id: callWaitingSwitch
3050+ objectName: "callWaitingSwitch"
3051+ visible: !callWaitingIndicator.running
3052+ enabled: callSettings.ready && attached
3053+ property bool serverChecked: callSettings.voiceCallWaiting !== "disabled"
3054+ onServerCheckedChanged: checked = serverChecked
3055+ Component.onCompleted: checked = serverChecked
3056+ onTriggered: {
3057+ callWaitingIndicator.running = true;
3058+ if (checked)
3059+ callSettings.voiceCallWaiting = "enabled";
3060+ else
3061+ callSettings.voiceCallWaiting = "disabled";
3062+ }
3063+ }
3064+
3065+ Column {
3066+ anchors.fill: parent
3067+
3068+ ListItem.Standard {
3069+ id: callWaitingItem
3070+ text: i18n.tr("Call waiting")
3071+ control: callWaitingIndicator.running ?
3072+ callWaitingIndicator : callWaitingSwitch
3073+ }
3074+
3075+ ListItem.Base {
3076+ height: textItem.height + units.gu(2)
3077+ Label {
3078+ id: textItem
3079+ anchors {
3080+ left: parent.left
3081+ right: parent.right
3082+ verticalCenter: parent.verticalCenter
3083+ }
3084+
3085+ text: i18n.tr("Lets you answer or start a new call while on another call, and switch between them")
3086+ horizontalAlignment: Text.AlignHCenter
3087+ wrapMode: Text.WordWrap
3088+ }
3089+ showDivider: false
3090+ }
3091+ }
3092+}
3093
3094=== added file 'src/qml/SettingsPage/KeyboardRectangle.qml'
3095--- src/qml/SettingsPage/KeyboardRectangle.qml 1970-01-01 00:00:00 +0000
3096+++ src/qml/SettingsPage/KeyboardRectangle.qml 2017-04-05 17:09:12 +0000
3097@@ -0,0 +1,77 @@
3098+/*
3099+ * Copyright (C) 2015-2017 Canonical, Ltd.
3100+ *
3101+ * This program is free software; you can redistribute it and/or modify
3102+ * it under the terms of the GNU General Public License as published by
3103+ * the Free Software Foundation; version 3.
3104+ *
3105+ * This program is distributed in the hope that it will be useful,
3106+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3107+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3108+ * GNU General Public License for more details.
3109+ *
3110+ * You should have received a copy of the GNU General Public License
3111+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3112+ */
3113+
3114+import QtQuick 2.4
3115+
3116+Item {
3117+ id: keyboardRect
3118+ anchors.left: parent.left
3119+ anchors.right: parent.right
3120+ anchors.bottom: parent.bottom
3121+ height: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
3122+
3123+ Behavior on height {
3124+ NumberAnimation {
3125+ duration: 300
3126+ easing.type: Easing.InOutQuad
3127+ }
3128+ }
3129+
3130+ states: [
3131+ State {
3132+ name: "hidden"
3133+ when: keyboardRect.height == 0
3134+ },
3135+ State {
3136+ name: "shown"
3137+ when: keyboardRect.height == Qt.inputMethod.keyboardRectangle.height
3138+ }
3139+ ]
3140+
3141+ function recursiveFindFocusedItem(parent) {
3142+ if (parent.activeFocus) {
3143+ return parent;
3144+ }
3145+
3146+ for (var i in parent.children) {
3147+ var child = parent.children[i];
3148+ if (child.activeFocus) {
3149+ return child;
3150+ }
3151+
3152+ var item = recursiveFindFocusedItem(child);
3153+
3154+ if (item != null) {
3155+ return item;
3156+ }
3157+ }
3158+
3159+ return null;
3160+ }
3161+
3162+ Connections {
3163+ target: Qt.inputMethod
3164+
3165+ onVisibleChanged: {
3166+ if (!Qt.inputMethod.visible) {
3167+ var focusedItem = recursiveFindFocusedItem(keyboardRect.parent);
3168+ if (focusedItem != null) {
3169+ focusedItem.focus = false;
3170+ }
3171+ }
3172+ }
3173+ }
3174+}
3175
3176=== added file 'src/qml/SettingsPage/MultiSim.qml'
3177--- src/qml/SettingsPage/MultiSim.qml 1970-01-01 00:00:00 +0000
3178+++ src/qml/SettingsPage/MultiSim.qml 2017-04-05 17:09:12 +0000
3179@@ -0,0 +1,113 @@
3180+/*
3181+ * Copyright (C) 2014-2017 Canonical Ltd
3182+ *
3183+ * This program is free software: you can redistribute it and/or modify
3184+ * it under the terms of the GNU General Public License version 3 as
3185+ * published by the Free Software Foundation.
3186+ *
3187+ * This program is distributed in the hope that it will be useful,
3188+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3189+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3190+ * GNU General Public License for more details.
3191+ *
3192+ * You should have received a copy of the GNU General Public License
3193+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3194+ *
3195+ * Authors:
3196+ * Ken Vandine <ken.vandine@canonical.com>
3197+ * Jonas G. Drange <jonas.drange@canonical.com>
3198+ *
3199+*/
3200+import QtQuick 2.4
3201+import GSettings 1.0
3202+import Ubuntu.Components 1.3
3203+import Ubuntu.Components.ListItems 1.3 as ListItem
3204+
3205+Column {
3206+
3207+ property var sims
3208+
3209+ Repeater {
3210+ model: sims
3211+
3212+ Column {
3213+
3214+ anchors { left: parent.left; right: parent.right }
3215+
3216+ SettingsItemTitle { text: sims[index].title }
3217+
3218+ ListItem.Standard {
3219+ objectName: "callWaitSim" + index
3220+ text: i18n.tr("Call waiting")
3221+ progression: true
3222+ onClicked: pageStack.push(Qt.resolvedUrl("CallWaiting.qml"), {
3223+ sim: sims[index],
3224+ headerTitle: sims[index].title
3225+ })
3226+ }
3227+
3228+ ListItem.SingleValue {
3229+ objectName: "callFwdSim" + index
3230+ text: i18n.tr("Call forwarding")
3231+ progression: true
3232+ value: sims[index].getCallForwardingSummary()
3233+ onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"), {
3234+ sim: sims[index],
3235+ headerTitle: sims[index].title
3236+ })
3237+ }
3238+
3239+ ListItem.Standard {
3240+ objectName: "simServicesSim" + index
3241+ text: i18n.tr("Services")
3242+ progression: true
3243+ enabled: {
3244+ var num;
3245+ var map = sims[index].simMng.serviceNumbers;
3246+ var nums = false;
3247+ for(num in map) {
3248+ if (map.hasOwnProperty(num)) {
3249+ nums = true;
3250+ break;
3251+ }
3252+ }
3253+ return sims[index].simMng.present && nums;
3254+ }
3255+ showDivider: false
3256+ onClicked: pageStack.push(Qt.resolvedUrl("Services.qml"), {
3257+ carrierString: sims[index].netReg.name,
3258+ sim: sims[index],
3259+ headerTitle: sims[index].title
3260+ })
3261+ }
3262+
3263+ ListItem.Divider {
3264+ visible: index !== (sims.length - 1)
3265+ }
3266+
3267+ Binding {
3268+ target: sims[index]
3269+ property: "name"
3270+ value: phoneSettings.simNames[sims[index]]
3271+ }
3272+ }
3273+ }
3274+
3275+ GSettings {
3276+ id: phoneSettings
3277+ schema.id: "com.ubuntu.phone"
3278+ Component.onCompleted: {
3279+ // set default names
3280+ var simNames = phoneSettings.simNames;
3281+ var m0 = sims[0].path
3282+ var m1 = sims[1].path
3283+ if (!simNames[m0]) {
3284+ simNames[m0] = "SIM 1";
3285+ }
3286+ if (!simNames[m1]) {
3287+ simNames[m1] = "SIM 2";
3288+ }
3289+ phoneSettings.simNames = simNames;
3290+ }
3291+ }
3292+}
3293
3294=== added file 'src/qml/SettingsPage/NoSims.qml'
3295--- src/qml/SettingsPage/NoSims.qml 1970-01-01 00:00:00 +0000
3296+++ src/qml/SettingsPage/NoSims.qml 2017-04-05 17:09:12 +0000
3297@@ -0,0 +1,46 @@
3298+/*
3299+ * Copyright (C) 2014-2017 Canonical Ltd
3300+ *
3301+ * This program is free software: you can redistribute it and/or modify
3302+ * it under the terms of the GNU General Public License version 3 as
3303+ * published by the Free Software Foundation.
3304+ *
3305+ * This program is distributed in the hope that it will be useful,
3306+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3307+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3308+ * GNU General Public License for more details.
3309+ *
3310+ * You should have received a copy of the GNU General Public License
3311+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3312+ *
3313+ * Authors:
3314+ * Ken Vandine <ken.vandine@canonical.com>
3315+ * Jonas G. Drange <jonas.drange@canonical.com>
3316+ *
3317+*/
3318+import QtQuick 2.4
3319+import Ubuntu.Components 1.3
3320+import Ubuntu.Components.ListItems 1.3 as ListItem
3321+
3322+Column {
3323+
3324+ ListItem.Standard {
3325+ text: i18n.tr("Call forwarding")
3326+ progression: true
3327+ enabled: false
3328+ }
3329+
3330+ ListItem.Standard {
3331+ text: i18n.tr("Call waiting")
3332+ progression: true
3333+ enabled: false
3334+ }
3335+
3336+ ListItem.Divider {}
3337+
3338+ ListItem.Standard {
3339+ text: i18n.tr("Services")
3340+ progression: true
3341+ enabled: false
3342+ }
3343+}
3344
3345=== added file 'src/qml/SettingsPage/Ofono.qml'
3346--- src/qml/SettingsPage/Ofono.qml 1970-01-01 00:00:00 +0000
3347+++ src/qml/SettingsPage/Ofono.qml 2017-04-05 17:09:12 +0000
3348@@ -0,0 +1,69 @@
3349+/*
3350+ * Copyright (C) 2014-2017 Canonical Ltd
3351+ *
3352+ * This program is free software: you can redistribute it and/or modify
3353+ * it under the terms of the GNU General Public License version 3 as
3354+ * published by the Free Software Foundation.
3355+ *
3356+ * This program is distributed in the hope that it will be useful,
3357+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3358+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3359+ * GNU General Public License for more details.
3360+ *
3361+ * You should have received a copy of the GNU General Public License
3362+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3363+ *
3364+ * Authors:
3365+ * Jonas G. Drange <jonas.drange@canonical.com>
3366+ *
3367+*/
3368+import QtQuick 2.4
3369+import GSettings 1.0
3370+import MeeGo.QOfono 0.2
3371+
3372+Item {
3373+ property alias netReg: netReg
3374+ property alias simMng: simMng
3375+ property alias present: simMng.present
3376+
3377+ property string path
3378+ property string name
3379+ property string title: {
3380+ var number = simMng.subscriberNumbers[0] || simMng.subscriberIdentity;
3381+ return name + (number ? " (" + number + ")" : "");
3382+ }
3383+
3384+ OfonoNetworkRegistration {
3385+ id: netReg
3386+ modemPath: path
3387+ }
3388+
3389+ OfonoSimManager {
3390+ id: simMng
3391+ modemPath: path
3392+ }
3393+
3394+ function setCallForwardingSummary (val) {
3395+ var tmp = {};
3396+ var fwdSum = settings.callforwardingSummaries;
3397+ for (var k in fwdSum){
3398+ if (fwdSum.hasOwnProperty(k)) {
3399+ tmp[k] = fwdSum[k];
3400+ }
3401+ }
3402+ // Prefer IMSI to identify the SIM, use ICCID if IMSI is not available.
3403+ tmp[simMng.subscriberIdentity || simMng.CardIdentifier] = val;
3404+ settings.callforwardingSummaries = tmp;
3405+ }
3406+
3407+ function getCallForwardingSummary () {
3408+ // Use either IMSI or ICCID to identify the SIM.
3409+ var sid = simMng.subscriberIdentity || simMng.CardIdentifier;
3410+ return settings.callforwardingSummaries[sid] || '';
3411+ }
3412+
3413+ GSettings {
3414+ id: settings
3415+ schema.id: "com.ubuntu.touch.system-settings"
3416+ }
3417+}
3418
3419=== added file 'src/qml/SettingsPage/OnlineAccountsHelper.qml'
3420--- src/qml/SettingsPage/OnlineAccountsHelper.qml 1970-01-01 00:00:00 +0000
3421+++ src/qml/SettingsPage/OnlineAccountsHelper.qml 2017-04-05 17:09:12 +0000
3422@@ -0,0 +1,96 @@
3423+/*
3424+ * Copyright (C) 2014 Canonical, Ltd.
3425+ *
3426+ * This program is free software; you can redistribute it and/or modify
3427+ * it under the terms of the GNU General Public License as published by
3428+ * the Free Software Foundation; version 3.
3429+ *
3430+ * This program is distributed in the hope that it will be useful,
3431+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3432+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3433+ * GNU General Public License for more details.
3434+ *
3435+ * You should have received a copy of the GNU General Public License
3436+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3437+ */
3438+
3439+import QtQuick 2.4
3440+import Ubuntu.Components 1.3
3441+import Ubuntu.OnlineAccounts 0.1
3442+import Ubuntu.OnlineAccounts.Client 0.1
3443+import Ubuntu.Components.Popups 1.3
3444+
3445+Item {
3446+ id: root
3447+
3448+ property var dialogInstance: null
3449+ readonly property int count: accountsModel.count
3450+
3451+ function run(){
3452+ if (!root.dialogInstance) {
3453+ root.dialogInstance = PopupUtils.open(dialog)
3454+ }
3455+ }
3456+
3457+ ProviderModel {
3458+ id: accountsModel
3459+
3460+ applicationId: "dialer-app"
3461+ }
3462+
3463+ Component {
3464+ id: dialog
3465+ Dialog {
3466+ id: dialogue
3467+ title: "Online Accounts"
3468+ text: i18n.tr("Pick an account to create.")
3469+
3470+ ScrollView {
3471+ width: dialog.width
3472+ height: Math.min(listView.count, 3) * units.gu(7)
3473+
3474+ ListView {
3475+ id: listView
3476+
3477+ anchors.fill: parent
3478+ clip: true
3479+ model: accountsModel
3480+ delegate: ListItem {
3481+ ListItemLayout {
3482+ title.text: model.displayName
3483+
3484+ Image {
3485+ SlotsLayout.position: SlotsLayout.First
3486+ source: "image://theme/" + model.iconName
3487+ width: units.gu(5)
3488+ height: width
3489+ }
3490+ }
3491+ onClicked: {
3492+ listView.enabled = false
3493+ setup.providerId = model.providerId
3494+ setup.exec()
3495+ }
3496+ }
3497+ }
3498+ }
3499+ Button {
3500+ text: i18n.tr("Cancel")
3501+ onClicked: PopupUtils.close(dialogue)
3502+ }
3503+
3504+ Component.onDestruction: {
3505+ root.dialogInstance = null
3506+ }
3507+ }
3508+ }
3509+
3510+ Setup {
3511+ id: setup
3512+ applicationId: "dialer-app"
3513+ providerId: "telephony-sip"
3514+ onFinished: {
3515+ PopupUtils.close(root.dialogInstance)
3516+ }
3517+ }
3518+}
3519
3520=== added file 'src/qml/SettingsPage/ServiceInfo.qml'
3521--- src/qml/SettingsPage/ServiceInfo.qml 1970-01-01 00:00:00 +0000
3522+++ src/qml/SettingsPage/ServiceInfo.qml 2017-04-05 17:09:12 +0000
3523@@ -0,0 +1,133 @@
3524+/*
3525+ * This file is part of dialer-app
3526+ *
3527+ * Copyright (C) 2013-2017 Canonical Ltd.
3528+ *
3529+ * Contact: Sebastien Bacher <sebastien.bacher@canonical.com>
3530+ *
3531+ * This program is free software: you can redistribute it and/or modify it
3532+ * under the terms of the GNU General Public License version 3, as published
3533+ * by the Free Software Foundation.
3534+ *
3535+ * This program is distributed in the hope that it will be useful, but
3536+ * WITHOUT ANY WARRANTY; without even the implied warranties of
3537+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
3538+ * PURPOSE. See the GNU General Public License for more details.
3539+ *
3540+ * You should have received a copy of the GNU General Public License along
3541+ * with this program. If not, see <http://www.gnu.org/licenses/>.
3542+ */
3543+
3544+import QtQuick 2.4
3545+import Ubuntu.Components 1.3
3546+import Ubuntu.Components.ListItems 1.3 as ListItem
3547+import Ubuntu.History 0.1
3548+import "dateUtils.js" as DateUtils
3549+
3550+Page {
3551+ id: page
3552+ property var sim
3553+ property string serviceName
3554+ property string serviceNumber
3555+ property string lastTimestamp
3556+ title: serviceName
3557+
3558+ header: PageHeader {
3559+ id: pageHeader
3560+ title: page.title
3561+ }
3562+
3563+ HistoryEventModel {
3564+ id: historyEventModel
3565+ type: HistoryThreadModel.EventTypeVoice
3566+ sort: HistorySort {
3567+ sortField: "timestamp"
3568+ sortOrder: HistorySort.DescendingOrder
3569+ }
3570+
3571+ property string phoneNumber: serviceNumber
3572+ onCountChanged: lastTimestamp = historyEventModel.get(0).timestamp
3573+
3574+ filter: HistoryUnionFilter {
3575+ // FIXME: this is not the best API for this case, but will be changed later
3576+ HistoryIntersectionFilter {
3577+ HistoryFilter {
3578+ property string threadId: historyEventModel.threadIdForParticipants("ofono/ofono/account0",
3579+ HistoryThreadModel.EventTypeVoice,
3580+ [historyEventModel.phoneNumber],
3581+ HistoryThreadModel.MatchPhoneNumber);
3582+ filterProperty: "threadId"
3583+ filterValue: threadId != "" ? threadId : "something that won't match"
3584+ }
3585+ HistoryFilter {
3586+ filterProperty: "accountId"
3587+ filterValue: "ofono/ofono/account0"
3588+ }
3589+ }
3590+
3591+ HistoryIntersectionFilter {
3592+ HistoryFilter {
3593+ property string threadId: historyEventModel.threadIdForParticipants("ofono/ofono/account1",
3594+ HistoryThreadModel.EventTypeVoice,
3595+ [historyEventModel.phoneNumber],
3596+ HistoryThreadModel.MatchPhoneNumber);
3597+ filterProperty: "threadId"
3598+ filterValue: threadId != "" ? threadId : "something that won't match"
3599+ }
3600+ HistoryFilter {
3601+ filterProperty: "accountId"
3602+ filterValue: "ofono/ofono/account1"
3603+ }
3604+ }
3605+ }
3606+ }
3607+
3608+ Column {
3609+ anchors {
3610+ left: parent.left
3611+ right: parent.right
3612+ verticalCenter: parent.verticalCenter
3613+ }
3614+
3615+ ListItem.Base {
3616+ anchors.left: parent.left
3617+ anchors.right: parent.right
3618+ height: lastCalledCol.height + units.gu(6)
3619+ Column {
3620+ id: lastCalledCol
3621+ anchors.left: parent.left
3622+ anchors.right: parent.right
3623+ height: childrenRect.height
3624+ spacing: units.gu(2)
3625+
3626+ Icon {
3627+ anchors.horizontalCenter: parent.horizontalCenter
3628+ name: "contact"
3629+ width: 144
3630+ height: width
3631+ }
3632+
3633+ Label {
3634+ id: calledLabel
3635+ objectName: "calledLabel"
3636+ anchors.horizontalCenter: parent.horizontalCenter
3637+ visible: lastTimestamp
3638+ text: i18n.tr("Last called %1").arg(DateUtils.formatFriendlyDate(lastTimestamp))
3639+ }
3640+ }
3641+ }
3642+ }
3643+
3644+ ListItem.SingleControl {
3645+ anchors.bottom: parent.bottom
3646+ control: Button {
3647+ width: parent.width - units.gu(4)
3648+ text: i18n.tr("Call")
3649+ onClicked: {
3650+ var account = mainView.accountForModem(sim.path)
3651+ var accountId = account ? account.accountId : null
3652+ mainView.populateDialpad(serviceNumber, accountId)
3653+ }
3654+ }
3655+ }
3656+}
3657
3658=== added file 'src/qml/SettingsPage/Services.qml'
3659--- src/qml/SettingsPage/Services.qml 1970-01-01 00:00:00 +0000
3660+++ src/qml/SettingsPage/Services.qml 2017-04-05 17:09:12 +0000
3661@@ -0,0 +1,74 @@
3662+/*
3663+ * This file is part of dialer-app
3664+ *
3665+ * Copyright (C) 2013 Canonical Ltd.
3666+ *
3667+ * Contact: Sebastien Bacher <sebastien.bacher@canonical.com>
3668+ *
3669+ * This program is free software: you can redistribute it and/or modify it
3670+ * under the terms of the GNU General Public License version 3, as published
3671+ * by the Free Software Foundation.
3672+ *
3673+ * This program is distributed in the hope that it will be useful, but
3674+ * WITHOUT ANY WARRANTY; without even the implied warranties of
3675+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
3676+ * PURPOSE. See the GNU General Public License for more details.
3677+ *
3678+ * You should have received a copy of the GNU General Public License along
3679+ * with this program. If not, see <http://www.gnu.org/licenses/>.
3680+ */
3681+
3682+import QtQuick 2.4
3683+import Ubuntu.Components 1.3
3684+import Ubuntu.Components.ListItems 1.3 as ListItem
3685+
3686+Page {
3687+ id: root
3688+ objectName: "servicesPage"
3689+ title: headerTitle
3690+ property string carrierString
3691+ property variant sim
3692+ property var names: []
3693+
3694+ // TRANSLATORS: %1 is the name of the (network) carrier
3695+ property string headerTitle: i18n.tr("%1 Services").arg(carrierString)
3696+
3697+ header: PageHeader {
3698+ id: pageHeader
3699+ title: root.title
3700+ }
3701+
3702+ Component.onCompleted: {
3703+ var keys = [];
3704+ for (var x in sim.simMng.serviceNumbers) {
3705+ keys.push(x);
3706+ }
3707+ names = keys;
3708+ }
3709+
3710+ Flickable {
3711+ anchors.fill: parent
3712+ contentHeight: contentItem.childrenRect.height
3713+ boundsBehavior: (contentHeight > root.height) ?
3714+ Flickable.DragAndOvershootBounds :
3715+ Flickable.StopAtBounds
3716+ /* Set the direction to workaround
3717+ https://bugreports.qt-project.org/browse/QTBUG-31905 otherwise the UI
3718+ might end up in a situation where scrolling doesn't work */
3719+ flickableDirection: Flickable.VerticalFlick
3720+
3721+ Column {
3722+ anchors.left: parent.left
3723+ anchors.right: parent.right
3724+ Repeater {
3725+ model: names
3726+
3727+ ListItem.Standard {
3728+ progression: true
3729+ text: modelData
3730+ onClicked: pageStack.push(Qt.resolvedUrl("ServiceInfo.qml"), {serviceName: modelData, serviceNumber: sim.simMng.serviceNumbers[modelData], sim: sim})
3731+ }
3732+ }
3733+ }
3734+ }
3735+}
3736
3737=== added file 'src/qml/SettingsPage/SettingsItemTitle.qml'
3738--- src/qml/SettingsPage/SettingsItemTitle.qml 1970-01-01 00:00:00 +0000
3739+++ src/qml/SettingsPage/SettingsItemTitle.qml 2017-04-05 17:09:12 +0000
3740@@ -0,0 +1,44 @@
3741+/*
3742+ * This file is part of system-settings
3743+ *
3744+ * Copyright (C) 2013-2017 Canonical Ltd.
3745+ *
3746+ * This program is free software: you can redistribute it and/or modify it
3747+ * under the terms of the GNU General Public License version 3, as published
3748+ * by the Free Software Foundation.
3749+ *
3750+ * This program is distributed in the hope that it will be useful, but
3751+ * WITHOUT ANY WARRANTY; without even the implied warranties of
3752+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
3753+ * PURPOSE. See the GNU General Public License for more details.
3754+ *
3755+ * You should have received a copy of the GNU General Public License along
3756+ * with this program. If not, see <http://www.gnu.org/licenses/>.
3757+ */
3758+
3759+import QtQuick 2.4
3760+import Ubuntu.Components 1.3
3761+
3762+Item {
3763+ property alias text: label.text
3764+ anchors {
3765+ left: parent.left
3766+ right: parent.right
3767+ }
3768+ height: units.gu(6)
3769+
3770+ Label {
3771+ id: label
3772+ anchors {
3773+ top: parent.top
3774+ topMargin: units.gu(3)
3775+ right: parent.right
3776+ rightMargin: units.gu(2)
3777+ bottom: parent.bottom
3778+ left: parent.left
3779+ leftMargin: units.gu(2)
3780+ }
3781+ fontSize: "small"
3782+ opacity: 0.75
3783+ }
3784+}
3785
3786=== added file 'src/qml/SettingsPage/SettingsPage.qml'
3787--- src/qml/SettingsPage/SettingsPage.qml 1970-01-01 00:00:00 +0000
3788+++ src/qml/SettingsPage/SettingsPage.qml 2017-04-05 17:09:12 +0000
3789@@ -0,0 +1,158 @@
3790+/*
3791+ * This file is part of dialer-app
3792+ *
3793+ * Copyright (C) 2013-2017 Canonical Ltd.
3794+ *
3795+ * Contact: Iain Lane <iain.lane@canonical.com>
3796+ *
3797+ * This program is free software: you can redistribute it and/or modify it
3798+ * under the terms of the GNU General Public License version 3, as published
3799+ * by the Free Software Foundation.
3800+ *
3801+ * This program is distributed in the hope that it will be useful, but
3802+ * WITHOUT ANY WARRANTY; without even the implied warranties of
3803+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
3804+ * PURPOSE. See the GNU General Public License for more details.
3805+ *
3806+ * You should have received a copy of the GNU General Public License along
3807+ * with this program. If not, see <http://www.gnu.org/licenses/>.
3808+ */
3809+
3810+import QtQuick 2.4
3811+import Ubuntu.Components 1.3
3812+import Ubuntu.Components.ListItems 1.3 as ListItem
3813+import Ubuntu.Telephony 0.1
3814+
3815+Page {
3816+ id: settingsPage
3817+ objectName: "phonePage"
3818+ title: i18n.tr("Settings")
3819+ flickable: flick
3820+
3821+ property var modemAccounts: telepathyHelper.phoneAccounts.displayed
3822+ property var sims: []
3823+
3824+ function updateSims() {
3825+ var component = Qt.createComponent("Ofono.qml");
3826+
3827+ // remove previous objects
3828+ sims.forEach(function (sim) {
3829+ sim.destroy();
3830+ })
3831+
3832+ var result = []
3833+ for (var i in settingsPage.modemAccounts) {
3834+ var sim = component.createObject(settingsPage, {
3835+ path: settingsPage.modemAccounts[i].modemName
3836+ })
3837+ result.push(sim)
3838+ }
3839+ sims = result
3840+ }
3841+
3842+ header: PageHeader {
3843+ id: pageHeader
3844+ title: settingsPage.title
3845+ flickable: flick
3846+ }
3847+
3848+ states: [
3849+ State {
3850+ name: "noSim"
3851+ StateChangeScript {
3852+ script: loader.setSource("NoSims.qml")
3853+ }
3854+ when: sims.length === 0
3855+ },
3856+ State {
3857+ name: "singleSim"
3858+ StateChangeScript {
3859+ script: loader.setSource("SingleSim.qml", {
3860+ sim: sims[0]
3861+ })
3862+ }
3863+ when: sims.length === 1
3864+ },
3865+ State {
3866+ name: "multiSim"
3867+ StateChangeScript {
3868+ script: loader.setSource("MultiSim.qml", {
3869+ sims: sims
3870+ })
3871+ }
3872+ when: sims.length > 1
3873+ }
3874+ ]
3875+
3876+ onModemAccountsChanged: updateSims()
3877+
3878+ Flickable {
3879+ id: flick
3880+ anchors.fill: parent
3881+ contentWidth: parent.width
3882+ contentHeight: contentItem.childrenRect.height
3883+ boundsBehavior: (contentHeight > settingsPage.height) ?
3884+ Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
3885+
3886+ Column {
3887+ anchors { left: parent.left; right: parent.right }
3888+
3889+ Loader {
3890+ id: loader
3891+ anchors { left: parent.left; right: parent.right }
3892+ }
3893+
3894+ ListItem.Standard {
3895+ control: Switch {
3896+ objectName: "dialpadSounds"
3897+ property bool serverChecked: telepathyHelper.dialpadSoundsEnabled
3898+ onServerCheckedChanged: checked = serverChecked
3899+ Component.onCompleted: checked = serverChecked
3900+ onTriggered: telepathyHelper.dialpadSoundsEnabled = checked
3901+ }
3902+ text: i18n.tr("Dialpad tones")
3903+ }
3904+
3905+ ListItem.Standard {
3906+ id: addAccount
3907+ anchors {
3908+ left: parent.left
3909+ right: parent.right
3910+ }
3911+ text: i18n.tr("Add an online account")
3912+ progression: true
3913+ onClicked: onlineAccountHelper.item.run()
3914+ enabled: (onlineAccountHelper.status === Loader.Ready) && (onlineAccountHelper.item.count > 0)
3915+ }
3916+
3917+ Repeater {
3918+ model: telepathyHelper.voiceAccounts.all
3919+
3920+ Loader {
3921+ id: accountPropertiesLoader
3922+ anchors {
3923+ left: parent.left
3924+ right: parent.right
3925+ margins: units.gu(1)
3926+ }
3927+ height: childrenRect.height
3928+ source: Qt.resolvedUrl("./AccountSettings/" + modelData.protocolInfo.name + ".qml")
3929+
3930+ onStatusChanged: {
3931+ if (status == Loader.Ready) {
3932+ item.account = modelData
3933+ }
3934+ }
3935+ }
3936+ }
3937+ }
3938+ }
3939+
3940+ Loader {
3941+ id: onlineAccountHelper
3942+
3943+ anchors.fill: parent
3944+ asynchronous: true
3945+ source: Qt.resolvedUrl("OnlineAccountsHelper.qml")
3946+ }
3947+}
3948
3949=== added file 'src/qml/SettingsPage/SettingsTextField.qml'
3950--- src/qml/SettingsPage/SettingsTextField.qml 1970-01-01 00:00:00 +0000
3951+++ src/qml/SettingsPage/SettingsTextField.qml 2017-04-05 17:09:12 +0000
3952@@ -0,0 +1,29 @@
3953+import QtQuick 2.4
3954+import Ubuntu.Components 1.3
3955+import Ubuntu.Components.Themes.Ambiance 0.1
3956+
3957+TextField {
3958+ id: textField
3959+ horizontalAlignment: TextInput.AlignRight
3960+ font {
3961+ pixelSize: units.dp(18)
3962+ weight: Font.Light
3963+ family: "Ubuntu"
3964+ }
3965+ color: "#AAAAAA"
3966+ maximumLength: 20
3967+ focus: true
3968+ style: TextFieldStyle {
3969+ overlaySpacing: units.gu(0.5)
3970+ frameSpacing: 0
3971+ background: Rectangle {
3972+ property bool error: (textField.hasOwnProperty("errorHighlight") &&
3973+ textField.errorHighlight &&
3974+ !textField.acceptableInput)
3975+ onErrorChanged: error ? theme.palette.normal.negative : color
3976+ color: Theme.palette.normal.background
3977+ anchors.fill: parent
3978+ visible: textField.activeFocus
3979+ }
3980+ }
3981+}
3982
3983=== added file 'src/qml/SettingsPage/SingleSim.qml'
3984--- src/qml/SettingsPage/SingleSim.qml 1970-01-01 00:00:00 +0000
3985+++ src/qml/SettingsPage/SingleSim.qml 2017-04-05 17:09:12 +0000
3986@@ -0,0 +1,69 @@
3987+/*
3988+ * Copyright (C) 2014-2017 Canonical Ltd
3989+ *
3990+ * This program is free software: you can redistribute it and/or modify
3991+ * it under the terms of the GNU General Public License version 3 as
3992+ * published by the Free Software Foundation.
3993+ *
3994+ * This program is distributed in the hope that it will be useful,
3995+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3996+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3997+ * GNU General Public License for more details.
3998+ *
3999+ * You should have received a copy of the GNU General Public License
4000+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4001+ *
4002+ * Authors:
4003+ * Ken Vandine <ken.vandine@canonical.com>
4004+ * Jonas G. Drange <jonas.drange@canonical.com>
4005+ *
4006+*/
4007+import QtQuick 2.4
4008+import Ubuntu.Components 1.3
4009+import Ubuntu.Components.ListItems 1.3 as ListItem
4010+
4011+Column {
4012+ property var sim
4013+ property string carrierName: sim ? sim.netReg.name : null
4014+ property string carrierString: carrierName ? carrierName : i18n.tr("SIM")
4015+
4016+ ListItem.Standard {
4017+ objectName: "callWait"
4018+ text: i18n.tr("Call waiting")
4019+ progression: true
4020+ onClicked: pageStack.push(Qt.resolvedUrl("CallWaiting.qml"), {sim: sim})
4021+ }
4022+
4023+ ListItem.SingleValue {
4024+ objectName: "callFwd"
4025+ text: i18n.tr("Call forwarding")
4026+ showDivider: false
4027+ progression: true
4028+ value: sim.getCallForwardingSummary()
4029+ onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"), {sim: sim})
4030+ }
4031+
4032+ ListItem.Divider {}
4033+
4034+ ListItem.Standard {
4035+ objectName: "simServices"
4036+ // TRANSLATORS: %1 is the name of the (network) carrier
4037+ text: i18n.tr("%1 Services").arg(carrierString)
4038+ progression: true
4039+ showDivider: false
4040+ enabled: {
4041+ var num;
4042+ var map = sim.simMng.serviceNumbers;
4043+ var nums = false;
4044+ for(num in map) {
4045+ if (map.hasOwnProperty(num)) {
4046+ nums = true;
4047+ break;
4048+ }
4049+ }
4050+ return sim.simMng.present && nums;
4051+ }
4052+ onClicked: pageStack.push(Qt.resolvedUrl("Services.qml"),
4053+ {carrierString: carrierString, sim: sim})
4054+ }
4055+}
4056
4057=== added file 'src/qml/SettingsPage/VCardParser.qml'
4058--- src/qml/SettingsPage/VCardParser.qml 1970-01-01 00:00:00 +0000
4059+++ src/qml/SettingsPage/VCardParser.qml 2017-04-05 17:09:12 +0000
4060@@ -0,0 +1,55 @@
4061+/*
4062+ * Copyright (C) 2015-2017 Canonical, Ltd.
4063+ *
4064+ * This program is free software; you can redistribute it and/or modify
4065+ * it under the terms of the GNU General Public License as published by
4066+ * the Free Software Foundation; version 3.
4067+ *
4068+ * This program is distributed in the hope that it will be useful,
4069+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4070+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4071+ * GNU General Public License for more details.
4072+ *
4073+ * You should have received a copy of the GNU General Public License
4074+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4075+ */
4076+
4077+import QtQuick 2.4
4078+import QtContacts 5.0
4079+
4080+QtObject {
4081+ id: root
4082+
4083+ property string vCardUrl
4084+ property alias contacts: contactsModel.contacts
4085+ property var _model
4086+
4087+ signal vcardParsed(int error)
4088+
4089+ function clearModel()
4090+ {
4091+ if (contactsModel.contacts.length === 0)
4092+ return;
4093+
4094+ var ids = []
4095+ for(var i=0, iMax=contactsModel.contacts.length; i < iMax; i++) {
4096+ ids.push(contactsModel.contacts[i].contactId)
4097+ }
4098+ contactsModel.removeContacts(ids)
4099+ }
4100+
4101+ _model: ContactModel {
4102+ id: contactsModel
4103+
4104+ manager: "memory"
4105+
4106+ onImportCompleted: vcardParsed(error)
4107+ }
4108+
4109+ onVCardUrlChanged: {
4110+ if (vCardUrl.length > 0) {
4111+ clearModel()
4112+ contactsModel.importContacts(vCardUrl)
4113+ }
4114+ }
4115+}
4116
4117=== added file 'src/qml/SettingsPage/callForwardingUtils.js'
4118--- src/qml/SettingsPage/callForwardingUtils.js 1970-01-01 00:00:00 +0000
4119+++ src/qml/SettingsPage/callForwardingUtils.js 2017-04-05 17:09:12 +0000
4120@@ -0,0 +1,126 @@
4121+
4122+/**
4123+ * Handle the user's intention when it checks the check mark
4124+ * associated with this forwarding item.
4125+ *
4126+ * @param {Boolean} Value of check
4127+*/
4128+function checked (value) {
4129+ if (value) {
4130+ if (item.cachedRuleValue) {
4131+ requestRule(item.cachedRuleValue);
4132+ } else {
4133+ d._editing = true;
4134+ }
4135+ } else {
4136+ if (d._editing) {
4137+ d._editing = false;
4138+ } else {
4139+ requestRule('');
4140+ }
4141+ }
4142+}
4143+
4144+/**
4145+ * Request that the rule be changed on the backend.
4146+ *
4147+ * @param {String} new rule value
4148+ * @return {Boolean} whether or not we requested a change
4149+ */
4150+function requestRule (value) {
4151+ value = normalizePhoneNumber(value);
4152+ if (value === item.callForwarding[item.rule]) {
4153+ console.warn('Value did not change.');
4154+ return false;
4155+ }
4156+
4157+ item.callForwarding[item.rule] = value;
4158+ d._pending = true;
4159+ return true;
4160+}
4161+
4162+/**
4163+ * Handler for when the component enter or leaves editing mode.
4164+ */
4165+function editingChanged () {
4166+ if (d._editing) {
4167+ item.enteredEditMode();
4168+ } else {
4169+ item.leftEditMode();
4170+ }
4171+}
4172+
4173+/**
4174+ * Handler for when the rule changes on the backend.
4175+ *
4176+ * @param {String} the new property
4177+ */
4178+function ruleChanged (property) {
4179+ check.checked = callForwarding[rule] !== "";
4180+}
4181+
4182+/**
4183+ * Handler for when the backend responds.
4184+ *
4185+ * @param {Boolean} whether or not the backend succeeded
4186+ */
4187+function ruleComplete (success) {
4188+ d._pending = false;
4189+ d._editing = false;
4190+ if (!success) {
4191+ d._failed = true;
4192+ }
4193+}
4194+
4195+/**
4196+ * Handler for when the rule ready changes.
4197+ */
4198+function ruleReadyChanged () {
4199+ d._pending = !callForwarding.ready;
4200+}
4201+
4202+/**
4203+ * Scroll something into view.
4204+ *
4205+ * @param {QtObject} item to scroll to.
4206+ */
4207+function show(item) {
4208+ if (!item) {
4209+ return;
4210+ }
4211+ page.activeItem = item;
4212+
4213+ var position = flick.contentItem.mapFromItem(item, 0, page.activeItem.y);
4214+
4215+ // check if the item is already visible
4216+ var bottomY = flick.contentY + flick.height;
4217+ var itemBottom = position.y + item.height + units.gu(2); // extra margin
4218+ if (position.y >= flick.contentY && itemBottom <= bottomY) {
4219+ return;
4220+ }
4221+
4222+ // if it is not, try to scroll and make it visible
4223+ var targetY = itemBottom - flick.height;
4224+ if (targetY >= 0 && position.y) {
4225+ flick.contentY = targetY;
4226+ } else if (position.y < flick.contentY) {
4227+ // if it is hidden at the top, also show it
4228+ flick.contentY = position.y;
4229+ }
4230+ flick.returnToBounds();
4231+}
4232+
4233+/**
4234+ * Normalizes a phone number.
4235+ *
4236+ * TODO(jgdx): Remove this and replace it with libphonenumber
4237+ *
4238+ * @param {String} number to normalize
4239+ * @return {String} normalized number
4240+ */
4241+function normalizePhoneNumber(identifier) {
4242+ var regexp = new RegExp('[()/-]', 'g');
4243+ var finalNumber = identifier.replace(/\s+/g, '');
4244+ finalNumber = finalNumber.replace(regexp, '');
4245+ return finalNumber;
4246+}
4247
4248=== added file 'src/qml/SettingsPage/dateUtils.js'
4249--- src/qml/SettingsPage/dateUtils.js 1970-01-01 00:00:00 +0000
4250+++ src/qml/SettingsPage/dateUtils.js 2017-04-05 17:09:12 +0000
4251@@ -0,0 +1,69 @@
4252+/*
4253+ * Copyright 2012-2013 Canonical Ltd.
4254+ *
4255+ * This file is part of dialer-app.
4256+ *
4257+ * dialer-app is free software; you can redistribute it and/or modify
4258+ * it under the terms of the GNU General Public License as published by
4259+ * the Free Software Foundation; version 3.
4260+ *
4261+ * dialer-app is distributed in the hope that it will be useful,
4262+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4263+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4264+ * GNU General Public License for more details.
4265+ *
4266+ * You should have received a copy of the GNU General Public License
4267+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4268+ */
4269+
4270+function areSameDay(date1, date2) {
4271+ return date1.getFullYear() == date2.getFullYear()
4272+ && date1.getMonth() == date2.getMonth()
4273+ && date1.getDate() == date2.getDate()
4274+}
4275+
4276+function formatLogDate(timestamp) {
4277+ var today = new Date()
4278+ var date = new Date(timestamp)
4279+ if (areSameDay(today, date)) {
4280+ return Qt.formatTime(timestamp, Qt.DefaultLocaleShortDate)
4281+ } else {
4282+ return Qt.formatDateTime(timestamp, Qt.DefaultLocaleShortDate)
4283+ }
4284+}
4285+
4286+function friendlyDay(timestamp) {
4287+ var date = new Date(timestamp);
4288+ var today = new Date();
4289+ var yesterday = new Date();
4290+ yesterday.setDate(today.getDate()-1);
4291+ if (areSameDay(today, date)) {
4292+ return i18n.tr("Today");
4293+ } else if (areSameDay(yesterday, date)) {
4294+ return i18n.tr("Yesterday");
4295+ } else {
4296+ return Qt.formatDate(date, Qt.DefaultLocaleShortDate);
4297+ }
4298+}
4299+
4300+function formatFriendlyDate(timestamp) {
4301+ return Qt.formatTime(timestamp, Qt.DefaultLocaleShortDate) + " - " + friendlyDay(timestamp);
4302+}
4303+
4304+function formatFriendlyCallDuration(duration) {
4305+ var text = "";
4306+
4307+ var hours = parseInt(Qt.formatTime(duration, "hh"));
4308+ var minutes = parseInt(Qt.formatTime(duration, "mm"));
4309+ var seconds = parseInt(Qt.formatTime(duration, "ss"));
4310+
4311+ if (hours > 0) {
4312+ text = i18n.tr("%1 hour", "%1 hours", hours).arg(hours)
4313+ } else if (minutes > 0) {
4314+ text = i18n.tr("%1 min", "%1 mins", minutes).arg(minutes)
4315+ } else {
4316+ text = i18n.tr("%1 sec", "%1 secs", seconds).arg(seconds)
4317+ }
4318+
4319+ return text;
4320+}
4321
4322=== modified file 'src/qml/dialer-app.qml'
4323--- src/qml/dialer-app.qml 2016-10-19 11:45:45 +0000
4324+++ src/qml/dialer-app.qml 2017-04-05 17:09:12 +0000
4325@@ -16,7 +16,7 @@
4326 * along with this program. If not, see <http://www.gnu.org/licenses/>.
4327 */
4328
4329-import QtQuick 2.0
4330+import QtQuick 2.4
4331 import Qt.labs.settings 1.0
4332
4333 import Ubuntu.Components 1.3
4334@@ -410,11 +410,15 @@
4335 pageStackNormalMode.pop();
4336 }
4337
4338- if (pageStackNormalMode.currentPage && typeof(pageStackNormalMode.currentPage.dialNumber) != 'undefined') {
4339- pageStackNormalMode.currentPage.dialNumber = number;
4340+ var dialerPage = pageStackNormalMode.currentPage
4341+ if (dialerPage && typeof(dialerPage.dialNumber) != 'undefined') {
4342+ dialerPage.dialNumber = number;
4343+ if (accountId) {
4344+ dialerPage.selectAccount(accountId)
4345+ }
4346
4347- if (pageStackNormalMode.currentPage.bottomEdgeItem) {
4348- pageStackNormalMode.currentPage.bottomEdgeItem.collapse()
4349+ if (dialerPage.bottomEdgeItem) {
4350+ dialerPage.bottomEdgeItem.collapse()
4351 }
4352 }
4353 }
4354@@ -481,16 +485,27 @@
4355 PopupUtils.open(Qt.createComponent("Dialogs/SimLockedDialog.qml").createObject(mainView), mainView, properties)
4356 }
4357
4358+ function accountForModem(modemName) {
4359+ var modemAccounts = telepathyHelper.phoneAccounts.displayed
4360+ for (var i in modemAccounts) {
4361+ if (modemAccounts[i].modemName == modemName) {
4362+ return modemAccounts[i]
4363+ }
4364+ }
4365+ return null
4366+ }
4367+
4368 Component.onCompleted: {
4369 i18n.domain = "dialer-app"
4370 i18n.bindtextdomain("dialer-app", i18nDirectory)
4371 pageStackNormalMode.push(Qt.createComponent("DialerPage/DialerPage.qml"))
4372
4373 // when running in windowed mode, do not allow resizing
4374- view.minimumWidth = Qt.binding( function() { return implicitWidth * 0.9; } )
4375- view.maximumWidth = Qt.binding( function() { return implicitWidth * 1.1; } )
4376- view.minimumHeight = Qt.binding( function() { return implicitHeight * 0.9; } )
4377- view.maximumHeight = Qt.binding( function() { return implicitHeight * 1.1; } )
4378+ view.minimumWidth = units.gu(40)
4379+ view.minimumHeight = units.gu(52)
4380+
4381+// view.maximumWidth = Qt.binding( function() { return implicitWidth * 3.0; } )
4382+// view.maximumHeight = Qt.binding( function() { return implicitHeight * 3.0; } )
4383
4384 // if there are calls, even if we don't have info about them yet, push the livecall view
4385 if (callManager.hasCalls) {

Subscribers

People subscribed via source and target branches