Merge lp:~jonas-drange/ubuntu-system-settings/rtm-techswitch into lp:ubuntu-system-settings/rtm-14.09
- rtm-techswitch
- Merge into rtm-14.09
Status: | Merged |
---|---|
Approved by: | Ken VanDine |
Approved revision: | 987 |
Merged at revision: | 989 |
Proposed branch: | lp:~jonas-drange/ubuntu-system-settings/rtm-techswitch |
Merge into: | lp:ubuntu-system-settings/rtm-14.09 |
Diff against target: |
871 lines (+413/-98) 18 files modified
debian/control (+1/-1) plugins/about/PageComponent.qml (+11/-6) plugins/cellular/CMakeLists.txt (+2/-0) plugins/cellular/Components/DataMultiSim.qml (+10/-2) plugins/cellular/Components/MultiSim.qml (+48/-23) plugins/cellular/Components/RadioSingleSim.qml (+43/-13) plugins/cellular/Components/Sim.qml (+26/-3) plugins/cellular/Components/SingleSim.qml (+4/-0) plugins/cellular/PageComponent.qml (+80/-16) plugins/cellular/connectivity.cpp (+49/-0) plugins/cellular/connectivity.h (+35/-0) plugins/cellular/plugin.cpp (+11/-0) plugins/cellular/sims.js (+21/-0) plugins/phone/PageComponent.qml (+4/-14) plugins/phone/sims.js (+21/-0) plugins/security-privacy/PageComponent.qml (+8/-19) plugins/security-privacy/sims.js (+25/-0) tests/autopilot/ubuntu_system_settings/tests/__init__.py (+14/-1) |
To merge this branch: | bzr merge lp:~jonas-drange/ubuntu-system-settings/rtm-techswitch |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ken VanDine | Approve | ||
PS Jenkins bot | continuous-integration | Needs Fixing | |
Review via email: mp+248811@code.launchpad.net |
Commit message
[cellular] using libqofono-0.7 and including functionality for enabling users to change what modem has 3G
Description of the change
(included https:/
[cellular] using libqofono-0.7 and including functionality for enabling users to change what modem has 3G
PS Jenkins bot (ps-jenkins) wrote : | # |
- 986. By Jonas G. Drange
-
fix dep
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:986
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 987. By Jonas G. Drange
-
need u-s-s module for title
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:987
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ken VanDine (ken-vandine) wrote : | # |
Thanks, looks good.
Preview Diff
1 | === modified file 'debian/control' | |||
2 | --- debian/control 2015-01-30 18:36:21 +0000 | |||
3 | +++ debian/control 2015-02-09 14:18:57 +0000 | |||
4 | @@ -68,7 +68,7 @@ | |||
5 | 68 | qml-module-qtmultimedia | qml-module-qtmultimedia-gles, | 68 | qml-module-qtmultimedia | qml-module-qtmultimedia-gles, |
6 | 69 | qml-module-ubuntu-connectivity, | 69 | qml-module-ubuntu-connectivity, |
7 | 70 | qtdeclarative5-gsettings1.0 (>=0.1+14.10.20140801.1), | 70 | qtdeclarative5-gsettings1.0 (>=0.1+14.10.20140801.1), |
9 | 71 | qtdeclarative5-ofono0.2 (>=0.53), | 71 | qtdeclarative5-ofono0.2 (>=0.70~), |
10 | 72 | qtdeclarative5-systeminfo-plugin, | 72 | qtdeclarative5-systeminfo-plugin, |
11 | 73 | qtdeclarative5-ubuntu-content1, | 73 | qtdeclarative5-ubuntu-content1, |
12 | 74 | qtdeclarative5-ubuntu-settings-components (>> 0.2), | 74 | qtdeclarative5-ubuntu-settings-components (>> 0.2), |
13 | 75 | 75 | ||
14 | === modified file 'plugins/about/PageComponent.qml' | |||
15 | --- plugins/about/PageComponent.qml 2015-01-16 15:27:56 +0000 | |||
16 | +++ plugins/about/PageComponent.qml 2015-02-09 14:18:57 +0000 | |||
17 | @@ -33,7 +33,7 @@ | |||
18 | 33 | 33 | ||
19 | 34 | title: i18n.tr("About this phone") | 34 | title: i18n.tr("About this phone") |
20 | 35 | flickable: scrollWidget | 35 | flickable: scrollWidget |
22 | 36 | property var modemsSorted: manager.modems.slice(0).sort() | 36 | property var modemsSorted: [] |
23 | 37 | 37 | ||
24 | 38 | UbuntuStorageAboutPanel { | 38 | UbuntuStorageAboutPanel { |
25 | 39 | id: backendInfos | 39 | id: backendInfos |
26 | @@ -49,11 +49,16 @@ | |||
27 | 49 | 49 | ||
28 | 50 | OfonoManager { | 50 | OfonoManager { |
29 | 51 | id: manager | 51 | id: manager |
35 | 52 | Component.onCompleted: { | 52 | onModemsChanged: { |
36 | 53 | if (manager.modems.length === 1) { | 53 | root.modemsSorted = modems.slice(0).sort(); |
37 | 54 | phoneNumbers.setSource("PhoneNumber.qml", {path: manager.modems[0]}) | 54 | if (modems.length === 1) { |
38 | 55 | } else if (manager.modems.length > 1) { | 55 | phoneNumbers.setSource("PhoneNumber.qml", { |
39 | 56 | phoneNumbers.setSource("PhoneNumbers.qml", {paths: modemsSorted}) | 56 | path: manager.modems[0] |
40 | 57 | }); | ||
41 | 58 | } else if (modems.length > 1) { | ||
42 | 59 | phoneNumbers.setSource("PhoneNumbers.qml", { | ||
43 | 60 | paths: root.modemsSorted | ||
44 | 61 | }); | ||
45 | 57 | } | 62 | } |
46 | 58 | } | 63 | } |
47 | 59 | } | 64 | } |
48 | 60 | 65 | ||
49 | === modified file 'plugins/cellular/CMakeLists.txt' | |||
50 | --- plugins/cellular/CMakeLists.txt 2014-12-16 16:22:29 +0000 | |||
51 | +++ plugins/cellular/CMakeLists.txt 2015-02-09 14:18:57 +0000 | |||
52 | @@ -24,6 +24,8 @@ | |||
53 | 24 | hotspotmanager.h | 24 | hotspotmanager.h |
54 | 25 | ofonoactivator.cpp | 25 | ofonoactivator.cpp |
55 | 26 | ofonoactivator.h | 26 | ofonoactivator.h |
56 | 27 | connectivity.cpp | ||
57 | 28 | connectivity.h | ||
58 | 27 | nm_manager_proxy.h | 29 | nm_manager_proxy.h |
59 | 28 | nm_settings_proxy.h | 30 | nm_settings_proxy.h |
60 | 29 | nm_settings_connection_proxy.h | 31 | nm_settings_connection_proxy.h |
61 | 30 | 32 | ||
62 | === modified file 'plugins/cellular/Components/DataMultiSim.qml' | |||
63 | --- plugins/cellular/Components/DataMultiSim.qml 2014-11-18 20:13:35 +0000 | |||
64 | +++ plugins/cellular/Components/DataMultiSim.qml 2015-02-09 14:18:57 +0000 | |||
65 | @@ -23,6 +23,8 @@ | |||
66 | 23 | 23 | ||
67 | 24 | Column { | 24 | Column { |
68 | 25 | 25 | ||
69 | 26 | property string prevOnlineModem: parent.prevOnlineModem | ||
70 | 27 | |||
71 | 26 | function getNameFromIndex (index) { | 28 | function getNameFromIndex (index) { |
72 | 27 | if (index === 0) { | 29 | if (index === 0) { |
73 | 28 | return i18n.tr("Off"); | 30 | return i18n.tr("Off"); |
74 | @@ -50,8 +52,14 @@ | |||
75 | 50 | objectName: "use" + modelData | 52 | objectName: "use" + modelData |
76 | 51 | text: getNameFromIndex(index) | 53 | text: getNameFromIndex(index) |
77 | 52 | } | 54 | } |
80 | 53 | selectedIndex: [true, sims[0].connMan.powered, sims[1].connMan.powered] | 55 | selectedIndex: { |
81 | 54 | .lastIndexOf(true) | 56 | if (prevOnlineModem) { |
82 | 57 | return model.indexOf(prevOnlineModem); | ||
83 | 58 | } else { | ||
84 | 59 | return [true, sims[0].connMan.powered, sims[1].connMan.powered] | ||
85 | 60 | .lastIndexOf(true); | ||
86 | 61 | } | ||
87 | 62 | } | ||
88 | 55 | 63 | ||
89 | 56 | onDelegateClicked: { | 64 | onDelegateClicked: { |
90 | 57 | // power all sims on or off | 65 | // power all sims on or off |
91 | 58 | 66 | ||
92 | === modified file 'plugins/cellular/Components/MultiSim.qml' | |||
93 | --- plugins/cellular/Components/MultiSim.qml 2014-12-16 16:22:29 +0000 | |||
94 | +++ plugins/cellular/Components/MultiSim.qml 2015-02-09 14:18:57 +0000 | |||
95 | @@ -19,6 +19,7 @@ | |||
96 | 19 | */ | 19 | */ |
97 | 20 | import QtQuick 2.0 | 20 | import QtQuick 2.0 |
98 | 21 | import GSettings 1.0 | 21 | import GSettings 1.0 |
99 | 22 | import SystemSettings 1.0 | ||
100 | 22 | import Ubuntu.Components 0.1 | 23 | import Ubuntu.Components 0.1 |
101 | 23 | import Ubuntu.Components.ListItems 0.1 as ListItem | 24 | import Ubuntu.Components.ListItems 0.1 as ListItem |
102 | 24 | 25 | ||
103 | @@ -36,14 +37,17 @@ | |||
104 | 36 | return s; | 37 | return s; |
105 | 37 | } | 38 | } |
106 | 38 | property var modems | 39 | property var modems |
107 | 39 | // make settings available to all children of root | ||
108 | 40 | property var settings: phoneSettings | 40 | property var settings: phoneSettings |
109 | 41 | property string prevOnlineModem: "" | ||
110 | 42 | |||
111 | 43 | /* @sim a Sim.qml component containing libqofono bindings | ||
112 | 44 | @prevOnlineModem path to modem that was online before modem reset */ | ||
113 | 45 | signal umtsModemChanged (var sim, string prevOnlineModem); | ||
114 | 41 | 46 | ||
115 | 42 | DataMultiSim { | 47 | DataMultiSim { |
116 | 43 | anchors {Â left: parent.left; right: parent.right } | 48 | anchors {Â left: parent.left; right: parent.right } |
117 | 44 | } | 49 | } |
118 | 45 | 50 | ||
119 | 46 | |||
120 | 47 | ListItem.SingleValue { | 51 | ListItem.SingleValue { |
121 | 48 | text : i18n.tr("Hotspot disabled because Wi-Fi is off.") | 52 | text : i18n.tr("Hotspot disabled because Wi-Fi is off.") |
122 | 49 | visible: showAllUI && !hotspotItem.visible | 53 | visible: showAllUI && !hotspotItem.visible |
123 | @@ -95,13 +99,7 @@ | |||
124 | 95 | 99 | ||
125 | 96 | ListItem.Divider {} | 100 | ListItem.Divider {} |
126 | 97 | 101 | ||
134 | 98 | function techToString (tech) { | 102 | SettingsItemTitle { text: i18n.tr("Connection type:") } |
128 | 99 | return { | ||
129 | 100 | 'gsm': i18n.tr("2G only (saves battery)"), | ||
130 | 101 | 'umts': i18n.tr("2G/3G (faster)"), | ||
131 | 102 | 'lte': i18n.tr("2G/3G/4G (faster)") | ||
132 | 103 | }[tech] | ||
133 | 104 | } | ||
135 | 105 | 103 | ||
136 | 106 | Repeater { | 104 | Repeater { |
137 | 107 | model: sims | 105 | model: sims |
138 | @@ -109,27 +107,54 @@ | |||
139 | 109 | ListItem.ItemSelector { | 107 | ListItem.ItemSelector { |
140 | 110 | id: radio | 108 | id: radio |
141 | 111 | property var sim: modelData | 109 | property var sim: modelData |
145 | 112 | property var rSettings: sim.radioSettings | 110 | |
143 | 113 | property string techPref: rSettings.technologyPreference | ||
144 | 114 | property var modemTechs: rSettings.modemTechnologies | ||
146 | 115 | expanded: true | 111 | expanded: true |
149 | 116 | text: i18n.tr("Connection type:") | 112 | text: sim.title |
150 | 117 | model: modemTechs || [] | 113 | model: sim.radioSettings.modemTechnologies |
151 | 118 | delegate: OptionSelectorDelegate { | 114 | delegate: OptionSelectorDelegate { |
152 | 119 | objectName: sim.path + "_radio_" + modelData | 115 | objectName: sim.path + "_radio_" + modelData |
159 | 120 | text: techToString(modelData) | 116 | text: sim.techToString(modelData) |
160 | 121 | } | 117 | } |
161 | 122 | enabled: techPref !== "" | 118 | enabled: sim.radioSettings.technologyPreference !== "" |
162 | 123 | visible: sim.connMan.powered | 119 | selectedIndex: sim.radioSettings.technologyPreference !== "" ? |
163 | 124 | selectedIndex: techPref !== "" ? model.indexOf(techPref) : -1 | 120 | model.indexOf(sim.radioSettings.technologyPreference) : -1 |
164 | 125 | onDelegateClicked: rSettings.technologyPreference = model[index]; | 121 | |
165 | 122 | onDelegateClicked: { | ||
166 | 123 | if (model[index] === 'umts_enable') { | ||
167 | 124 | sim.radioSettings.technologyPreference = 'umts'; | ||
168 | 125 | umtsModemChanged(sim, poweredSim ? poweredSim.path : ""); | ||
169 | 126 | sim.mtkSettings.has3G = true; | ||
170 | 127 | } else { | ||
171 | 128 | sim.radioSettings.technologyPreference = model[index]; | ||
172 | 129 | } | ||
173 | 130 | } | ||
174 | 131 | |||
175 | 126 | Connections { | 132 | Connections { |
179 | 127 | target: rSettings | 133 | target: sim.radioSettings |
180 | 128 | onTechnologyPreferenceChanged: { | 134 | onTechnologyPreferenceChanged: radio.selectedIndex = |
181 | 129 | radio.selectedIndex = modemTechs.indexOf(preference) | 135 | sim.radioSettings.modemTechnologies.indexOf(preference) |
182 | 136 | |||
183 | 137 | onModemTechnologiesChanged: { | ||
184 | 138 | if ((technologies.indexOf('umts') === -1) | ||
185 | 139 | && (sim.mtkSettings.has3G === false)) { | ||
186 | 140 | radio.model = sim.addUmtsEnableToModel(technologies); | ||
187 | 141 | } else { | ||
188 | 142 | radio.model = technologies; | ||
189 | 143 | } | ||
190 | 144 | radio.selectedIndex = sim.radioSettings.technologyPreference !== "" ? | ||
191 | 145 | model.indexOf(sim.radioSettings.technologyPreference) : -1 | ||
192 | 130 | } | 146 | } |
193 | 131 | ignoreUnknownSignals: true | 147 | ignoreUnknownSignals: true |
194 | 132 | } | 148 | } |
195 | 149 | |||
196 | 150 | Component.onCompleted: { | ||
197 | 151 | if ((sim.radioSettings.modemTechnologies.indexOf('umts') === -1) | ||
198 | 152 | && (sim.mtkSettings.has3G === false)) { | ||
199 | 153 | radio.model = sim.addUmtsEnableToModel(sim.radioSettings.modemTechnologies); | ||
200 | 154 | } else { | ||
201 | 155 | radio.model = sim.radioSettings.modemTechnologies; | ||
202 | 156 | } | ||
203 | 157 | } | ||
204 | 133 | } | 158 | } |
205 | 134 | } | 159 | } |
206 | 135 | 160 | ||
207 | 136 | 161 | ||
208 | === modified file 'plugins/cellular/Components/RadioSingleSim.qml' | |||
209 | --- plugins/cellular/Components/RadioSingleSim.qml 2014-12-16 16:22:29 +0000 | |||
210 | +++ plugins/cellular/Components/RadioSingleSim.qml 2015-02-09 14:18:57 +0000 | |||
211 | @@ -22,36 +22,66 @@ | |||
212 | 22 | import Ubuntu.Components.ListItems 0.1 as ListItem | 22 | import Ubuntu.Components.ListItems 0.1 as ListItem |
213 | 23 | 23 | ||
214 | 24 | Column { | 24 | Column { |
215 | 25 | id: radioSingleSim | ||
216 | 25 | height: childrenRect.height | 26 | height: childrenRect.height |
217 | 26 | 27 | ||
218 | 27 | property bool enabled: sim.radioSettings.technologyPreference !== "" | 28 | property bool enabled: sim.radioSettings.technologyPreference !== "" |
219 | 28 | 29 | ||
220 | 29 | ListItem.ItemSelector { | 30 | ListItem.ItemSelector { |
221 | 30 | id: selector | 31 | id: selector |
222 | 31 | text: i18n.tr("Connection type:") | ||
223 | 32 | showDivider: false | 32 | showDivider: false |
224 | 33 | expanded: true | 33 | expanded: true |
225 | 34 | 34 | ||
226 | 35 | // an empty string is not a valid preference, which means | 35 | // an empty string is not a valid preference, which means |
227 | 36 | // we disregard the interace and disable the selector | 36 | // we disregard the interace and disable the selector |
228 | 37 | enabled: parent.enabled | 37 | enabled: parent.enabled |
231 | 38 | model: sim.radioSettings.modemTechnologies || [] | 38 | model: sim.radioSettings.modemTechnologies |
230 | 39 | |||
232 | 40 | delegate: OptionSelectorDelegate { | 39 | delegate: OptionSelectorDelegate { |
233 | 41 | objectName: sim.path + "_radio_" + modelData | 40 | objectName: sim.path + "_radio_" + modelData |
241 | 42 | text: { | 41 | text: sim.techToString(modelData) |
235 | 43 | return { | ||
236 | 44 | 'gsm': i18n.tr("2G only (saves battery)"), | ||
237 | 45 | 'umts': i18n.tr("2G/3G (faster)"), | ||
238 | 46 | 'lte': i18n.tr("2G/3G/4G (faster)") | ||
239 | 47 | }[modelData] | ||
240 | 48 | } | ||
242 | 49 | showDivider: false | 42 | showDivider: false |
243 | 50 | } | 43 | } |
246 | 51 | selectedIndex: model.length ? | 44 | selectedIndex: |
247 | 52 | model.indexOf(sim.radioSettings.technologyPreference) : -1 | 45 | sim.radioSettings.technologyPreference !== "" ? |
248 | 46 | model.indexOf(sim.radioSettings.technologyPreference) : -1 | ||
249 | 47 | |||
250 | 53 | onDelegateClicked: { | 48 | onDelegateClicked: { |
252 | 54 | sim.radioSettings.technologyPreference = model[index]; | 49 | if (model[index] === 'umts_enable') { |
253 | 50 | sim.radioSettings.technologyPreference = 'umts'; | ||
254 | 51 | radioSingleSim.parent.umtsModemChanged(sim, sim.connMan.powered ? sim.path : ""); | ||
255 | 52 | sim.mtkSettings.has3G = true; | ||
256 | 53 | } else { | ||
257 | 54 | sim.radioSettings.technologyPreference = model[index]; | ||
258 | 55 | } | ||
259 | 56 | } | ||
260 | 57 | |||
261 | 58 | Connections { | ||
262 | 59 | target: sim.radioSettings | ||
263 | 60 | |||
264 | 61 | onTechnologyPreferenceChanged: selector.selectedIndex = | ||
265 | 62 | sim.radioSettings.modemTechnologies.indexOf(preference) | ||
266 | 63 | |||
267 | 64 | onModemTechnologiesChanged: { | ||
268 | 65 | if ((technologies.indexOf('umts') === -1) | ||
269 | 66 | && (sim.mtkSettings.has3G === false)) { | ||
270 | 67 | selector.model = sim.addUmtsEnableToModel(technologies); | ||
271 | 68 | } else { | ||
272 | 69 | selector.model = technologies; | ||
273 | 70 | } | ||
274 | 71 | selector.selectedIndex = sim.radioSettings.technologyPreference !== "" ? | ||
275 | 72 | selector.model.indexOf(sim.radioSettings.technologyPreference) : -1 | ||
276 | 73 | } | ||
277 | 74 | ignoreUnknownSignals: true | ||
278 | 75 | } | ||
279 | 76 | |||
280 | 77 | Component.onCompleted: { | ||
281 | 78 | if ((sim.radioSettings.modemTechnologies.indexOf('umts') === -1) | ||
282 | 79 | && (sim.mtkSettings.has3G === false)) { | ||
283 | 80 | selector.model = sim.addUmtsEnableToModel( | ||
284 | 81 | sim.radioSettings.modemTechnologies); | ||
285 | 82 | } else { | ||
286 | 83 | selector.model = sim.radioSettings.modemTechnologies; | ||
287 | 84 | } | ||
288 | 55 | } | 85 | } |
289 | 56 | } | 86 | } |
290 | 57 | } | 87 | } |
291 | 58 | 88 | ||
292 | === modified file 'plugins/cellular/Components/Sim.qml' | |||
293 | --- plugins/cellular/Components/Sim.qml 2014-10-07 15:41:44 +0000 | |||
294 | +++ plugins/cellular/Components/Sim.qml 2015-02-09 14:18:57 +0000 | |||
295 | @@ -27,6 +27,7 @@ | |||
296 | 27 | property alias radioSettings: radioSettings | 27 | property alias radioSettings: radioSettings |
297 | 28 | property alias simMng: simMng | 28 | property alias simMng: simMng |
298 | 29 | property alias connMan: connMan | 29 | property alias connMan: connMan |
299 | 30 | property alias mtkSettings: mtkSettings | ||
300 | 30 | 31 | ||
301 | 31 | property alias present: simMng.present | 32 | property alias present: simMng.present |
302 | 32 | property string path | 33 | property string path |
303 | @@ -36,14 +37,31 @@ | |||
304 | 36 | return name + (number ? " (" + number + ")" : ""); | 37 | return name + (number ? " (" + number + ")" : ""); |
305 | 37 | } | 38 | } |
306 | 38 | 39 | ||
307 | 40 | function techToString (tech) { | ||
308 | 41 | var strings = { | ||
309 | 42 | 'gsm': i18n.tr("2G only (saves battery)"), | ||
310 | 43 | 'umts': i18n.tr("2G/3G (faster)"), | ||
311 | 44 | 'lte': i18n.tr("2G/3G/4G (faster)") | ||
312 | 45 | }; | ||
313 | 46 | strings['umts_enable'] = strings['umts']; | ||
314 | 47 | return strings[tech]; | ||
315 | 48 | } | ||
316 | 49 | |||
317 | 50 | // adds umts_enable to an copy of model | ||
318 | 51 | function addUmtsEnableToModel (model) { | ||
319 | 52 | var newModel = model.slice(0); | ||
320 | 53 | newModel.push('umts_enable'); | ||
321 | 54 | return newModel; | ||
322 | 55 | } | ||
323 | 56 | |||
324 | 39 | OfonoModem { | 57 | OfonoModem { |
325 | 40 | id: modem | 58 | id: modem |
326 | 41 | modemPath: path | 59 | modemPath: path |
327 | 42 | onInterfacesChanged: { | 60 | onInterfacesChanged: { |
330 | 43 | if (interfaces.indexOf('org.ofono.ConnectionManager') >= 0) { | 61 | if (interfaces.indexOf('org.ofono.MtkSettings') >= 0) { |
331 | 44 | connMan._valid = true; | 62 | mtkSettings._valid = true; |
332 | 45 | } else { | 63 | } else { |
334 | 46 | connMan._valid = false; | 64 | mtkSettings._valid = false; |
335 | 47 | } | 65 | } |
336 | 48 | } | 66 | } |
337 | 49 | } | 67 | } |
338 | @@ -65,6 +83,11 @@ | |||
339 | 65 | 83 | ||
340 | 66 | OfonoConnMan { | 84 | OfonoConnMan { |
341 | 67 | id: connMan | 85 | id: connMan |
342 | 86 | modemPath: path | ||
343 | 87 | } | ||
344 | 88 | |||
345 | 89 | OfonoMtkSettings { | ||
346 | 90 | id: mtkSettings | ||
347 | 68 | property bool _valid: true | 91 | property bool _valid: true |
348 | 69 | modemPath: path | 92 | modemPath: path |
349 | 70 | on_ValidChanged: { | 93 | on_ValidChanged: { |
350 | 71 | 94 | ||
351 | === modified file 'plugins/cellular/Components/SingleSim.qml' | |||
352 | --- plugins/cellular/Components/SingleSim.qml 2014-12-16 16:22:29 +0000 | |||
353 | +++ plugins/cellular/Components/SingleSim.qml 2015-02-09 14:18:57 +0000 | |||
354 | @@ -28,6 +28,10 @@ | |||
355 | 28 | 28 | ||
356 | 29 | property var sim | 29 | property var sim |
357 | 30 | 30 | ||
358 | 31 | /* @sim a Sim.qml component containing libqofono bindings | ||
359 | 32 | @prevOnlineModem path to modem that was online before this event */ | ||
360 | 33 | signal umtsModemChanged (var sim, string prevOnlineModem); | ||
361 | 34 | |||
362 | 31 | ListItem.Standard { | 35 | ListItem.Standard { |
363 | 32 | id: selector | 36 | id: selector |
364 | 33 | text: i18n.tr("Cellular data:") | 37 | text: i18n.tr("Cellular data:") |
365 | 34 | 38 | ||
366 | === modified file 'plugins/cellular/PageComponent.qml' | |||
367 | --- plugins/cellular/PageComponent.qml 2014-11-18 20:13:35 +0000 | |||
368 | +++ plugins/cellular/PageComponent.qml 2015-02-09 14:18:57 +0000 | |||
369 | @@ -20,6 +20,7 @@ | |||
370 | 20 | 20 | ||
371 | 21 | import QtQuick 2.0 | 21 | import QtQuick 2.0 |
372 | 22 | import SystemSettings 1.0 | 22 | import SystemSettings 1.0 |
373 | 23 | import Ubuntu.SystemSettings.Cellular 1.0 | ||
374 | 23 | import Ubuntu.Components 0.1 | 24 | import Ubuntu.Components 0.1 |
375 | 24 | import Ubuntu.Components.ListItems 0.1 as ListItem | 25 | import Ubuntu.Components.ListItems 0.1 as ListItem |
376 | 25 | import MeeGo.QOfono 0.2 | 26 | import MeeGo.QOfono 0.2 |
377 | @@ -32,11 +33,31 @@ | |||
378 | 32 | title: i18n.tr("Cellular") | 33 | title: i18n.tr("Cellular") |
379 | 33 | objectName: "cellularPage" | 34 | objectName: "cellularPage" |
380 | 34 | 35 | ||
382 | 35 | property var modemsSorted: manager.modems.slice(0).sort() | 36 | property var modemsSorted: [] |
383 | 36 | property int simsLoaded: 0 | 37 | property int simsLoaded: 0 |
384 | 37 | 38 | ||
385 | 39 | // waiting during modem reboots or for modems to come online | ||
386 | 40 | property bool waiting: true | ||
387 | 41 | |||
388 | 42 | QtObject { | ||
389 | 43 | id: priv | ||
390 | 44 | property string prevOnlineModem: "" | ||
391 | 45 | } | ||
392 | 46 | |||
393 | 38 | states: [ | 47 | states: [ |
394 | 39 | State { | 48 | State { |
395 | 49 | name: "waiting" | ||
396 | 50 | when: waiting | ||
397 | 51 | PropertyChanges { | ||
398 | 52 | target: waitIndicator | ||
399 | 53 | opacity: 1 | ||
400 | 54 | } | ||
401 | 55 | PropertyChanges { | ||
402 | 56 | target: flick | ||
403 | 57 | opacity: 0 | ||
404 | 58 | } | ||
405 | 59 | }, | ||
406 | 60 | State { | ||
407 | 40 | name: "noSim" | 61 | name: "noSim" |
408 | 41 | when: (simsLoaded === 0) || (Sims.getPresentCount() === 0) | 62 | when: (simsLoaded === 0) || (Sims.getPresentCount() === 0) |
409 | 42 | StateChangeScript { | 63 | StateChangeScript { |
410 | @@ -47,7 +68,8 @@ | |||
411 | 47 | name: "singleSim" | 68 | name: "singleSim" |
412 | 48 | StateChangeScript { | 69 | StateChangeScript { |
413 | 49 | script: loader.setSource("Components/SingleSim.qml", { | 70 | script: loader.setSource("Components/SingleSim.qml", { |
415 | 50 | sim: Sims.getFirstPresent() | 71 | sim: Sims.getFirstPresent(), |
416 | 72 | prevOnlineModem: priv.prevOnlineModem | ||
417 | 51 | }) | 73 | }) |
418 | 52 | } | 74 | } |
419 | 53 | when: simsLoaded && (Sims.getPresentCount() === 1) | 75 | when: simsLoaded && (Sims.getPresentCount() === 1) |
420 | @@ -57,7 +79,8 @@ | |||
421 | 57 | StateChangeScript { | 79 | StateChangeScript { |
422 | 58 | script: loader.setSource("Components/MultiSim.qml", { | 80 | script: loader.setSource("Components/MultiSim.qml", { |
423 | 59 | sims: Sims.getAll(), | 81 | sims: Sims.getAll(), |
425 | 60 | modems: modemsSorted | 82 | modems: modemsSorted, |
426 | 83 | prevOnlineModem: priv.prevOnlineModem | ||
427 | 61 | }) | 84 | }) |
428 | 62 | } | 85 | } |
429 | 63 | when: simsLoaded && (Sims.getPresentCount() > 1) | 86 | when: simsLoaded && (Sims.getPresentCount() > 1) |
430 | @@ -66,19 +89,10 @@ | |||
431 | 66 | 89 | ||
432 | 67 | OfonoManager { | 90 | OfonoManager { |
433 | 68 | id: manager | 91 | id: manager |
447 | 69 | Component.onCompleted: { | 92 | onModemsChanged: { |
448 | 70 | var component = Qt.createComponent("Components/Sim.qml"); | 93 | root.modemsSorted = modems.slice(0).sort(); |
449 | 71 | modemsSorted.forEach(function (path) { | 94 | Sims.createQML(); |
450 | 72 | var sim = component.createObject(root, { | 95 | root.waiting = false; |
438 | 73 | path: path | ||
439 | 74 | }); | ||
440 | 75 | if (sim === null) { | ||
441 | 76 | console.warn('Failed to create Sim qml:', | ||
442 | 77 | component.errorString()); | ||
443 | 78 | } else { | ||
444 | 79 | Sims.add(sim); | ||
445 | 80 | } | ||
446 | 81 | }); | ||
451 | 82 | } | 96 | } |
452 | 83 | } | 97 | } |
453 | 84 | 98 | ||
454 | @@ -95,12 +109,30 @@ | |||
455 | 95 | } | 109 | } |
456 | 96 | } | 110 | } |
457 | 97 | 111 | ||
458 | 112 | Item { | ||
459 | 113 | id: waitIndicator | ||
460 | 114 | anchors.fill: parent | ||
461 | 115 | opacity: 0 | ||
462 | 116 | |||
463 | 117 | ActivityIndicator { | ||
464 | 118 | anchors.centerIn: parent | ||
465 | 119 | running: true | ||
466 | 120 | } | ||
467 | 121 | |||
468 | 122 | Behavior on opacity { | ||
469 | 123 | PropertyAnimation { | ||
470 | 124 | duration: UbuntuAnimation.SleepyDuration | ||
471 | 125 | } | ||
472 | 126 | } | ||
473 | 127 | } | ||
474 | 128 | |||
475 | 98 | Flickable { | 129 | Flickable { |
476 | 99 | id: flick | 130 | id: flick |
477 | 100 | anchors.fill: parent | 131 | anchors.fill: parent |
478 | 101 | contentWidth: parent.width | 132 | contentWidth: parent.width |
479 | 102 | contentHeight: contentItem.childrenRect.height | 133 | contentHeight: contentItem.childrenRect.height |
480 | 103 | boundsBehavior: (contentHeight > root.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds | 134 | boundsBehavior: (contentHeight > root.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds |
481 | 135 | |||
482 | 104 | Column { | 136 | Column { |
483 | 105 | anchors {Â left: parent.left; right: parent.right } | 137 | anchors {Â left: parent.left; right: parent.right } |
484 | 106 | Loader { | 138 | Loader { |
485 | @@ -108,5 +140,37 @@ | |||
486 | 108 | anchors {Â left: parent.left; right: parent.right } | 140 | anchors {Â left: parent.left; right: parent.right } |
487 | 109 | } | 141 | } |
488 | 110 | } | 142 | } |
489 | 143 | |||
490 | 144 | Behavior on opacity { | ||
491 | 145 | PropertyAnimation { | ||
492 | 146 | duration: UbuntuAnimation.SleepyDuration | ||
493 | 147 | } | ||
494 | 148 | } | ||
495 | 149 | |||
496 | 150 | Connections { | ||
497 | 151 | target: loader.item | ||
498 | 152 | |||
499 | 153 | onUmtsModemChanged: { | ||
500 | 154 | var path = sim.path; | ||
501 | 155 | var e = sim.simMng.presenceChanged; | ||
502 | 156 | |||
503 | 157 | function presenceHandler (ispresent) { | ||
504 | 158 | if (ispresent) { | ||
505 | 159 | root.waiting = false; | ||
506 | 160 | Connectivity.unlockAllModems(); | ||
507 | 161 | e.disconnect(presenceHandler); | ||
508 | 162 | } | ||
509 | 163 | } | ||
510 | 164 | |||
511 | 165 | priv.prevOnlineModem = prevOnlineModem ? | ||
512 | 166 | prevOnlineModem : ""; | ||
513 | 167 | root.waiting = true; | ||
514 | 168 | |||
515 | 169 | /* When the SIM comes back online, set waiting to false: | ||
516 | 170 | the modem reboot is done.*/ | ||
517 | 171 | sim.simMng.presenceChanged.connect(presenceHandler); | ||
518 | 172 | } | ||
519 | 173 | ignoreUnknownSignals: true | ||
520 | 174 | } | ||
521 | 111 | } | 175 | } |
522 | 112 | } | 176 | } |
523 | 113 | 177 | ||
524 | === added file 'plugins/cellular/connectivity.cpp' | |||
525 | --- plugins/cellular/connectivity.cpp 1970-01-01 00:00:00 +0000 | |||
526 | +++ plugins/cellular/connectivity.cpp 2015-02-09 14:18:57 +0000 | |||
527 | @@ -0,0 +1,49 @@ | |||
528 | 1 | /* | ||
529 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
530 | 3 | * | ||
531 | 4 | * Authors: | ||
532 | 5 | * Jonas G. Drange <jonas.drange@canonical.com> | ||
533 | 6 | * | ||
534 | 7 | * This program is free software: you can redistribute it and/or modify it | ||
535 | 8 | * under the terms of the GNU General Public License version 3, as published | ||
536 | 9 | * by the Free Software Foundation. | ||
537 | 10 | * | ||
538 | 11 | * This library is distributed in the hope that it will be useful, but WITHOUT | ||
539 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
540 | 13 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
541 | 14 | * details. | ||
542 | 15 | * | ||
543 | 16 | * You should have received a copy of the GNU General Public License | ||
544 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
545 | 18 | */ | ||
546 | 19 | |||
547 | 20 | #include <QDBusReply> | ||
548 | 21 | #include <QtDebug> | ||
549 | 22 | #include <QDBusInterface> | ||
550 | 23 | #include "connectivity.h" | ||
551 | 24 | |||
552 | 25 | namespace { | ||
553 | 26 | const QString conn_service("com.ubuntu.connectivity1"); | ||
554 | 27 | const QString conn_object("/com/ubuntu/connectivity1/Private"); | ||
555 | 28 | const QString conn_interface("com.ubuntu.connectivity1.Private"); | ||
556 | 29 | const QString conn_unlockall_method("UnlockAllModems"); | ||
557 | 30 | } | ||
558 | 31 | |||
559 | 32 | Connectivity::Connectivity(QObject *parent) : QObject(parent) | ||
560 | 33 | { | ||
561 | 34 | } | ||
562 | 35 | |||
563 | 36 | void Connectivity::unlockAllModems() { | ||
564 | 37 | |||
565 | 38 | QDBusInterface connectivityIface ( | ||
566 | 39 | conn_service, | ||
567 | 40 | conn_object, | ||
568 | 41 | conn_interface, | ||
569 | 42 | QDBusConnection::sessionBus(), | ||
570 | 43 | this); | ||
571 | 44 | |||
572 | 45 | auto reply = connectivityIface.call(conn_unlockall_method); | ||
573 | 46 | if (reply.type() == QDBusMessage::ErrorMessage) { | ||
574 | 47 | qWarning() << "Failed to unlock modems" << reply.errorMessage(); | ||
575 | 48 | } | ||
576 | 49 | } | ||
577 | 0 | 50 | ||
578 | === added file 'plugins/cellular/connectivity.h' | |||
579 | --- plugins/cellular/connectivity.h 1970-01-01 00:00:00 +0000 | |||
580 | +++ plugins/cellular/connectivity.h 2015-02-09 14:18:57 +0000 | |||
581 | @@ -0,0 +1,35 @@ | |||
582 | 1 | /* | ||
583 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
584 | 3 | * | ||
585 | 4 | * Authors: | ||
586 | 5 | * Jonas G. Drange <jonas.drange@canonical.com> | ||
587 | 6 | * | ||
588 | 7 | * This program is free software: you can redistribute it and/or modify it | ||
589 | 8 | * under the terms of the GNU General Public License version 3, as published | ||
590 | 9 | * by the Free Software Foundation. | ||
591 | 10 | * | ||
592 | 11 | * This library is distributed in the hope that it will be useful, but WITHOUT | ||
593 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
594 | 13 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
595 | 14 | * details. | ||
596 | 15 | * | ||
597 | 16 | * You should have received a copy of the GNU General Public License | ||
598 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
599 | 18 | */ | ||
600 | 19 | |||
601 | 20 | #ifndef CELLULAR_CONNECTIVITY_HELPER | ||
602 | 21 | #define CELLULAR_CONNECTIVITY_HELPER | ||
603 | 22 | |||
604 | 23 | #include <QObject> | ||
605 | 24 | |||
606 | 25 | class Connectivity : public QObject { | ||
607 | 26 | Q_OBJECT | ||
608 | 27 | |||
609 | 28 | public: | ||
610 | 29 | explicit Connectivity(QObject *parent = nullptr); | ||
611 | 30 | ~Connectivity() {}; | ||
612 | 31 | |||
613 | 32 | Q_INVOKABLE void unlockAllModems(); | ||
614 | 33 | }; | ||
615 | 34 | |||
616 | 35 | #endif | ||
617 | 0 | 36 | ||
618 | === modified file 'plugins/cellular/plugin.cpp' | |||
619 | --- plugins/cellular/plugin.cpp 2014-08-29 14:32:28 +0000 | |||
620 | +++ plugins/cellular/plugin.cpp 2015-02-09 14:18:57 +0000 | |||
621 | @@ -19,12 +19,23 @@ | |||
622 | 19 | 19 | ||
623 | 20 | #include <QtQml> | 20 | #include <QtQml> |
624 | 21 | #include <QtQml/QQmlContext> | 21 | #include <QtQml/QQmlContext> |
625 | 22 | #include "connectivity.h" | ||
626 | 22 | #include "hotspotmanager.h" | 23 | #include "hotspotmanager.h" |
627 | 23 | #include "ofonoactivator.h" | 24 | #include "ofonoactivator.h" |
628 | 24 | 25 | ||
629 | 26 | static QObject *connectivitySingeltonProvider(QQmlEngine *engine, QJSEngine *scriptEngine) | ||
630 | 27 | { | ||
631 | 28 | Q_UNUSED(engine) | ||
632 | 29 | Q_UNUSED(scriptEngine) | ||
633 | 30 | |||
634 | 31 | Connectivity *connectivity = new Connectivity(); | ||
635 | 32 | return connectivity; | ||
636 | 33 | } | ||
637 | 34 | |||
638 | 25 | void BackendPlugin::registerTypes(const char *uri) | 35 | void BackendPlugin::registerTypes(const char *uri) |
639 | 26 | { | 36 | { |
640 | 27 | Q_ASSERT(uri == QLatin1String("Ubuntu.SystemSettings.Cellular")); | 37 | Q_ASSERT(uri == QLatin1String("Ubuntu.SystemSettings.Cellular")); |
641 | 38 | qmlRegisterSingletonType<Connectivity>(uri, 1, 0, "Connectivity", connectivitySingeltonProvider); | ||
642 | 28 | qmlRegisterType<HotspotManager>(uri, 1, 0, "HotspotManager"); | 39 | qmlRegisterType<HotspotManager>(uri, 1, 0, "HotspotManager"); |
643 | 29 | qmlRegisterType<OfonoActivator>(uri, 1, 0, "OfonoActivator"); | 40 | qmlRegisterType<OfonoActivator>(uri, 1, 0, "OfonoActivator"); |
644 | 30 | } | 41 | } |
645 | 31 | 42 | ||
646 | === modified file 'plugins/cellular/sims.js' | |||
647 | --- plugins/cellular/sims.js 2014-11-18 20:13:35 +0000 | |||
648 | +++ plugins/cellular/sims.js 2015-02-09 14:18:57 +0000 | |||
649 | @@ -46,3 +46,24 @@ | |||
650 | 46 | function getPresentCount () { | 46 | function getPresentCount () { |
651 | 47 | return getPresent().length; | 47 | return getPresent().length; |
652 | 48 | } | 48 | } |
653 | 49 | |||
654 | 50 | function createQML () { | ||
655 | 51 | var component = Qt.createComponent("Components/Sim.qml"); | ||
656 | 52 | |||
657 | 53 | sims.forEach(function (sim) { | ||
658 | 54 | sim.destroy(); | ||
659 | 55 | }); | ||
660 | 56 | sims = []; | ||
661 | 57 | |||
662 | 58 | root.modemsSorted.forEach(function (path) { | ||
663 | 59 | var sim = component.createObject(root, { | ||
664 | 60 | path: path | ||
665 | 61 | }); | ||
666 | 62 | if (sim === null) { | ||
667 | 63 | console.warn('Failed to create Sim qml:', | ||
668 | 64 | component.errorString()); | ||
669 | 65 | } else { | ||
670 | 66 | Sims.add(sim); | ||
671 | 67 | } | ||
672 | 68 | }); | ||
673 | 69 | } | ||
674 | 49 | 70 | ||
675 | === modified file 'plugins/phone/PageComponent.qml' | |||
676 | --- plugins/phone/PageComponent.qml 2014-11-10 17:59:34 +0000 | |||
677 | +++ plugins/phone/PageComponent.qml 2015-02-09 14:18:57 +0000 | |||
678 | @@ -32,7 +32,7 @@ | |||
679 | 32 | title: i18n.tr("Phone") | 32 | title: i18n.tr("Phone") |
680 | 33 | flickable: flick | 33 | flickable: flick |
681 | 34 | 34 | ||
683 | 35 | property var modemsSorted: manager.modems.slice(0).sort() | 35 | property var modemsSorted: [] |
684 | 36 | property var simsLoaded: 0 | 36 | property var simsLoaded: 0 |
685 | 37 | 37 | ||
686 | 38 | states: [ | 38 | states: [ |
687 | @@ -65,19 +65,9 @@ | |||
688 | 65 | 65 | ||
689 | 66 | OfonoManager { | 66 | OfonoManager { |
690 | 67 | id: manager | 67 | id: manager |
704 | 68 | Component.onCompleted: { | 68 | onModemsChanged: { |
705 | 69 | // create ofono bindings for all modem paths | 69 | root.modemsSorted = modems.slice(0).sort(); |
706 | 70 | var component = Qt.createComponent("Ofono.qml"); | 70 | Sims.createQML(); |
694 | 71 | modemsSorted.forEach(function (path) { | ||
695 | 72 | var sim = component.createObject(root, { | ||
696 | 73 | path: path | ||
697 | 74 | }); | ||
698 | 75 | if (sim === null) { | ||
699 | 76 | console.warn('failed to create sim object'); | ||
700 | 77 | } else { | ||
701 | 78 | Sims.add(sim); | ||
702 | 79 | } | ||
703 | 80 | }); | ||
707 | 81 | } | 71 | } |
708 | 82 | } | 72 | } |
709 | 83 | 73 | ||
710 | 84 | 74 | ||
711 | === modified file 'plugins/phone/sims.js' | |||
712 | --- plugins/phone/sims.js 2014-10-03 14:08:08 +0000 | |||
713 | +++ plugins/phone/sims.js 2015-02-09 14:18:57 +0000 | |||
714 | @@ -36,3 +36,24 @@ | |||
715 | 36 | function getPresentCount () { | 36 | function getPresentCount () { |
716 | 37 | return getPresent().length; | 37 | return getPresent().length; |
717 | 38 | } | 38 | } |
718 | 39 | |||
719 | 40 | function createQML () { | ||
720 | 41 | var component = Qt.createComponent("Ofono.qml"); | ||
721 | 42 | |||
722 | 43 | sims.forEach(function (sim) { | ||
723 | 44 | sim.destroy(); | ||
724 | 45 | }); | ||
725 | 46 | sims = []; | ||
726 | 47 | |||
727 | 48 | root.modemsSorted.forEach(function (path) { | ||
728 | 49 | var sim = component.createObject(root, { | ||
729 | 50 | path: path | ||
730 | 51 | }); | ||
731 | 52 | if (sim === null) { | ||
732 | 53 | console.warn('Failed to create Sim qml:', | ||
733 | 54 | component.errorString()); | ||
734 | 55 | } else { | ||
735 | 56 | Sims.add(sim); | ||
736 | 57 | } | ||
737 | 58 | }); | ||
738 | 59 | } | ||
739 | 39 | 60 | ||
740 | === modified file 'plugins/security-privacy/PageComponent.qml' | |||
741 | --- plugins/security-privacy/PageComponent.qml 2014-11-12 16:28:12 +0000 | |||
742 | +++ plugins/security-privacy/PageComponent.qml 2015-02-09 14:18:57 +0000 | |||
743 | @@ -39,9 +39,11 @@ | |||
744 | 39 | 39 | ||
745 | 40 | property alias usePowerd: batteryBackend.powerdRunning | 40 | property alias usePowerd: batteryBackend.powerdRunning |
746 | 41 | property bool lockOnSuspend | 41 | property bool lockOnSuspend |
750 | 42 | property var modemsSorted: manager.modems.slice(0).sort() | 42 | property var modemsSorted: [] |
751 | 43 | property var sims | 43 | property var sims: [] |
752 | 44 | property int simsPresent: 0 | 44 | /* glue to something that will emit change events |
753 | 45 | TODO: fix this so that the present count emits events of its own */ | ||
754 | 46 | property int simsPresent: simsLoaded ? Sims.getPresentCount() : 0 | ||
755 | 45 | property int simsLoaded: 0 | 47 | property int simsLoaded: 0 |
756 | 46 | property int simsLocked: { | 48 | property int simsLocked: { |
757 | 47 | var t = 0; | 49 | var t = 0; |
758 | @@ -66,23 +68,10 @@ | |||
759 | 66 | 68 | ||
760 | 67 | OfonoManager { | 69 | OfonoManager { |
761 | 68 | id: manager | 70 | id: manager |
777 | 69 | Component.onCompleted: { | 71 | onModemsChanged: { |
778 | 70 | // create ofono bindings for all modem paths | 72 | root.modemsSorted = modems.slice(0).sort(); |
779 | 71 | var component = Qt.createComponent("Ofono.qml"); | 73 | Sims.createQML(); |
765 | 72 | modemsSorted.forEach(function (path, index) { | ||
766 | 73 | var sim = component.createObject(root, { | ||
767 | 74 | path: path, | ||
768 | 75 | name: phoneSettings.simNames[path] ? | ||
769 | 76 | phoneSettings.simNames[path] : | ||
770 | 77 | "SIM " + (index + 1) | ||
771 | 78 | }); | ||
772 | 79 | if (sim === null) | ||
773 | 80 | console.warn('failed to create sim object'); | ||
774 | 81 | else | ||
775 | 82 | Sims.add(sim); | ||
776 | 83 | }); | ||
780 | 84 | root.sims = Sims.getAll(); | 74 | root.sims = Sims.getAll(); |
781 | 85 | root.simsPresent = Sims.getPresentCount(); | ||
782 | 86 | } | 75 | } |
783 | 87 | } | 76 | } |
784 | 88 | 77 | ||
785 | 89 | 78 | ||
786 | === modified file 'plugins/security-privacy/sims.js' | |||
787 | --- plugins/security-privacy/sims.js 2014-08-27 05:19:24 +0000 | |||
788 | +++ plugins/security-privacy/sims.js 2015-02-09 14:18:57 +0000 | |||
789 | @@ -32,3 +32,28 @@ | |||
790 | 32 | function getPresentCount () { | 32 | function getPresentCount () { |
791 | 33 | return getPresent().length; | 33 | return getPresent().length; |
792 | 34 | } | 34 | } |
793 | 35 | |||
794 | 36 | function createQML () { | ||
795 | 37 | var component = Qt.createComponent("Ofono.qml"); | ||
796 | 38 | |||
797 | 39 | sims.forEach(function (sim) { | ||
798 | 40 | sim.destroy(); | ||
799 | 41 | }); | ||
800 | 42 | sims = []; | ||
801 | 43 | |||
802 | 44 | root.modemsSorted.forEach(function (path, index) { | ||
803 | 45 | var sim = component.createObject(root, { | ||
804 | 46 | path: path, | ||
805 | 47 | name: phoneSettings.simNames[path] ? | ||
806 | 48 | phoneSettings.simNames[path] : | ||
807 | 49 | "SIM " + (index + 1) | ||
808 | 50 | }); | ||
809 | 51 | if (sim === null) { | ||
810 | 52 | console.warn('Failed to create Sim qml:', | ||
811 | 53 | component.errorString()); | ||
812 | 54 | } else { | ||
813 | 55 | Sims.add(sim); | ||
814 | 56 | } | ||
815 | 57 | }); | ||
816 | 58 | } | ||
817 | 59 | |||
818 | 35 | 60 | ||
819 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/__init__.py' | |||
820 | --- tests/autopilot/ubuntu_system_settings/tests/__init__.py 2015-01-29 19:50:34 +0000 | |||
821 | +++ tests/autopilot/ubuntu_system_settings/tests/__init__.py 2015-02-09 14:18:57 +0000 | |||
822 | @@ -143,7 +143,7 @@ | |||
823 | 143 | 143 | ||
824 | 144 | def mock_connection_manager(self, modem): | 144 | def mock_connection_manager(self, modem): |
825 | 145 | modem.AddProperty(CONNMAN_IFACE, 'Powered', dbus.Boolean(1)) | 145 | modem.AddProperty(CONNMAN_IFACE, 'Powered', dbus.Boolean(1)) |
827 | 146 | modem.AddProperty(CONNMAN_IFACE, 'RoamingAllowed', False) | 146 | modem.AddProperty(CONNMAN_IFACE, 'RoamingAllowed', dbus.Boolean(0)) |
828 | 147 | modem.AddMethods( | 147 | modem.AddMethods( |
829 | 148 | CONNMAN_IFACE, | 148 | CONNMAN_IFACE, |
830 | 149 | [ | 149 | [ |
831 | @@ -156,6 +156,9 @@ | |||
832 | 156 | 'self.EmitSignal("IFACE", "PropertyChanged", "sv",\ | 156 | 'self.EmitSignal("IFACE", "PropertyChanged", "sv",\ |
833 | 157 | [args[0], args[1]])'.replace("IFACE", CONNMAN_IFACE)), | 157 | [args[0], args[1]])'.replace("IFACE", CONNMAN_IFACE)), |
834 | 158 | ]) | 158 | ]) |
835 | 159 | interfaces = modem.GetProperties()['Interfaces'] | ||
836 | 160 | interfaces.append(CONNMAN_IFACE) | ||
837 | 161 | modem.SetProperty('Interfaces', interfaces) | ||
838 | 159 | 162 | ||
839 | 160 | def mock_carriers(self, name): | 163 | def mock_carriers(self, name): |
840 | 161 | self.dbusmock.AddObject( | 164 | self.dbusmock.AddObject( |
841 | @@ -208,6 +211,10 @@ | |||
842 | 208 | "PropertyChanged", "sv", [args[0], args[1]])' | 211 | "PropertyChanged", "sv", [args[0], args[1]])' |
843 | 209 | .replace('IFACE', RDO_IFACE)), ]) | 212 | .replace('IFACE', RDO_IFACE)), ]) |
844 | 210 | 213 | ||
845 | 214 | interfaces = modem.GetProperties()['Interfaces'] | ||
846 | 215 | interfaces.append(RDO_IFACE) | ||
847 | 216 | modem.SetProperty('Interfaces', interfaces) | ||
848 | 217 | |||
849 | 211 | def mock_call_forwarding(self, modem): | 218 | def mock_call_forwarding(self, modem): |
850 | 212 | modem.AddProperty( | 219 | modem.AddProperty( |
851 | 213 | CALL_FWD_IFACE, 'VoiceUnconditional', '') | 220 | CALL_FWD_IFACE, 'VoiceUnconditional', '') |
852 | @@ -220,6 +227,9 @@ | |||
853 | 220 | 'self.EmitSignal("IFACE",\ | 227 | 'self.EmitSignal("IFACE",\ |
854 | 221 | "PropertyChanged", "sv", [args[0], args[1]])' | 228 | "PropertyChanged", "sv", [args[0], args[1]])' |
855 | 222 | .replace('IFACE', CALL_FWD_IFACE)), ]) | 229 | .replace('IFACE', CALL_FWD_IFACE)), ]) |
856 | 230 | interfaces = modem.GetProperties()['Interfaces'] | ||
857 | 231 | interfaces.append(CALL_FWD_IFACE) | ||
858 | 232 | modem.SetProperty('Interfaces', interfaces) | ||
859 | 223 | 233 | ||
860 | 224 | def mock_call_settings(self, modem): | 234 | def mock_call_settings(self, modem): |
861 | 225 | modem.AddProperty( | 235 | modem.AddProperty( |
862 | @@ -233,6 +243,9 @@ | |||
863 | 233 | 'self.EmitSignal("IFACE",\ | 243 | 'self.EmitSignal("IFACE",\ |
864 | 234 | "PropertyChanged", "sv", [args[0], args[1]])' | 244 | "PropertyChanged", "sv", [args[0], args[1]])' |
865 | 235 | .replace('IFACE', CALL_SETTINGS_IFACE)), ]) | 245 | .replace('IFACE', CALL_SETTINGS_IFACE)), ]) |
866 | 246 | interfaces = modem.GetProperties()['Interfaces'] | ||
867 | 247 | interfaces.append(CALL_SETTINGS_IFACE) | ||
868 | 248 | modem.SetProperty('Interfaces', interfaces) | ||
869 | 236 | 249 | ||
870 | 237 | def add_sim1(self): | 250 | def add_sim1(self): |
871 | 238 | # create modem_0 proxy | 251 | # create modem_0 proxy |
FAILED: Continuous integration, rev:985 jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- rtm-14. 09-ci/57/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- 14.09-touch/ 36/console jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- rtm-14. 09-14.09- armhf-ci/ 58 jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- rtm-14. 09-14.09- armhf-ci/ 58/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- 14.09-mako/ 37/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- 14.09-armhf/ 36 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- 14.09-armhf/ 36/artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 17821
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/ubuntu- system- settings- rtm-14. 09-ci/57/ rebuild
http://