Merge lp:~jonas-drange/ubuntu-system-settings/expandable-sim-name-editor into lp:ubuntu-system-settings
- expandable-sim-name-editor
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Ken VanDine |
Approved revision: | 827 |
Merged at revision: | 897 |
Proposed branch: | lp:~jonas-drange/ubuntu-system-settings/expandable-sim-name-editor |
Merge into: | lp:ubuntu-system-settings |
Prerequisite: | lp:~jonas-drange/ubuntu-system-settings/sim-name-editor |
Diff against target: |
441 lines (+245/-55) 7 files modified
debian/control (+1/-1) plugins/cellular/Components/CMakeLists.txt (+2/-1) plugins/cellular/Components/DefaultSim.qml (+69/-0) plugins/cellular/Components/SimEditor.qml (+100/-38) plugins/cellular/PageComponent.qml (+15/-7) tests/autopilot/ubuntu_system_settings/tests/__init__.py (+20/-0) tests/autopilot/ubuntu_system_settings/tests/test_cellular.py (+38/-8) |
To merge this branch: | bzr merge lp:~jonas-drange/ubuntu-system-settings/expandable-sim-name-editor |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Ken VanDine | Approve | ||
Review via email: mp+229450@code.launchpad.net |
Commit message
[cellular] use expandable to show/hide sim editor and put the sim editor in a Loader element to optimize single sim setups
Description of the change
Hello,
this branch uses expandables for the sim name editor. It also uses a Loader element for the sim editor so single sim setups does not need to load the qml which is hidden.
Thanks
- 812. By Jonas G. Drange
-
removing entry
- 813. By Jonas G. Drange
-
refactor test
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:813
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Ken VanDine (ken-vandine) wrote : | # |
Please ensure all the lines are wrapped properly, max 80. Code looks fine, I still need to do some testing on the device. Please see one inline comment as well.
Have you looked into the CI failures?
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:812
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 814. By Jonas G. Drange
-
this test is bad, it's not at all a happy path and is not testing against a specific spec
- 815. By Jonas G. Drange
-
fixing height of expandable, removing obsolete test
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:815
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 816. By Jonas G. Drange
-
adding dep2
- 817. By Jonas G. Drange
-
fix conflict after syncing with trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:815
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:815
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:817
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 818. By Jonas G. Drange
-
fixed dep
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:817
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:818
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:817
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:817
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:817
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:817
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 819. By Jonas G. Drange
-
depping on later version
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:817
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:819
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 820. By Jonas G. Drange
-
merge trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:820
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 821. By Jonas G. Drange
-
depping on later libgsettings-qt
- 822. By Jonas G. Drange
-
merging trunk
Ken VanDine (ken-vandine) wrote : | # |
There are still some lines over 80, and see my inline comment
- 823. By Jonas G. Drange
-
removing dep
- 824. By Jonas G. Drange
-
line over 80 chars edited
Ken VanDine (ken-vandine) wrote : | # |
The depends version for qtdeclarative5-
- 825. By Jonas G. Drange
-
The depends version for qtdeclarative5-
gsettings1. 0 is still incorrect, it needs a{ss}, which was added in 0.1+14. 10.20140801. 1
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:820
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:825
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:825
http://
Executed test runs:
None: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
None: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:825
http://
Executed test runs:
None: http://
None: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:825
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:825
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 826. By Jonas G. Drange
-
merge trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:826
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 827. By Jonas G. Drange
-
merging prereq
Ken VanDine (ken-vandine) wrote : | # |
Looks good, tested on a dual sim device
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:827
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'debian/control' |
2 | --- debian/control 2014-08-12 00:38:40 +0000 |
3 | +++ debian/control 2014-08-12 16:25:41 +0000 |
4 | @@ -61,7 +61,7 @@ |
5 | qmenumodel-qml, |
6 | qtdeclarative5-folderlistmodel-plugin, |
7 | qml-module-qtmultimedia | qml-module-qtmultimedia-gles, |
8 | - qtdeclarative5-gsettings1.0 (>=0.0+13.10.20130717), |
9 | + qtdeclarative5-gsettings1.0 (>=0.1+14.10.20140801.1), |
10 | qtdeclarative5-ofono0.2, |
11 | qtdeclarative5-systeminfo-plugin, |
12 | qtdeclarative5-ubuntu-content1, |
13 | |
14 | === modified file 'plugins/cellular/Components/CMakeLists.txt' |
15 | --- plugins/cellular/Components/CMakeLists.txt 2014-07-24 16:04:51 +0000 |
16 | +++ plugins/cellular/Components/CMakeLists.txt 2014-08-12 16:25:41 +0000 |
17 | @@ -1,7 +1,8 @@ |
18 | set(QML_SOURCES |
19 | CellularSingleSim.qml |
20 | + CellularDualSim.qml |
21 | data-helpers.js |
22 | - CellularDualSim.qml |
23 | + DefaultSim.qml |
24 | Sim.qml |
25 | SimEditor.qml |
26 | ) |
27 | |
28 | === added file 'plugins/cellular/Components/DefaultSim.qml' |
29 | --- plugins/cellular/Components/DefaultSim.qml 1970-01-01 00:00:00 +0000 |
30 | +++ plugins/cellular/Components/DefaultSim.qml 2014-08-12 16:25:41 +0000 |
31 | @@ -0,0 +1,69 @@ |
32 | +/* |
33 | + * Copyright (C) 2014 Canonical Ltd |
34 | + * |
35 | + * This program is free software: you can redistribute it and/or modify |
36 | + * it under the terms of the GNU General Public License version 3 as |
37 | + * published by the Free Software Foundation. |
38 | + * |
39 | + * This program is distributed in the hope that it will be useful, |
40 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
41 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
42 | + * GNU General Public License for more details. |
43 | + * |
44 | + * You should have received a copy of the GNU General Public License |
45 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
46 | + * |
47 | + * Authors: |
48 | + * Jonas G. Drange <jonas.drange@canonical.com> |
49 | + * |
50 | +*/ |
51 | +import QtQuick 2.0 |
52 | +import Ubuntu.Components 0.1 |
53 | +import Ubuntu.Components.ListItems 0.1 as ListItem |
54 | + |
55 | +Column { |
56 | + |
57 | + property var m: ["ask", sim1.path, sim2.path] |
58 | + |
59 | + function getNameFromIndex (index) { |
60 | + return [i18n.tr("Ask me each time"), sim1.title, sim2.title][index]; |
61 | + } |
62 | + |
63 | + ListItem.ItemSelector { |
64 | + id: callsDefaultSim |
65 | + text: i18n.tr("For outgoing calls, use:") |
66 | + expanded: true |
67 | + model: m |
68 | + delegate: OptionSelectorDelegate { |
69 | + objectName: "defaultForCalls" + modelData |
70 | + text: getNameFromIndex(index); |
71 | + } |
72 | + selectedIndex: m.indexOf(phoneSettings.defaultSimForCalls) |
73 | + onDelegateClicked: { |
74 | + phoneSettings.defaultSimForCalls = m[index]; |
75 | + } |
76 | + } |
77 | + |
78 | + ListItem.Caption { |
79 | + text: i18n.tr("You can change the SIM for individual calls, or for contacts in the address book.") |
80 | + } |
81 | + |
82 | + ListItem.Divider {} |
83 | + |
84 | + ListItem.ItemSelector { |
85 | + id: messagesDefaultSim |
86 | + text: i18n.tr("For messages, use:") |
87 | + expanded: true |
88 | + model: m |
89 | + delegate: OptionSelectorDelegate { |
90 | + objectName: "defaultForMessages" + modelData |
91 | + text: getNameFromIndex(index); |
92 | + } |
93 | + selectedIndex: m.indexOf(phoneSettings.defaultSimForMessages) |
94 | + onDelegateClicked: { |
95 | + phoneSettings.defaultSimForMessages = m[index]; |
96 | + |
97 | + } |
98 | + } |
99 | +} |
100 | + |
101 | |
102 | === modified file 'plugins/cellular/Components/SimEditor.qml' |
103 | --- plugins/cellular/Components/SimEditor.qml 2014-07-31 15:35:41 +0000 |
104 | +++ plugins/cellular/Components/SimEditor.qml 2014-08-12 16:25:41 +0000 |
105 | @@ -24,9 +24,12 @@ |
106 | Column { |
107 | |
108 | id: simList |
109 | + objectName: "simEditor" |
110 | |
111 | - anchors.left: parent.left |
112 | - anchors.right: parent.right |
113 | + anchors { |
114 | + left: parent.left |
115 | + right: parent.right |
116 | + } |
117 | |
118 | states: [ |
119 | State { |
120 | @@ -47,6 +50,10 @@ |
121 | target: editor |
122 | parent: sim1Placeholder |
123 | } |
124 | + PropertyChanges { |
125 | + target: sim1Exp |
126 | + expanded: true |
127 | + } |
128 | }, |
129 | State { |
130 | extend: "editing" |
131 | @@ -59,6 +66,10 @@ |
132 | target: editor |
133 | parent: sim2Placeholder |
134 | } |
135 | + PropertyChanges { |
136 | + target: sim2Exp |
137 | + expanded: true |
138 | + } |
139 | } |
140 | ] |
141 | |
142 | @@ -66,37 +77,88 @@ |
143 | text: i18n.tr("Edit SIM Name") |
144 | } |
145 | |
146 | - |
147 | - ListItem.Standard { |
148 | - id: sim1Item |
149 | - text: sim1.title |
150 | - objectName: "editSim1" |
151 | - progression: true |
152 | - onClicked: { |
153 | - simList.state = "editingSim1"; |
154 | - nameField.forceActiveFocus(); |
155 | - } |
156 | - } |
157 | - |
158 | - Column { |
159 | - id: sim1Placeholder |
160 | - } |
161 | - |
162 | - ListItem.Standard { |
163 | - id: sim2Item |
164 | - text: sim2.title |
165 | - objectName: "editSim2" |
166 | - progression: true |
167 | - onClicked: { |
168 | - simList.state = "editingSim2"; |
169 | - nameField.forceActiveFocus(); |
170 | - } |
171 | - } |
172 | - |
173 | - Column { |
174 | - id: sim2Placeholder |
175 | - } |
176 | - |
177 | + ListItem.ExpandablesColumn { |
178 | + anchors { |
179 | + left: parent.left |
180 | + right: parent.right |
181 | + } |
182 | + height: expandedItem ? |
183 | + childrenRect.height + editor.height : childrenRect.height |
184 | + |
185 | + ListItem.Expandable { |
186 | + id: sim1Exp |
187 | + expandedHeight: sim1Col.height |
188 | + objectName: "editSim1" |
189 | + Column { |
190 | + id: sim1Col |
191 | + anchors { |
192 | + left: parent.left |
193 | + right: parent.right |
194 | + } |
195 | + Item { |
196 | + anchors { |
197 | + left: parent.left |
198 | + right: parent.right |
199 | + } |
200 | + height: sim1Exp.collapsedHeight |
201 | + Label { |
202 | + objectName: "simLabel1" |
203 | + anchors { |
204 | + left: parent.left |
205 | + right: parent.right |
206 | + verticalCenter: parent.verticalCenter |
207 | + } |
208 | + text: sim1.title |
209 | + } |
210 | + } |
211 | + Column { |
212 | + id: sim1Placeholder |
213 | + } |
214 | + } |
215 | + onClicked: { |
216 | + simList.state = "editingSim1"; |
217 | + nameField.forceActiveFocus(); |
218 | + } |
219 | + } |
220 | + |
221 | + ListItem.Expandable { |
222 | + id: sim2Exp |
223 | + expandedHeight: sim2Col.height |
224 | + objectName: "editSim2" |
225 | + Column { |
226 | + id: sim2Col |
227 | + anchors { |
228 | + left: parent.left |
229 | + right: parent.right |
230 | + } |
231 | + Item { |
232 | + anchors { |
233 | + left: parent.left |
234 | + right: parent.right |
235 | + } |
236 | + height: sim2Exp.collapsedHeight |
237 | + Label { |
238 | + objectName: "simLabel2" |
239 | + anchors { |
240 | + left: parent.left |
241 | + right: parent.right |
242 | + verticalCenter: parent.verticalCenter |
243 | + } |
244 | + text: sim2.title |
245 | + } |
246 | + } |
247 | + Column { |
248 | + id: sim2Placeholder |
249 | + } |
250 | + } |
251 | + onClicked: { |
252 | + simList.state = "editingSim2"; |
253 | + nameField.forceActiveFocus(); |
254 | + } |
255 | + } |
256 | + } |
257 | + |
258 | + // this column will be re-parented by a simList state change |
259 | Column { |
260 | id: editor |
261 | visible: false |
262 | @@ -107,11 +169,6 @@ |
263 | horizontalCenter: simList.horizontalCenter |
264 | } |
265 | |
266 | - Item { |
267 | - height: units.gu(0.1) |
268 | - width: parent.width |
269 | - } |
270 | - |
271 | TextField { |
272 | id: nameField |
273 | objectName: "nameField" |
274 | @@ -145,6 +202,11 @@ |
275 | } |
276 | } |
277 | |
278 | + Item { |
279 | + height: units.gu(1) |
280 | + width: parent.width |
281 | + } |
282 | + |
283 | Action { |
284 | id: renameAction |
285 | onTriggered: { |
286 | |
287 | === modified file 'plugins/cellular/PageComponent.qml' |
288 | --- plugins/cellular/PageComponent.qml 2014-07-31 15:35:41 +0000 |
289 | +++ plugins/cellular/PageComponent.qml 2014-08-12 16:25:41 +0000 |
290 | @@ -60,6 +60,7 @@ |
291 | simTwoLoader.setSource("Components/Sim.qml", { |
292 | path: p |
293 | }); |
294 | + defaultSimLoader.source = "Components/DefaultSim.qml"; |
295 | } |
296 | } |
297 | } |
298 | @@ -109,6 +110,7 @@ |
299 | sim1: sim1, |
300 | sim2: sim2 |
301 | }); |
302 | + simEditorLoader.source = "Components/SimEditor.qml"; |
303 | } |
304 | } |
305 | |
306 | @@ -119,13 +121,11 @@ |
307 | boundsBehavior: (contentHeight > root.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds |
308 | |
309 | Column { |
310 | - anchors.left: parent.left |
311 | - anchors.right: parent.right |
312 | + anchors { left: parent.left; right: parent.right } |
313 | |
314 | Loader { |
315 | id: cellData |
316 | - anchors.left: parent.left |
317 | - anchors.right: parent.right |
318 | + anchors { left: parent.left; right: parent.right } |
319 | } |
320 | |
321 | ListItem.SingleValue { |
322 | @@ -182,9 +182,17 @@ |
323 | visible: showAllUI |
324 | } |
325 | |
326 | - SimEditor { |
327 | - visible: root.state === "dualSim" |
328 | - objectName: "simEditor" |
329 | + Loader { |
330 | + id: simEditorLoader |
331 | + anchors { left: parent.left; right: parent.right } |
332 | + } |
333 | + |
334 | + ListItem.Divider {} |
335 | + |
336 | + Loader { |
337 | + id: defaultSimLoader |
338 | + anchors.left: parent.left |
339 | + anchors.right: parent.right |
340 | } |
341 | } |
342 | } |
343 | |
344 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/__init__.py' |
345 | --- tests/autopilot/ubuntu_system_settings/tests/__init__.py 2014-08-07 09:52:19 +0000 |
346 | +++ tests/autopilot/ubuntu_system_settings/tests/__init__.py 2014-08-12 16:25:41 +0000 |
347 | @@ -265,6 +265,26 @@ |
348 | |
349 | super(UbuntuSystemSettingsOfonoTestCase, self).setUp(panel) |
350 | |
351 | + def set_default_for_calls(self, gsettings, default): |
352 | + gsettings.set_value('default-sim-for-calls', default) |
353 | + # wait for gsettings |
354 | + sleep(1) |
355 | + |
356 | + def set_default_for_messages(self, gsettings, default): |
357 | + gsettings.set_value('default-sim-for-messages', default) |
358 | + # wait for gsettings |
359 | + sleep(1) |
360 | + |
361 | + def get_default_sim_for_calls_selector(self, text): |
362 | + return self.system_settings.main_view.cellular_page.select_single( |
363 | + objectName="defaultForCalls" + text |
364 | + ) |
365 | + |
366 | + def get_default_sim_for_messages_selector(self, text): |
367 | + return self.system_settings.main_view.cellular_page.select_single( |
368 | + objectName="defaultForMessages" + text |
369 | + ) |
370 | + |
371 | |
372 | class CellularBaseTestCase(UbuntuSystemSettingsOfonoTestCase): |
373 | def setUp(self): |
374 | |
375 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_cellular.py' |
376 | --- tests/autopilot/ubuntu_system_settings/tests/test_cellular.py 2014-07-31 14:16:23 +0000 |
377 | +++ tests/autopilot/ubuntu_system_settings/tests/test_cellular.py 2014-08-12 16:25:41 +0000 |
378 | @@ -251,12 +251,6 @@ |
379 | |
380 | self.assert_selected_preference(2) |
381 | |
382 | - def test_that_sim_editor_is_hidden(self): |
383 | - editor = self.system_settings.main_view.cellular_page.select_single( |
384 | - objectName="simEditor" |
385 | - ) |
386 | - self.assertFalse(editor.get_properties()['visible']) |
387 | - |
388 | |
389 | class DualSimCellularTestCase(CellularBaseTestCase): |
390 | |
391 | @@ -330,8 +324,7 @@ |
392 | |
393 | def get_sim_name(self, num): |
394 | obj = self.system_settings.main_view.cellular_page.select_single( |
395 | - objectName="simEditor" |
396 | - ).select_single(objectName="editSim%d" % num) |
397 | + objectName="simLabel%d" % num) |
398 | return obj.get_properties()['text'] |
399 | |
400 | def rename_sim(self, num, new_name): |
401 | @@ -562,3 +555,40 @@ |
402 | gsettings.set_value('sim-names', old_names) |
403 | # wait for gsettings |
404 | sleep(1) |
405 | + |
406 | + def test_changing_default_sim_for_calls(self): |
407 | + gsettings = Gio.Settings.new('com.ubuntu.phone') |
408 | + default = gsettings.get_value('default-sim-for-calls') |
409 | + |
410 | + self.addCleanup( |
411 | + self.set_default_for_calls, gsettings, default) |
412 | + |
413 | + # click ask |
414 | + self.system_settings.main_view.scroll_to_and_click( |
415 | + self.get_default_sim_for_calls_selector('ask')) |
416 | + # click first sim |
417 | + self.system_settings.main_view.scroll_to_and_click( |
418 | + self.get_default_sim_for_calls_selector('/ril_0')) |
419 | + # wait for gsettings |
420 | + sleep(1) |
421 | + self.assertEqual( |
422 | + gsettings.get_value('default-sim-for-calls').get_string(), |
423 | + '/ril_0') |
424 | + |
425 | + def test_changing_default_sim_for_messages(self): |
426 | + gsettings = Gio.Settings.new('com.ubuntu.phone') |
427 | + default = gsettings.get_value('default-sim-for-messages') |
428 | + self.addCleanup( |
429 | + self.set_default_for_messages, gsettings, default) |
430 | + |
431 | + # click ask |
432 | + self.system_settings.main_view.scroll_to_and_click( |
433 | + self.get_default_sim_for_messages_selector('ask')) |
434 | + # click second sim |
435 | + self.system_settings.main_view.scroll_to_and_click( |
436 | + self.get_default_sim_for_messages_selector('/ril_1')) |
437 | + # wait for gsettings |
438 | + sleep(1) |
439 | + self.assertEqual( |
440 | + gsettings.get_value('default-sim-for-messages').get_string(), |
441 | + '/ril_1') |
FAILED: Continuous integration, rev:812 jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- ci/1133/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/2975 jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 2358/console jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- utopic- amd64-ci/ 325 jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- utopic- armhf-ci/ 325 jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- utopic- armhf-ci/ 325/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- utopic- i386-ci/ 325 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/3030 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/4218 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/4218/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 10928 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-utopic/ 1951/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/2624 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/2624/ artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/ubuntu- system- settings- ci/1133/ rebuild
http://