Merge lp:~ken-vandine/ubuntu-system-settings/libqofono into lp:ubuntu-system-settings

Proposed by Ken VanDine
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 756
Merged at revision: 790
Proposed branch: lp:~ken-vandine/ubuntu-system-settings/libqofono
Merge into: lp:ubuntu-system-settings
Diff against target: 1797 lines (+399/-1092)
24 files modified
CMakeLists.txt (+0/-1)
debian/control (+1/-1)
plugins/about/PageComponent.qml (+20/-0)
plugins/cellular/ChooseCarrier.qml (+54/-16)
plugins/cellular/PageComponent.qml (+128/-115)
plugins/phone/CMakeLists.txt (+9/-25)
plugins/phone/PageComponent.qml (+17/-6)
plugins/phone/ServiceInfo.qml (+86/-1)
plugins/phone/Services.qml (+14/-4)
plugins/phone/connman.cpp (+0/-78)
plugins/phone/connman.h (+0/-58)
plugins/phone/dateUtils.js (+69/-0)
plugins/phone/networkoperator.cpp (+0/-83)
plugins/phone/networkoperator.h (+0/-71)
plugins/phone/networkregistration.cpp (+0/-207)
plugins/phone/networkregistration.h (+0/-95)
plugins/phone/phone.settings (+1/-2)
plugins/phone/plugin.cpp (+0/-40)
plugins/phone/plugin.h (+0/-36)
plugins/phone/qmldir (+0/-2)
plugins/phone/simmanager.cpp (+0/-84)
plugins/phone/simmanager.h (+0/-58)
plugins/phone/simservice.cpp (+0/-57)
plugins/phone/simservice.h (+0/-52)
To merge this branch: bzr merge lp:~ken-vandine/ubuntu-system-settings/libqofono
Reviewer Review Type Date Requested Status
Sebastien Bacher (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+223736@code.launchpad.net

Commit message

Dropped QML bindings for ofono-qt from the phone plugin and ported to libqofono's QML bindings. Show last time called for each service under SIM services and enabled the call button, to launch the dialer.

Description of the change

Dropped QML bindings for ofono-qt from the phone plugin and ported to libqofono's QML bindings. Show last time called for each service under SIM services and enabled the call button, to launch the dialer.

This branch needs the libqofono package to land in Ubuntu as well as a branch[1] of history-service that adds a get method to the HistoryEventsModel.

1. https://code.launchpad.net/~ken-vandine/history-service/model_tweaks/+merge/223554

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:752
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/937/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1648
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1394
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/129
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/129
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/129/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/129
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1919
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2671
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2671/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9410
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1157
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1561
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1561/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/937/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks, looks good, some small inline comments

jenkins indicates tests are failing as well though, see https://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1919/

"StateNotFoundError: Object not found with name 'Label' and properties {'text': 'my.cool.telco'}."

seems a real error...

review: Needs Fixing
753. By Ken VanDine

use sentence case

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:753
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/943/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1704
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1442
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/135
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/135
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/135/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/135
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1969
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2747
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2747/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9477
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1200
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1611
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1611/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/943/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) :
Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks ken ;-)

754. By Ken VanDine

Fixes in the cellular panel for libqofono

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
755. By Ken VanDine

Merged trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:755
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/950/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1735
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1461
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/142
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/142
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/142/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/142
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1997
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2784
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2784/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9513
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1218
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1643
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1643/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/950/rebuild

review: Approve (continuous-integration)
756. By Ken VanDine

cellular: wrapped the Column with a Flickable

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:756
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/952/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1754
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1474
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/144
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/144
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/144/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/144
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2016
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2814
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2814/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9546
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1230
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1656
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1656/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/952/rebuild

review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Looks good now, thanks

review: Approve
757. By Ken VanDine

Merged 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-05-16 15:26:16 +0000
3+++ CMakeLists.txt 2014-07-10 13:13:41 +0000
4@@ -38,7 +38,6 @@
5 pkg_search_module(UPOWER_GLIB REQUIRED upower-glib)
6 pkg_search_module(LIBNM_GLIB REQUIRED libnm-glib)
7 pkg_search_module(ACCOUNTSSERVICE REQUIRED accountsservice)
8-pkg_search_module(OFONO REQUIRED ofono-qt)
9 pkg_search_module(TIMEZONEMAP REQUIRED timezonemap)
10 pkg_search_module(ICU REQUIRED icu-i18n)
11 pkg_search_module(ANDR_PROP libandroid-properties)
12
13=== modified file 'debian/control'
14--- debian/control 2014-07-09 10:08:27 +0000
15+++ debian/control 2014-07-10 13:13:41 +0000
16@@ -13,7 +13,6 @@
17 libglib2.0-dev (>= 2.37.92),
18 libicu-dev,
19 libnm-glib-dev,
20- libofono-qt-dev,
21 libqmenumodel-dev,
22 libtimezonemap1-dev (>= 0.4.1),
23 libunity-api-dev,
24@@ -55,6 +54,7 @@
25 qtdeclarative5-folderlistmodel-plugin,
26 qml-module-qtmultimedia | qml-module-qtmultimedia-gles,
27 qtdeclarative5-gsettings1.0 (>=0.0+13.10.20130717),
28+ qtdeclarative5-ofono0.2,
29 qtdeclarative5-systeminfo-plugin,
30 qtdeclarative5-ubuntu-content0.1,
31 qtdeclarative5-ubuntu-settings-components (> 0.2),
32
33=== modified file 'plugins/about/PageComponent.qml'
34--- plugins/about/PageComponent.qml 2014-07-03 15:27:56 +0000
35+++ plugins/about/PageComponent.qml 2014-07-10 13:13:41 +0000
36@@ -25,6 +25,7 @@
37 import Ubuntu.Components.ListItems 0.1 as ListItem
38 import Ubuntu.SystemSettings.StorageAbout 1.0
39 import Ubuntu.SystemSettings.Update 1.0
40+import MeeGo.QOfono 0.2
41
42 ItemPage {
43 id: root
44@@ -45,6 +46,15 @@
45 id: updateBackend
46 }
47
48+ OfonoManager {
49+ id: manager
50+ }
51+
52+ OfonoSimManager {
53+ id: sim
54+ modemPath: manager.modems[0]
55+ }
56+
57 Flickable {
58 id: scrollWidget
59 anchors.fill: parent
60@@ -82,6 +92,16 @@
61 }
62
63 ListItem.SingleValue {
64+ id: numberItem
65+ objectName: "numberItem"
66+ text: i18n.tr("Phone number")
67+ property string phoneNumber
68+ phoneNumber: sim.subscriberNumbers.length > 0 ? sim.subscriberNumbers[0] : ""
69+ value: phoneNumber
70+ visible: phoneNumber.length > 0
71+ }
72+
73+ ListItem.SingleValue {
74 id: serialItem
75 objectName: "serialItem"
76 text: i18n.tr("Serial")
77
78=== modified file 'plugins/cellular/ChooseCarrier.qml'
79--- plugins/cellular/ChooseCarrier.qml 2014-02-18 16:13:24 +0000
80+++ plugins/cellular/ChooseCarrier.qml 2014-07-10 13:13:41 +0000
81@@ -22,40 +22,72 @@
82 import SystemSettings 1.0
83 import Ubuntu.Components 0.1
84 import Ubuntu.Components.ListItems 0.1 as ListItem
85-
86+import MeeGo.QOfono 0.2
87
88 ItemPage {
89 title: i18n.tr("Carrier")
90 objectName: "chooseCarrierPage"
91
92 property var netReg
93- property variant operators: netReg.operators
94- property bool scanning: netReg.scanning
95+ property var operators: []
96+ property bool scanning: false
97 property variant operatorNames
98 property variant operatorStatus
99 property int curOp
100+ Component.onCompleted: buildLists();
101
102- onOperatorsChanged: {
103- buildLists();
104+ Connections {
105+ target: netReg
106+ onStatusChanged: {
107+ console.warn("onStatusChanged: " + netReg.status);
108+ if (netReg.status === "registered")
109+ buildLists();
110+ }
111+ onNetworkOperatorsChanged: buildLists();
112+ onScanFinished: scanning = false;
113+ onScanError: {
114+ scanning = false;
115+ console.warn ("onScanError: " + message);
116+ }
117 }
118
119 function buildLists()
120 {
121+ var ops = [];
122 var oN = new Array();
123 var oS = new Array();
124- for (var i in operators)
125- {
126- if (operators[i].status == "forbidden")
127+ for (var i = 0; i < netReg.networkOperators.length; i++) {
128+ var tempOp = netOp.createObject(parent, {"operatorPath": netReg.networkOperators[i]});
129+ if (tempOp.status === "forbidden")
130 continue
131- oN.push(operators[i].name);
132- oS.push(operators[i].status);
133+ oN.push(tempOp.name);
134+ oS.push(tempOp.status);
135+ ops.push(tempOp)
136 }
137 curOp = oS.indexOf("current");
138 operatorNames = oN;
139 operatorStatus = oS;
140- }
141-
142- ListItem.ItemSelector {
143+ operators = ops;
144+ carrierSelector.selectedIndex = curOp;
145+ }
146+
147+ Component {
148+ id: netOp
149+ OfonoNetworkOperator {
150+ onRegisterComplete: {
151+ if (error === OfonoNetworkOperator.NoError)
152+ console.warn("registerComplete: SUCCESS");
153+ else if (error === OfonoNetworkOperator.InProgressError)
154+ console.warn("registerComplete failed with error: " + errorString);
155+ else {
156+ console.warn("registerComplete failed with error: " + errorString + " Falling back to default");
157+ netReg.registration();
158+ }
159+ }
160+ }
161+ }
162+
163+ ListItem.ItemSelector {
164 id: carrierSelector
165 objectName: "carrierSelector"
166 expanded: true
167@@ -65,9 +97,11 @@
168 */
169 enabled: true
170 model: operatorNames
171- selectedIndex: curOp
172 onSelectedIndexChanged: {
173- operators[selectedIndex].registerOp();
174+ if ((selectedIndex !== curOp) && operators[selectedIndex]) {
175+ console.warn("onSelectedIndexChanged status: " + operators[selectedIndex].status);
176+ operators[selectedIndex].registerOperator();
177+ }
178 }
179 }
180
181@@ -77,7 +111,11 @@
182 objectName: "refreshButton"
183 width: parent.width - units.gu(4)
184 text: i18n.tr("Refresh")
185- onTriggered: netReg.scan()
186+ enabled: (netReg.status !== "searching") && (netReg.status !== "denied")
187+ onTriggered: {
188+ scanning = true;
189+ netReg.scan();
190+ }
191 }
192 }
193
194
195=== modified file 'plugins/cellular/PageComponent.qml'
196--- plugins/cellular/PageComponent.qml 2014-07-08 16:17:02 +0000
197+++ plugins/cellular/PageComponent.qml 2014-07-10 13:13:41 +0000
198@@ -22,10 +22,11 @@
199 import SystemSettings 1.0
200 import Ubuntu.Components 0.1
201 import Ubuntu.Components.ListItems 0.1 as ListItem
202-import Ubuntu.SystemSettings.Phone 1.0
203+import MeeGo.QOfono 0.2
204 import QMenuModel 0.1
205
206 ItemPage {
207+ id: root
208 title: i18n.tr("Cellular")
209 objectName: "cellularPage"
210
211@@ -42,132 +43,144 @@
212 }
213 }
214
215- NetworkRegistration {
216+ OfonoManager {
217+ id: manager
218+ }
219+
220+ OfonoSimManager {
221+ id: sim
222+ modemPath: manager.modems[0]
223+ }
224+
225+ OfonoNetworkRegistration {
226 id: netReg
227+ modemPath: manager.modems[0]
228+ onStatusChanged: {
229+ console.warn ("onStatusChanged: " + netReg.status);
230+ }
231 onModeChanged: {
232+ console.warn ("onModeChanged: " + mode);
233 if (mode === "manual")
234 chooseCarrier.selectedIndex = 1;
235 else
236 chooseCarrier.selectedIndex = 0;
237 }
238- Component.onCompleted: {
239- /* NetworkRegistration provides an enum for data technology,
240- * including:
241- * UnknownDataTechnology
242- * GprsDataTechnology
243- * EdgeDataTechnology
244- * UmtsDataTechnology
245- * HspaDataTechnology
246- */
247- if (technology == NetworkRegistration.UnknownDataTechnology)
248- console.log ("Unknown data technology");
249- }
250 }
251
252- ConnMan {
253+ OfonoConnMan {
254 id: connMan
255+ modemPath: manager.modems[0]
256 }
257
258- property string carrierName: netReg.name
259-
260- Column {
261- anchors.left: parent.left
262- anchors.right: parent.right
263-
264- /* TODO: use selector once ofono supports those options (bug #1211804) */
265- ListItem.ItemSelector {
266- id: dataTypeSelector
267- expanded: true
268- visible: showAllUI
269- text: i18n.tr("Cellular data:")
270- model: [i18n.tr("Off"),
271- i18n.tr("2G only (saves battery)"),
272- i18n.tr("2G/3G/4G (faster)")]
273- selectedIndex: !connMan.powered ? 0 : 2
274- onSelectedIndexChanged: {
275- if (selectedIndex == 0)
276- connMan.powered = false;
277- else
278- connMan.powered = true;
279- }
280- }
281-
282- ListItem.Standard {
283- text: i18n.tr("Cellular data")
284- visible: !showAllUI
285- control: Switch {
286- id: dataSwitch
287- checked: connMan.powered
288- onClicked: connMan.powered = checked
289- }
290- }
291-
292- ListItem.Standard {
293- id: dataRoamingItem
294- text: i18n.tr("Data roaming")
295- enabled: dataSwitch.checked
296- control: Switch {
297- id: dataRoamingControl
298- checked: connMan.roamingAllowed
299- onClicked: connMan.roamingAllowed = checked
300- }
301- onEnabledChanged: {
302- if (!enabled)
303- dataRoamingControl.checked = false
304- else
305- dataRoamingControl.checked = Qt.binding(function() {
306- return connMan.roamingAllowed
307- })
308- }
309- }
310-
311- ListItem.SingleValue {
312- text : i18n.tr("Hotspot disabled because Wi-Fi is off.")
313- visible: showAllUI && !hotspotItem.visible
314- }
315-
316- ListItem.SingleValue {
317- id: hotspotItem
318- text: i18n.tr("Wi-Fi hotspot")
319- progression: true
320- onClicked: {
321- pageStack.push(Qt.resolvedUrl("Hotspot.qml"))
322- }
323- visible: showAllUI && (actionGroup.actionObject.valid ? actionGroup.actionObject.state : false)
324- }
325-
326- ListItem.Standard {
327- text: i18n.tr("Data usage statistics")
328- progression: true
329- visible: showAllUI
330- }
331-
332- ListItem.ItemSelector {
333- id: chooseCarrier
334- objectName: "autoChooseCarrierSelector"
335- expanded: true
336- enabled: netReg.mode != "auto-only"
337- text: i18n.tr("Choose carrier:")
338- model: [i18n.tr("Automatically"), i18n.tr("Manually")]
339- selectedIndex: netReg.mode == "manual" ? 1 : 0
340- }
341-
342- ListItem.SingleValue {
343- text: i18n.tr("Carrier")
344- objectName: "chooseCarrier"
345- value: carrierName ? carrierName : i18n.tr("N/A")
346- property bool enabled: chooseCarrier.selectedIndex == 1 // Manually
347- progression: enabled
348- onClicked: {
349- if (enabled)
350- pageStack.push(Qt.resolvedUrl("ChooseCarrier.qml"), {netReg: netReg})
351- }
352- }
353-
354- ListItem.Standard {
355- text: i18n.tr("APN")
356- progression: true
357- visible: showAllUI
358+ Flickable {
359+ anchors.fill: parent
360+ contentWidth: parent.width
361+ contentHeight: contentItem.childrenRect.height
362+ boundsBehavior: (contentHeight > root.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
363+
364+ Column {
365+ anchors.left: parent.left
366+ anchors.right: parent.right
367+
368+ /* TODO: use selector once ofono supports those options (bug #1211804) */
369+ ListItem.ItemSelector {
370+ id: dataTypeSelector
371+ expanded: true
372+ visible: showAllUI
373+ text: i18n.tr("Cellular data:")
374+ model: [i18n.tr("Off"),
375+ i18n.tr("2G only (saves battery)"),
376+ i18n.tr("2G/3G/4G (faster)")]
377+ selectedIndex: !connMan.powered ? 0 : 2
378+ onSelectedIndexChanged: {
379+ if (selectedIndex == 0)
380+ connMan.powered = false;
381+ else
382+ connMan.powered = true;
383+ }
384+ }
385+
386+ ListItem.Standard {
387+ text: i18n.tr("Cellular data")
388+ visible: !showAllUI
389+ control: Switch {
390+ id: dataSwitch
391+ checked: connMan.powered
392+ onClicked: connMan.powered = checked
393+ }
394+ }
395+
396+ ListItem.Standard {
397+ id: dataRoamingItem
398+ text: i18n.tr("Data roaming")
399+ enabled: dataSwitch.checked
400+ control: Switch {
401+ id: dataRoamingControl
402+ checked: connMan.roamingAllowed
403+ onClicked: connMan.roamingAllowed = checked
404+ }
405+ onEnabledChanged: {
406+ if (!enabled)
407+ dataRoamingControl.checked = false
408+ else
409+ dataRoamingControl.checked = Qt.binding(function() {
410+ return connMan.roamingAllowed
411+ })
412+ }
413+ }
414+
415+ ListItem.SingleValue {
416+ text : i18n.tr("Hotspot disabled because Wi-Fi is off.")
417+ visible: showAllUI && !hotspotItem.visible
418+ }
419+
420+ ListItem.SingleValue {
421+ id: hotspotItem
422+ text: i18n.tr("Wi-Fi hotspot")
423+ progression: true
424+ onClicked: {
425+ pageStack.push(Qt.resolvedUrl("Hotspot.qml"))
426+ }
427+ visible: showAllUI && (actionGroup.actionObject.valid ? actionGroup.actionObject.state : false)
428+ }
429+
430+ ListItem.Standard {
431+ text: i18n.tr("Data usage statistics")
432+ progression: true
433+ visible: showAllUI
434+ }
435+
436+ ListItem.ItemSelector {
437+ id: chooseCarrier
438+ objectName: "autoChooseCarrierSelector"
439+ expanded: true
440+ enabled: netReg.mode !== "auto-only"
441+ text: i18n.tr("Choose carrier:")
442+ model: [i18n.tr("Automatically"), i18n.tr("Manually")]
443+ selectedIndex: netReg.mode === "manual" ? 1 : 0
444+ onSelectedIndexChanged: {
445+ if (selectedIndex === 0)
446+ netReg.registration();
447+ }
448+ }
449+
450+ ListItem.SingleValue {
451+ text: i18n.tr("Carrier")
452+ objectName: "chooseCarrier"
453+ value: netReg.name ? netReg.name : i18n.tr("N/A")
454+ property bool enabled: chooseCarrier.selectedIndex === 1 // Manually
455+ progression: enabled
456+ onClicked: {
457+ if (enabled)
458+ pageStack.push(Qt.resolvedUrl("ChooseCarrier.qml"), {netReg: netReg})
459+ }
460+ }
461+
462+ ListItem.Standard {
463+ text: i18n.tr("APN")
464+ progression: true
465+ visible: showAllUI
466+ }
467 }
468 }
469 }
470
471=== modified file 'plugins/phone/CMakeLists.txt'
472--- plugins/phone/CMakeLists.txt 2013-10-22 14:44:44 +0000
473+++ plugins/phone/CMakeLists.txt 2014-07-10 13:13:41 +0000
474@@ -1,34 +1,18 @@
475-include_directories(${OFONO_INCLUDE_DIRS})
476-
477 set(QML_SOURCES
478 CallForwarding.qml
479 CallWaiting.qml
480 PageComponent.qml
481 ServiceInfo.qml
482 Services.qml
483-)
484-
485-add_library(UbuntuPhonePanel MODULE
486- connman.h
487- simservice.h
488- simmanager.h
489- networkoperator.h
490- networkregistration.h
491- plugin.cpp
492- connman.cpp
493- simservice.cpp
494- simmanager.cpp
495- networkoperator.cpp
496- networkregistration.cpp
497- plugin.h
498- ${QML_SOURCES}
499-)
500-qt5_use_modules(UbuntuPhonePanel Qml Quick DBus)
501-target_link_libraries(UbuntuPhonePanel ${OFONO_LDFLAGS})
502-
503-set(PLUG_DIR ${PLUGIN_PRIVATE_MODULE_DIR}/Ubuntu/SystemSettings/Phone)
504-install(TARGETS UbuntuPhonePanel DESTINATION ${PLUG_DIR})
505-install(FILES qmldir DESTINATION ${PLUG_DIR})
506+ dateUtils.js
507+)
508+
509+# We need a dummy target so the QML files show up in Qt Creator
510+# If this plugin gets some C++ sources, remove this.
511+add_custom_target(phone-holder
512+COMMAND echo This is just a dummy.
513+SOURCES ${QML_SOURCES})
514+
515 install(FILES ${QML_SOURCES} DESTINATION ${PLUGIN_QML_DIR}/phone)
516 install(FILES settings-phone.svg DESTINATION ${PLUGIN_MANIFEST_DIR}/icons)
517 install(FILES phone.settings DESTINATION ${PLUGIN_MANIFEST_DIR})
518
519=== modified file 'plugins/phone/PageComponent.qml'
520--- plugins/phone/PageComponent.qml 2013-09-30 15:37:50 +0000
521+++ plugins/phone/PageComponent.qml 2014-07-10 13:13:41 +0000
522@@ -22,21 +22,26 @@
523 import SystemSettings 1.0
524 import Ubuntu.Components 0.1
525 import Ubuntu.Components.ListItems 0.1 as ListItem
526-import Ubuntu.SystemSettings.Phone 1.0
527+import MeeGo.QOfono 0.2
528
529 ItemPage {
530 title: i18n.tr("Phone")
531 property string carrierName: netop.name
532 property string carrierString: carrierName ? carrierName : i18n.tr("SIM")
533
534- NetworkRegistration {
535+ OfonoManager {
536+ id: manager
537+ }
538+
539+ OfonoNetworkRegistration {
540 id: netop;
541- onNameChanged:
542- carrierName = netop.name
543+ modemPath: manager.modems[0]
544+ onNameChanged: carrierName = netop.name
545 }
546
547- SimManager {
548+ OfonoSimManager {
549 id: sim
550+ modemPath: manager.modems[0]
551 }
552
553 Column {
554@@ -44,17 +49,23 @@
555
556 ListItem.Standard {
557 text: i18n.tr("Call forwarding")
558+ /* Hide until implemented */
559+ visible: showAllUI
560 progression: true
561 onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"))
562 }
563
564 ListItem.Standard {
565 text: i18n.tr("Call waiting")
566+ /* Hide until implemented */
567+ visible: showAllUI
568 progression: true
569 onClicked: pageStack.push(Qt.resolvedUrl("CallWaiting.qml"))
570 }
571
572- ListItem.Divider {}
573+ ListItem.Divider {
574+ visible: showAllUI
575+ }
576
577 ListItem.Standard {
578 // TRANSLATORS: %1 is the name of the (network) carrier
579
580=== modified file 'plugins/phone/ServiceInfo.qml'
581--- plugins/phone/ServiceInfo.qml 2013-08-07 19:15:05 +0000
582+++ plugins/phone/ServiceInfo.qml 2014-07-10 13:13:41 +0000
583@@ -22,17 +22,102 @@
584 import SystemSettings 1.0
585 import Ubuntu.Components 0.1
586 import Ubuntu.Components.ListItems 0.1 as ListItem
587+import Ubuntu.History 0.1
588+import "dateUtils.js" as DateUtils
589
590 ItemPage {
591 property string serviceName
592 property string serviceNumber
593- title: serviceName
594+ property string lastTimestamp
595+ title: serviceName
596+
597+ HistoryEventModel {
598+ id: historyEventModel
599+ type: HistoryThreadModel.EventTypeVoice
600+ sort: HistorySort {
601+ sortField: "timestamp"
602+ sortOrder: HistorySort.DescendingOrder
603+ }
604+
605+ property string phoneNumber: serviceNumber
606+ onCountChanged: lastTimestamp = historyEventModel.get(0).timestamp
607+
608+ filter: HistoryUnionFilter {
609+ // FIXME: this is not the best API for this case, but will be changed later
610+ HistoryIntersectionFilter {
611+ HistoryFilter {
612+ property string threadId: historyEventModel.threadIdForParticipants("ofono/ofono/account0",
613+ HistoryThreadModel.EventTypeVoice,
614+ [historyEventModel.phoneNumber],
615+ HistoryThreadModel.MatchPhoneNumber);
616+ filterProperty: "threadId"
617+ filterValue: threadId != "" ? threadId : "something that won't match"
618+ }
619+ HistoryFilter {
620+ filterProperty: "accountId"
621+ filterValue: "ofono/ofono/account0"
622+ }
623+ }
624+
625+ HistoryIntersectionFilter {
626+ HistoryFilter {
627+ property string threadId: historyEventModel.threadIdForParticipants("ofono/ofono/account1",
628+ HistoryThreadModel.EventTypeVoice,
629+ [historyEventModel.phoneNumber],
630+ HistoryThreadModel.MatchPhoneNumber);
631+ filterProperty: "threadId"
632+ filterValue: threadId != "" ? threadId : "something that won't match"
633+ }
634+ HistoryFilter {
635+ filterProperty: "accountId"
636+ filterValue: "ofono/ofono/account1"
637+ }
638+ }
639+ }
640+ }
641+
642+ Column {
643+ anchors {
644+ left: parent.left
645+ right: parent.right
646+ verticalCenter: parent.verticalCenter
647+ }
648+
649+ ListItem.Base {
650+ anchors.left: parent.left
651+ anchors.right: parent.right
652+ height: lastCalledCol.height + units.gu(6)
653+ Column {
654+ id: lastCalledCol
655+ anchors.left: parent.left
656+ anchors.right: parent.right
657+ height: childrenRect.height
658+ spacing: units.gu(2)
659+
660+ Icon {
661+ anchors.horizontalCenter: parent.horizontalCenter
662+ name: "contact"
663+ width: 144
664+ height: width
665+ }
666+
667+ Label {
668+ id: calledLabel
669+ objectName: "calledLabel"
670+ anchors.horizontalCenter: parent.horizontalCenter
671+ visible: lastTimestamp
672+ text: i18n.tr("Last called %1").arg(DateUtils.formatFriendlyDate(lastTimestamp))
673+ }
674+ }
675+ }
676+ }
677
678 ListItem.SingleControl {
679 anchors.bottom: parent.bottom
680 control: Button {
681 width: parent.width - units.gu(4)
682 text: i18n.tr("Call")
683+ onClicked: Qt.openUrlExternally("tel:///" + serviceNumber)
684 }
685 }
686 }
687
688=== modified file 'plugins/phone/Services.qml'
689--- plugins/phone/Services.qml 2013-09-30 15:37:50 +0000
690+++ plugins/phone/Services.qml 2014-07-10 13:13:41 +0000
691@@ -25,20 +25,30 @@
692
693 ItemPage {
694 property string carrierString
695- property var sim
696+ property variant sim
697+ property var names: []
698+
699 // TRANSLATORS: %1 is the name of the (network) carrier
700 title: i18n.tr("%1 Services").arg(carrierString)
701
702+ Component.onCompleted: {
703+ var keys = [];
704+ for (var x in sim.serviceNumbers) {
705+ keys.push(x);
706+ }
707+ names = keys;
708+ }
709+
710 Column {
711 anchors.left: parent.left
712 anchors.right: parent.right
713 Repeater {
714- model: sim.serviceNumbers
715+ model: names
716
717 ListItem.Standard {
718 progression: true
719- text: modelData.name
720- onClicked: pageStack.push(Qt.resolvedUrl("ServiceInfo.qml"), {serviceName: modelData.name, serviceNumber: modelData.value})
721+ text: modelData
722+ onClicked: pageStack.push(Qt.resolvedUrl("ServiceInfo.qml"), {serviceName: modelData, serviceNumber: sim.serviceNumbers[modelData]})
723 }
724 }
725 }
726
727=== removed file 'plugins/phone/connman.cpp'
728--- plugins/phone/connman.cpp 2013-08-09 20:08:28 +0000
729+++ plugins/phone/connman.cpp 1970-01-01 00:00:00 +0000
730@@ -1,78 +0,0 @@
731-/*
732- * Copyright (C) 2013 Canonical Ltd
733- *
734- * This program is free software: you can redistribute it and/or modify
735- * it under the terms of the GNU General Public License version 3 as
736- * published by the Free Software Foundation.
737- *
738- * This program is distributed in the hope that it will be useful,
739- * but WITHOUT ANY WARRANTY; without even the implied warranty of
740- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
741- * GNU General Public License for more details.
742- *
743- * You should have received a copy of the GNU General Public License
744- * along with this program. If not, see <http://www.gnu.org/licenses/>.
745- *
746- * Authors:
747- * Ken VanDine <ken.vandine@canonical.com>
748- *
749-*/
750-
751-#include "connman.h"
752-
753-/* A Wrapper class for OfonoConnMan (ConnectionManager)
754- *
755- * This class provides properties related to data connectivity (not voice)
756- * via the modem
757- */
758-ConnMan::ConnMan()
759-{
760- m = new OfonoConnMan(OfonoModem::AutomaticSelect, QString(), NULL);
761- QObject::connect(m, SIGNAL(roamingAllowedChanged(bool)), this, SLOT(onRoamingAllowedChanged(bool)));
762- m_roam = m->roamingAllowed();
763-
764- QObject::connect(m, SIGNAL(poweredChanged(bool)), this, SLOT(onPoweredChanged(bool)));
765- m_powered = m->powered();
766-}
767-
768-/* Contains whether data roaming is allowed. In the off
769- * setting, if the packet radio registration state
770- * indicates that the modem is roaming, oFono will
771- * automatically detach and no further connection
772- * establishment will be possible.
773- */
774-bool ConnMan::roamingAllowed() const
775-{
776- return m_roam;
777-}
778-
779-void ConnMan::setRoamingAllowed(const bool &st)
780-{
781- m->setRoamingAllowed(st);
782-}
783-
784-void ConnMan::onRoamingAllowedChanged(bool st)
785-{
786- m_roam = st;
787- emit roamingAllowedChanged();
788-}
789-
790-/* Controls whether packet radio use is allowed. Setting
791- * this value to off detaches the modem from the
792- * Packet Domain network.
793- */
794-bool ConnMan::powered() const
795-{
796- return m_powered;
797-}
798-
799-void ConnMan::setPowered(const bool &st)
800-{
801- m->setPowered(st);
802-}
803-
804-void ConnMan::onPoweredChanged(bool st)
805-{
806- m_powered = st;
807- emit poweredChanged();
808-}
809
810=== removed file 'plugins/phone/connman.h'
811--- plugins/phone/connman.h 2013-08-09 16:12:42 +0000
812+++ plugins/phone/connman.h 1970-01-01 00:00:00 +0000
813@@ -1,58 +0,0 @@
814-/*
815- * Copyright (C) 2013 Canonical Ltd
816- *
817- * This program is free software: you can redistribute it and/or modify
818- * it under the terms of the GNU General Public License version 3 as
819- * published by the Free Software Foundation.
820- *
821- * This program is distributed in the hope that it will be useful,
822- * but WITHOUT ANY WARRANTY; without even the implied warranty of
823- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
824- * GNU General Public License for more details.
825- *
826- * You should have received a copy of the GNU General Public License
827- * along with this program. If not, see <http://www.gnu.org/licenses/>.
828- *
829- * Authors:
830- * Ken VanDine <ken.vandine@canonical.com>
831- *
832-*/
833-
834-#ifndef CONNMAN_H
835-#define CONNMAN_H
836-
837-#include <ofonoconnman.h>
838-#include <QDebug>
839-#include <QtCore>
840-#include <QObject>
841-
842-class ConnMan : public QObject
843-{
844- Q_OBJECT
845- Q_PROPERTY(bool roamingAllowed READ roamingAllowed WRITE setRoamingAllowed NOTIFY roamingAllowedChanged)
846- Q_PROPERTY(bool powered READ powered WRITE setPowered NOTIFY poweredChanged)
847-
848-public:
849- ConnMan();
850- bool roamingAllowed() const;
851- void setRoamingAllowed(const bool &st);
852- bool powered() const;
853- void setPowered(const bool &st);
854-
855-signals:
856- void roamingAllowedChanged ();
857- void poweredChanged ();
858-
859-
860-private slots:
861- void onRoamingAllowedChanged(bool st);
862- void onPoweredChanged(bool st);
863-
864-private:
865- OfonoConnMan *m;
866- bool m_roam;
867- bool m_powered;
868-};
869-
870-
871-#endif // CONNMAN_H
872
873=== added file 'plugins/phone/dateUtils.js'
874--- plugins/phone/dateUtils.js 1970-01-01 00:00:00 +0000
875+++ plugins/phone/dateUtils.js 2014-07-10 13:13:41 +0000
876@@ -0,0 +1,69 @@
877+/*
878+ * Copyright 2012-2013 Canonical Ltd.
879+ *
880+ * This file is part of dialer-app.
881+ *
882+ * dialer-app is free software; you can redistribute it and/or modify
883+ * it under the terms of the GNU General Public License as published by
884+ * the Free Software Foundation; version 3.
885+ *
886+ * dialer-app is distributed in the hope that it will be useful,
887+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
888+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
889+ * GNU General Public License for more details.
890+ *
891+ * You should have received a copy of the GNU General Public License
892+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
893+ */
894+
895+function areSameDay(date1, date2) {
896+ return date1.getFullYear() == date2.getFullYear()
897+ && date1.getMonth() == date2.getMonth()
898+ && date1.getDate() == date2.getDate()
899+}
900+
901+function formatLogDate(timestamp) {
902+ var today = new Date()
903+ var date = new Date(timestamp)
904+ if (areSameDay(today, date)) {
905+ return Qt.formatTime(timestamp, Qt.DefaultLocaleShortDate)
906+ } else {
907+ return Qt.formatDateTime(timestamp, Qt.DefaultLocaleShortDate)
908+ }
909+}
910+
911+function friendlyDay(timestamp) {
912+ var date = new Date(timestamp);
913+ var today = new Date();
914+ var yesterday = new Date();
915+ yesterday.setDate(today.getDate()-1);
916+ if (areSameDay(today, date)) {
917+ return i18n.tr("Today");
918+ } else if (areSameDay(yesterday, date)) {
919+ return i18n.tr("Yesterday");
920+ } else {
921+ return Qt.formatDate(date, Qt.DefaultLocaleShortDate);
922+ }
923+}
924+
925+function formatFriendlyDate(timestamp) {
926+ return Qt.formatTime(timestamp, Qt.DefaultLocaleShortDate) + " - " + friendlyDay(timestamp);
927+}
928+
929+function formatFriendlyCallDuration(duration) {
930+ var text = "";
931+
932+ var hours = parseInt(Qt.formatTime(duration, "hh"));
933+ var minutes = parseInt(Qt.formatTime(duration, "mm"));
934+ var seconds = parseInt(Qt.formatTime(duration, "ss"));
935+
936+ if (hours > 0) {
937+ text = i18n.tr("%1 hour", "%1 hours", hours).arg(hours)
938+ } else if (minutes > 0) {
939+ text = i18n.tr("%1 min", "%1 mins", minutes).arg(minutes)
940+ } else {
941+ text = i18n.tr("%1 sec", "%1 secs", seconds).arg(seconds)
942+ }
943+
944+ return text;
945+}
946
947=== removed file 'plugins/phone/networkoperator.cpp'
948--- plugins/phone/networkoperator.cpp 2013-08-09 20:08:28 +0000
949+++ plugins/phone/networkoperator.cpp 1970-01-01 00:00:00 +0000
950@@ -1,83 +0,0 @@
951-/*
952- * Copyright (C) 2013 Canonical Ltd
953- *
954- * This program is free software: you can redistribute it and/or modify
955- * it under the terms of the GNU General Public License version 3 as
956- * published by the Free Software Foundation.
957- *
958- * This program is distributed in the hope that it will be useful,
959- * but WITHOUT ANY WARRANTY; without even the implied warranty of
960- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
961- * GNU General Public License for more details.
962- *
963- * You should have received a copy of the GNU General Public License
964- * along with this program. If not, see <http://www.gnu.org/licenses/>.
965- *
966- * Ken VanDine <ken.vandine@canonical.com>
967- *
968-*/
969-
970-#include "networkoperator.h"
971-
972-NetworkOperator::NetworkOperator(const QString& operatorId, QObject *parent) :
973- QObject(parent)
974-{
975- m_ofonoNetworkOperator = new OfonoNetworkOperator(operatorId);
976-
977- QObject::connect(m_ofonoNetworkOperator,
978- SIGNAL (nameChanged (const QString&)),
979- this,
980- SLOT (operatorNameChanged(const QString&)));
981- m_name = m_ofonoNetworkOperator->name();
982-
983-
984- QObject::connect(m_ofonoNetworkOperator,
985- SIGNAL (statusChanged (const QString&)),
986- this,
987- SLOT (operatorStatusChanged(const QString&)));
988- m_status = m_ofonoNetworkOperator->status();
989-
990- QObject::connect(m_ofonoNetworkOperator,
991- SIGNAL (registerComplete (bool)),
992- this,
993- SLOT (operatorRegisterComplete(bool)));
994-}
995-
996-/* Contains the name of the operator */
997-QString NetworkOperator::name() const
998-{
999- return m_name;
1000-}
1001-
1002-void NetworkOperator::operatorNameChanged(const QString &name)
1003-{
1004- m_name = name;
1005- emit nameChanged(m_name);
1006-}
1007-
1008-/* Contains the status of the operator */
1009-QString NetworkOperator::status() const
1010-{
1011- return m_status;
1012-}
1013-
1014-void NetworkOperator::operatorStatusChanged(const QString &status)
1015-{
1016- m_status = status;
1017- emit statusChanged(m_status);
1018-}
1019-
1020-/* Registers on the operator's network */
1021-void NetworkOperator::registerOp()
1022-{
1023- m_ofonoNetworkOperator->registerOp();
1024-}
1025-
1026-void NetworkOperator::operatorRegisterComplete(bool success)
1027-{
1028- emit registerComplete(success, m_ofonoNetworkOperator->errorMessage());
1029-}
1030-
1031-NetworkOperator::~NetworkOperator()
1032-{
1033-}
1034
1035=== removed file 'plugins/phone/networkoperator.h'
1036--- plugins/phone/networkoperator.h 2013-08-09 19:18:49 +0000
1037+++ plugins/phone/networkoperator.h 1970-01-01 00:00:00 +0000
1038@@ -1,71 +0,0 @@
1039-/*
1040- * Copyright (C) 2013 Canonical Ltd
1041- *
1042- * This program is free software: you can redistribute it and/or modify
1043- * it under the terms of the GNU General Public License version 3 as
1044- * published by the Free Software Foundation.
1045- *
1046- * This program is distributed in the hope that it will be useful,
1047- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1048- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1049- * GNU General Public License for more details.
1050- *
1051- * You should have received a copy of the GNU General Public License
1052- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1053- *
1054- * Authors:
1055- * Ken VanDine <ken.vandine@canonical.com>
1056- *
1057-*/
1058-
1059-#ifndef NETWORKOPERATOR_H
1060-#define NETWORKOPERATOR_H
1061-
1062-#include <QObject>
1063-#include <QtCore>
1064-#include <ofononetworkoperator.h>
1065-
1066-class NetworkOperator : public QObject
1067-{
1068- Q_OBJECT
1069- Q_PROPERTY(QString name READ name NOTIFY nameChanged)
1070- Q_PROPERTY(QString status READ status NOTIFY statusChanged)
1071- Q_ENUMS(CellDataTechnology)
1072-
1073-public:
1074- NetworkOperator(const QString& operatorId, QObject *parent=0);
1075- ~NetworkOperator();
1076-
1077- enum CellDataTechnology {
1078- UnknownDataTechnology = 0,
1079- GprsDataTechnology,
1080- EdgeDataTechnology,
1081- UmtsDataTechnology,
1082- HspaDataTechnology
1083- };
1084-
1085- /* Properties */
1086- QString name() const;
1087- QString status() const;
1088-
1089-public slots:
1090- void registerOp();
1091-
1092-signals:
1093- void nameChanged(const QString &name);
1094- void statusChanged(const QString &status);
1095- void registerComplete(bool success, const QString & errorMessage);
1096-
1097-private:
1098- OfonoNetworkOperator *m_ofonoNetworkOperator;
1099- QString m_name;
1100- QString m_status;
1101-
1102-private Q_SLOTS:
1103- void operatorNameChanged(const QString &name);
1104- void operatorStatusChanged(const QString &status);
1105- void operatorRegisterComplete(bool success);
1106-
1107-};
1108-
1109-#endif // NETWORKOPERATOR_H
1110
1111=== removed file 'plugins/phone/networkregistration.cpp'
1112--- plugins/phone/networkregistration.cpp 2013-08-09 20:08:28 +0000
1113+++ plugins/phone/networkregistration.cpp 1970-01-01 00:00:00 +0000
1114@@ -1,207 +0,0 @@
1115-/*
1116- * Copyright (C) 2013 Canonical Ltd
1117- *
1118- * This program is free software: you can redistribute it and/or modify
1119- * it under the terms of the GNU General Public License version 3 as
1120- * published by the Free Software Foundation.
1121- *
1122- * This program is distributed in the hope that it will be useful,
1123- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1124- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1125- * GNU General Public License for more details.
1126- *
1127- * You should have received a copy of the GNU General Public License
1128- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1129- *
1130- * Ken VanDine <ken.vandine@canonical.com>
1131- *
1132-*/
1133-
1134-#include "networkoperator.h"
1135-#include "networkregistration.h"
1136-
1137-/* A Wrapper class for OfonoNetworkRegistration
1138- *
1139- * This class provides properties and functions related to
1140- * registration on the cellular network.
1141- */
1142-NetworkRegistration::NetworkRegistration(QObject *parent) :
1143- QObject(parent)
1144-{
1145- m_ofonoNetworkRegistration = new OfonoNetworkRegistration(OfonoModem::AutomaticSelect, QString(), this);
1146-
1147- QObject::connect(m_ofonoNetworkRegistration,
1148- SIGNAL (nameChanged (const QString&)),
1149- this,
1150- SLOT (operatorNameChanged(const QString&)));
1151- m_name = m_ofonoNetworkRegistration->name();
1152-
1153- QObject::connect(m_ofonoNetworkRegistration,
1154- SIGNAL (statusChanged (const QString&)),
1155- this,
1156- SLOT (operatorStatusChanged(const QString&)));
1157- m_status = m_ofonoNetworkRegistration->status();
1158-
1159- QObject::connect(m_ofonoNetworkRegistration,
1160- SIGNAL (modeChanged (const QString&)),
1161- this,
1162- SLOT (operatorModeChanged(const QString&)));
1163- m_mode = m_ofonoNetworkRegistration->mode();
1164-
1165- QObject::connect(m_ofonoNetworkRegistration,
1166- SIGNAL (technologyChanged (const QString&)),
1167- this,
1168- SLOT (operatorTechnologyChanged(const QString&)));
1169- m_technology = technologyToInt(m_ofonoNetworkRegistration->technology());
1170-
1171- QObject::connect(m_ofonoNetworkRegistration,
1172- SIGNAL (getOperatorsComplete (bool, const QStringList&)),
1173- this,
1174- SLOT (operatorsUpdated(bool, const QStringList&)));
1175- QObject::connect(m_ofonoNetworkRegistration,
1176- SIGNAL (scanComplete (bool, const QStringList&)),
1177- this,
1178- SLOT (operatorsUpdated(bool, const QStringList&)));
1179- /* Populate the cache of operators */
1180- m_ofonoNetworkRegistration->getOperators();
1181-}
1182-
1183-/* A QList<QObject*> of NetworkOperator instances
1184- *
1185- * This list is cached, to force a refresh you must call the scan function
1186- */
1187-QVariant NetworkRegistration::operators() const
1188-{
1189- return QVariant::fromValue(m_operators);
1190-}
1191-
1192-void NetworkRegistration::populateOperators (QStringList oplist)
1193-{
1194- m_operators.clear();
1195- foreach(QString i, oplist)
1196- {
1197- m_operators.append(new NetworkOperator(i));
1198- }
1199-}
1200-
1201-void NetworkRegistration::operatorsUpdated(bool success, const QStringList &oplist)
1202-{
1203- this->setScanning(false);
1204- if (success)
1205- {
1206- populateOperators(oplist);
1207- emit operatorsChanged();
1208- }
1209-}
1210-
1211-/* Scans cellular network for available operators
1212- *
1213- * Important note: While scanning is in progress, all
1214- * connectivity is disabled.
1215- *
1216- */
1217-void NetworkRegistration::scan()
1218-{
1219- this->setScanning(true);
1220- m_ofonoNetworkRegistration->scan();
1221-}
1222-
1223-void NetworkRegistration::getOperators()
1224-{
1225- m_ofonoNetworkRegistration->getOperators();
1226-}
1227-
1228-/* Converts the technology provided from ofono as a string to an enum.
1229- * The possible values from ofono are: "gsm", "edge", "umts", "hspa", "lte"
1230- */
1231-NetworkRegistration::CellDataTechnology technologyToInt(const QString &technology)
1232-{
1233- if (technology == QString(QStringLiteral("gprs")))
1234- return NetworkRegistration::GprsDataTechnology;
1235- else if (technology == QString(QStringLiteral("edge")))
1236- return NetworkRegistration::EdgeDataTechnology;
1237- else if (technology == QString(QStringLiteral("umts")))
1238- return NetworkRegistration::UmtsDataTechnology;
1239- else if (technology == QString(QStringLiteral("hspa")))
1240- return NetworkRegistration::HspaDataTechnology;
1241- return NetworkRegistration::UnknownDataTechnology;
1242-}
1243-
1244-/* Contains the name of the operator currently register */
1245-QString NetworkRegistration::name() const
1246-{
1247- return m_name;
1248-}
1249-
1250-void NetworkRegistration::operatorNameChanged(const QString &name)
1251-{
1252- m_name = name;
1253- emit nameChanged(m_name);
1254-}
1255-
1256-/* The current registration status of a modem. */
1257-QString NetworkRegistration::status() const
1258-{
1259- return m_status;
1260-}
1261-
1262-void NetworkRegistration::operatorStatusChanged(const QString &status)
1263-{
1264- m_status = status;
1265- emit statusChanged(m_status);
1266-}
1267-
1268-/* The network registration mode, possible values include: "auto",
1269- * "auto-only", and "manual". The mode changes from "auto" to
1270- * "manual" when registerOp is called on an operator.
1271- */
1272-QString NetworkRegistration::mode() const
1273-{
1274- return m_mode;
1275-}
1276-
1277-void NetworkRegistration::operatorModeChanged(const QString &mode)
1278-{
1279- m_mode = mode;
1280- emit modeChanged(m_mode);
1281-}
1282-
1283-/* Contains the enum of the technology of the current network.
1284- *
1285- * The possible values are:
1286- * UnknownDataTechnology
1287- * GprsDataTechnology
1288- * EdgeDataTechnology
1289- * UmtsDataTechnology
1290- * HspaDataTechnology
1291- *
1292- */
1293-NetworkRegistration::CellDataTechnology NetworkRegistration::technology() const
1294-{
1295- return m_technology;
1296-}
1297-
1298-void NetworkRegistration::operatorTechnologyChanged(const QString &technology)
1299-{
1300- m_technology = technologyToInt(technology);
1301- emit technologyChanged(m_technology);
1302-}
1303-
1304-/* bool to show if there is a scan in progress */
1305-bool NetworkRegistration::scanning() const
1306-{
1307- return m_scanning;
1308-}
1309-
1310-void NetworkRegistration::setScanning(bool scanning)
1311-{
1312- if (scanning != m_scanning)
1313- {
1314- m_scanning = scanning;
1315- emit scanningChanged();
1316- }
1317-}
1318-
1319-NetworkRegistration::~NetworkRegistration()
1320-{
1321-}
1322
1323=== removed file 'plugins/phone/networkregistration.h'
1324--- plugins/phone/networkregistration.h 2013-08-09 19:18:49 +0000
1325+++ plugins/phone/networkregistration.h 1970-01-01 00:00:00 +0000
1326@@ -1,95 +0,0 @@
1327-/*
1328- * Copyright (C) 2013 Canonical Ltd
1329- *
1330- * This program is free software: you can redistribute it and/or modify
1331- * it under the terms of the GNU General Public License version 3 as
1332- * published by the Free Software Foundation.
1333- *
1334- * This program is distributed in the hope that it will be useful,
1335- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1336- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1337- * GNU General Public License for more details.
1338- *
1339- * You should have received a copy of the GNU General Public License
1340- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1341- *
1342- * Authors:
1343- * Ken VanDine <ken.vandine@canonical.com>
1344- *
1345-*/
1346-
1347-#ifndef NETWORKREGISTRATION_H
1348-#define NETWORKREGISTRATION_H
1349-
1350-#include <QObject>
1351-#include <QtCore>
1352-#include "networkoperator.h"
1353-#include <ofononetworkregistration.h>
1354-
1355-class NetworkRegistration : public QObject
1356-{
1357- Q_OBJECT
1358- Q_PROPERTY(QString name READ name NOTIFY nameChanged)
1359- Q_PROPERTY(QString status READ status NOTIFY statusChanged)
1360- Q_PROPERTY(QString mode READ mode NOTIFY modeChanged)
1361- Q_PROPERTY(int technology READ technology NOTIFY technologyChanged)
1362- Q_PROPERTY(QVariant operators READ operators NOTIFY operatorsChanged)
1363- Q_PROPERTY(bool scanning READ scanning WRITE setScanning NOTIFY scanningChanged)
1364-
1365- Q_ENUMS(CellDataTechnology)
1366-
1367-public:
1368- explicit NetworkRegistration(QObject *parent = 0);
1369- ~NetworkRegistration();
1370-
1371- enum CellDataTechnology {
1372- UnknownDataTechnology = 0,
1373- GprsDataTechnology,
1374- EdgeDataTechnology,
1375- UmtsDataTechnology,
1376- HspaDataTechnology
1377- };
1378-
1379- /* Properties */
1380- QString name() const;
1381- QString status() const;
1382- QString mode() const;
1383- QVariant operators() const;
1384- CellDataTechnology technology() const;
1385- bool scanning() const;
1386-
1387-public slots:
1388- void getOperators();
1389- void scan();
1390- void setScanning(bool scanning);
1391-
1392-signals:
1393- void nameChanged(const QString &name);
1394- void statusChanged(const QString &status);
1395- void modeChanged(const QString &mode);
1396- void technologyChanged(const CellDataTechnology &technology);
1397- void operatorsChanged();
1398- void scanningChanged();
1399-
1400-private:
1401- OfonoNetworkRegistration *m_ofonoNetworkRegistration;
1402- QString m_name;
1403- QString m_status;
1404- QString m_mode;
1405- QList<QObject*> m_operators;
1406- CellDataTechnology m_technology;
1407- bool m_scanning;
1408- void populateOperators(QStringList);
1409-
1410-
1411-private Q_SLOTS:
1412- void operatorNameChanged(const QString &name);
1413- void operatorStatusChanged(const QString &status);
1414- void operatorModeChanged(const QString &status);
1415- void operatorTechnologyChanged(const QString &technology);
1416- void operatorsUpdated(bool success, const QStringList &oplist);
1417-};
1418-
1419-NetworkRegistration::CellDataTechnology technologyToInt(const QString &technology);
1420-
1421-#endif // NETWORKREGISTRATION_H
1422
1423=== modified file 'plugins/phone/phone.settings'
1424--- plugins/phone/phone.settings 2014-04-09 13:38:34 +0000
1425+++ plugins/phone/phone.settings 2014-07-10 13:13:41 +0000
1426@@ -13,6 +13,5 @@
1427 ],
1428 "page-component": "PageComponent.qml",
1429 "has-dynamic-keywords": false,
1430- "has-dynamic-visibility": false,
1431- "hide-by-default": true
1432+ "has-dynamic-visibility": false
1433 }
1434
1435=== removed file 'plugins/phone/plugin.cpp'
1436--- plugins/phone/plugin.cpp 2013-08-07 17:58:12 +0000
1437+++ plugins/phone/plugin.cpp 1970-01-01 00:00:00 +0000
1438@@ -1,40 +0,0 @@
1439-/*
1440- * Copyright (C) 2013 Canonical Ltd
1441- *
1442- * This program is free software: you can redistribute it and/or modify
1443- * it under the terms of the GNU General Public License version 3 as
1444- * published by the Free Software Foundation.
1445- *
1446- * This program is distributed in the hope that it will be useful,
1447- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1448- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1449- * GNU General Public License for more details.
1450- *
1451- * You should have received a copy of the GNU General Public License
1452- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1453- *
1454- * Authors:
1455- * Iain Lane <iain.lane@canonical.com>
1456- *
1457-*/
1458-
1459-#include <QtQml>
1460-#include <QtQml/QQmlContext>
1461-#include "plugin.h"
1462-#include "connman.h"
1463-#include "simmanager.h"
1464-#include "networkregistration.h"
1465-
1466-void BackendPlugin::registerTypes(const char *uri)
1467-{
1468- Q_ASSERT(uri == QLatin1String("Ubuntu.SystemSettings.Phone"));
1469-
1470- qmlRegisterType<SimManager>(uri, 1, 0, "SimManager");
1471- qmlRegisterType<NetworkRegistration>(uri, 1, 0, "NetworkRegistration");
1472- qmlRegisterType<ConnMan>(uri, 1, 0, "ConnMan");
1473-}
1474-
1475-void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
1476-{
1477- QQmlExtensionPlugin::initializeEngine(engine, uri);
1478-}
1479
1480=== removed file 'plugins/phone/plugin.h'
1481--- plugins/phone/plugin.h 2013-07-26 21:04:38 +0000
1482+++ plugins/phone/plugin.h 1970-01-01 00:00:00 +0000
1483@@ -1,36 +0,0 @@
1484-/*
1485- * Copyright (C) 2013 Canonical Ltd
1486- *
1487- * This program is free software: you can redistribute it and/or modify
1488- * it under the terms of the GNU General Public License version 3 as
1489- * published by the Free Software Foundation.
1490- *
1491- * This program is distributed in the hope that it will be useful,
1492- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1493- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1494- * GNU General Public License for more details.
1495- *
1496- * You should have received a copy of the GNU General Public License
1497- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1498- *
1499- * Authors:
1500- * Iain Lane <iain.lane@canonical.com>
1501- *
1502-*/
1503-
1504-#ifndef PLUGIN_H
1505-#define PLUGIN_H
1506-
1507-#include <QtQml/QQmlEngine>
1508-#include <QtQml/QQmlExtensionPlugin>
1509-
1510-class BackendPlugin : public QQmlExtensionPlugin
1511-{
1512- Q_OBJECT
1513- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
1514-
1515-public:
1516- void registerTypes(const char *uri);
1517- void initializeEngine(QQmlEngine *engine, const char *uri);
1518-};
1519-#endif // PLUGIN_H
1520
1521=== removed file 'plugins/phone/qmldir'
1522--- plugins/phone/qmldir 2013-07-27 11:55:20 +0000
1523+++ plugins/phone/qmldir 1970-01-01 00:00:00 +0000
1524@@ -1,2 +0,0 @@
1525-module Ubuntu.SystemSettings.Phone
1526-plugin UbuntuPhonePanel
1527
1528=== removed file 'plugins/phone/simmanager.cpp'
1529--- plugins/phone/simmanager.cpp 2013-08-09 20:08:28 +0000
1530+++ plugins/phone/simmanager.cpp 1970-01-01 00:00:00 +0000
1531@@ -1,84 +0,0 @@
1532-/*
1533- * Copyright (C) 2013 Canonical Ltd
1534- *
1535- * This program is free software: you can redistribute it and/or modify
1536- * it under the terms of the GNU General Public License version 3 as
1537- * published by the Free Software Foundation.
1538- *
1539- * This program is distributed in the hope that it will be useful,
1540- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1541- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1542- * GNU General Public License for more details.
1543- *
1544- * You should have received a copy of the GNU General Public License
1545- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1546- *
1547- * Ken VanDine <ken.vandine@canonical.com>
1548- *
1549-*/
1550-
1551-#include "simmanager.h"
1552-#include "simservice.h"
1553-
1554-SimManager::SimManager(QObject *parent) :
1555- QObject(parent)
1556-{
1557- m_ofonoSimManager = new OfonoSimManager(OfonoModem::AutomaticSelect, QString(), this);
1558- m_present = m_ofonoSimManager->present();
1559-
1560- populateServiceNumbers(m_ofonoServiceNumbers);
1561- QObject::connect(m_ofonoSimManager,
1562- SIGNAL (serviceNumbersChanged (const OfonoServiceNumbers&)),
1563- this,
1564- SLOT (simServiceNumbersChanged (const OfonoServiceNumbers&)));
1565-
1566- QObject::connect(m_ofonoSimManager,
1567- SIGNAL (presenceChanged (bool)),
1568- this,
1569- SLOT (simPresenceChanged (bool)));
1570-}
1571-
1572-void SimManager::populateServiceNumbers (OfonoServiceNumbers sn)
1573-{
1574-
1575- if (m_ofonoSimManager->modem()->isValid())
1576- {
1577- m_serviceNumbers.clear();
1578- if (sn.isEmpty())
1579- m_ofonoServiceNumbers = m_ofonoSimManager->serviceNumbers();
1580- else
1581- m_ofonoServiceNumbers = sn;
1582-
1583- QMapIterator<QString, QString> i(m_ofonoServiceNumbers);
1584- while (i.hasNext()) {
1585- i.next();
1586- m_serviceNumbers.append(new SimService(i.key(), i.value()));
1587- }
1588- }
1589-}
1590-
1591-bool SimManager::present() const
1592-{
1593- return m_present;
1594-}
1595-
1596-QVariant SimManager::serviceNumbers()
1597-{
1598- return QVariant::fromValue(m_serviceNumbers);
1599-}
1600-
1601-void SimManager::simPresenceChanged(bool ispresent)
1602-{
1603- m_present = ispresent;
1604- emit presenceChanged(m_present);
1605-}
1606-
1607-void SimManager::simServiceNumbersChanged(OfonoServiceNumbers sn)
1608-{
1609- populateServiceNumbers(sn);
1610- emit serviceNumbersChanged();
1611-}
1612-
1613-SimManager::~SimManager()
1614-{
1615-}
1616
1617=== removed file 'plugins/phone/simmanager.h'
1618--- plugins/phone/simmanager.h 2013-08-01 16:16:28 +0000
1619+++ plugins/phone/simmanager.h 1970-01-01 00:00:00 +0000
1620@@ -1,58 +0,0 @@
1621-/*
1622- * Copyright (C) 2013 Canonical Ltd
1623- *
1624- * This program is free software: you can redistribute it and/or modify
1625- * it under the terms of the GNU General Public License version 3 as
1626- * published by the Free Software Foundation.
1627- *
1628- * This program is distributed in the hope that it will be useful,
1629- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1630- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1631- * GNU General Public License for more details.
1632- *
1633- * You should have received a copy of the GNU General Public License
1634- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1635- *
1636- * Authors:
1637- * Ken VanDine <ken.vandine@canonical.com>
1638- *
1639-*/
1640-
1641-#ifndef SIMMANAGER_H
1642-#define SIMMANAGER_H
1643-
1644-#include <QObject>
1645-#include <QtCore>
1646-#include <ofonosimmanager.h>
1647-
1648-class SimManager : public QObject
1649-{
1650- Q_OBJECT
1651- Q_PROPERTY ( QVariant serviceNumbers READ serviceNumbers NOTIFY serviceNumbersChanged )
1652- Q_PROPERTY ( bool present READ present NOTIFY presenceChanged )
1653-
1654-public:
1655- explicit SimManager(QObject *parent = 0);
1656- ~SimManager();
1657-
1658- /* Properties */
1659- QVariant serviceNumbers();
1660- bool present() const;
1661-
1662-signals:
1663- void serviceNumbersChanged();
1664- void presenceChanged(bool ispresent);
1665-
1666-private:
1667- QList<QObject*> m_serviceNumbers;
1668- OfonoServiceNumbers m_ofonoServiceNumbers;
1669- OfonoSimManager *m_ofonoSimManager;
1670- bool m_present;
1671- void populateServiceNumbers(OfonoServiceNumbers);
1672-
1673-private Q_SLOTS:
1674- void simServiceNumbersChanged(OfonoServiceNumbers sn);
1675- void simPresenceChanged(bool ispresent);
1676-};
1677-
1678-#endif // SIMMANAGER_H
1679
1680=== removed file 'plugins/phone/simservice.cpp'
1681--- plugins/phone/simservice.cpp 2013-07-29 19:18:15 +0000
1682+++ plugins/phone/simservice.cpp 1970-01-01 00:00:00 +0000
1683@@ -1,57 +0,0 @@
1684-/*
1685- * Copyright (C) 2013 Canonical Ltd
1686- *
1687- * This program is free software: you can redistribute it and/or modify
1688- * it under the terms of the GNU General Public License version 3 as
1689- * published by the Free Software Foundation.
1690- *
1691- * This program is distributed in the hope that it will be useful,
1692- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1693- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1694- * GNU General Public License for more details.
1695- *
1696- * You should have received a copy of the GNU General Public License
1697- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1698- *
1699- * Authors:
1700- * Ken VanDine <ken.vandine@canonical.com>
1701- *
1702-*/
1703-
1704-#include "simservice.h"
1705-
1706-SimService::SimService(QObject *parent)
1707- : QObject(parent)
1708-{
1709-}
1710-
1711-SimService::SimService(const QString &name, const QString &value, QObject *parent)
1712- : QObject(parent), m_name(name), m_value(value)
1713-{
1714-}
1715-
1716-QString SimService::name() const
1717-{
1718- return m_name;
1719-}
1720-
1721-void SimService::setName(const QString &name)
1722-{
1723- if (name != m_name) {
1724- m_name = name;
1725- emit nameChanged();
1726- }
1727-}
1728-
1729-QString SimService::value() const
1730-{
1731- return m_value;
1732-}
1733-
1734-void SimService::setValue(const QString &value)
1735-{
1736- if (value != m_value) {
1737- m_value = value;
1738- emit valueChanged();
1739- }
1740-}
1741
1742=== removed file 'plugins/phone/simservice.h'
1743--- plugins/phone/simservice.h 2013-07-29 19:18:15 +0000
1744+++ plugins/phone/simservice.h 1970-01-01 00:00:00 +0000
1745@@ -1,52 +0,0 @@
1746-/*
1747- * Copyright (C) 2013 Canonical Ltd
1748- *
1749- * This program is free software: you can redistribute it and/or modify
1750- * it under the terms of the GNU General Public License version 3 as
1751- * published by the Free Software Foundation.
1752- *
1753- * This program is distributed in the hope that it will be useful,
1754- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1755- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1756- * GNU General Public License for more details.
1757- *
1758- * You should have received a copy of the GNU General Public License
1759- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1760- *
1761- * Authors:
1762- * Ken VanDine <ken.vandine@canonical.com>
1763- *
1764-*/
1765-
1766-#ifndef SIMSERVICE_H
1767-#define SIMSERVICE_H
1768-
1769-#include <QObject>
1770-
1771-class SimService : public QObject
1772-{
1773- Q_OBJECT
1774-
1775- Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
1776- Q_PROPERTY(QString value READ value WRITE setValue NOTIFY valueChanged)
1777-
1778-public:
1779- SimService(QObject *parent=0);
1780- SimService(const QString &name, const QString &value, QObject *parent=0);
1781-
1782- QString name() const;
1783- void setName(const QString &name);
1784-
1785- QString value() const;
1786- void setValue(const QString &value);
1787-
1788-signals:
1789- void nameChanged();
1790- void valueChanged();
1791-
1792-private:
1793- QString m_name;
1794- QString m_value;
1795-};
1796-
1797-#endif // SIMSERVICE_H

Subscribers

People subscribed via source and target branches