Merge lp:~jonas-drange/ubuntu-system-settings/call-fwd-wait-dual-sim into lp:ubuntu-system-settings
- call-fwd-wait-dual-sim
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~jonas-drange/ubuntu-system-settings/call-fwd-wait-dual-sim |
Merge into: | lp:ubuntu-system-settings |
Prerequisite: | lp:~jonas-drange/ubuntu-system-settings/1219793-reset |
Diff against target: |
946 lines (+647/-65) 11 files modified
plugins/phone/CMakeLists.txt (+3/-0) plugins/phone/CallForwarding.qml (+17/-13) plugins/phone/CallWaiting.qml (+10/-9) plugins/phone/DualSim.qml (+146/-0) plugins/phone/Ofono.qml (+55/-0) plugins/phone/PageComponent.qml (+53/-39) plugins/phone/Services.qml (+4/-1) plugins/phone/SingleSim.qml (+64/-0) tests/autopilot/ubuntu_system_settings/__init__.py (+145/-0) tests/autopilot/ubuntu_system_settings/tests/__init__.py (+39/-3) tests/autopilot/ubuntu_system_settings/tests/test_phone.py (+111/-0) |
To merge this branch: | bzr merge lp:~jonas-drange/ubuntu-system-settings/call-fwd-wait-dual-sim |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ken VanDine | Needs Fixing | ||
Sebastien Bacher (community) | Approve | ||
PS Jenkins bot | continuous-integration | Approve | |
Leo Arias (community) | autopilot code review | Approve | |
Review via email: mp+229774@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-08-19.
Commit message
[phone] adding dual sim functionality to phone panel
Description of the change
Hi,
the phone panel does not yet support dual SIM setups and is hardcoded to do SIM services, call wait/forward for one SIM.
This branch adds code that lazily and dynamically creates ofono qml objects based on how many SIMs there are. The ofono objects created are only the ones needed for this UI to work.
The UI has been changed for dual SIM setups and mimics the cellular where no designs exist.
Thanks
PS Jenkins bot (ps-jenkins) wrote : | # |
Leo Arias (elopio) wrote : | # |
Thanks for merging my branch.
Many of the tests have failed on Jenkins because the app wasn't launched. That's weird.
439 + :param sim: TODO I'm not sure what this is for.
465 + :param sim: TODO I'm not sure what this is for.
478 + :param sim: TODO I'm not sure what this is for.
Please fill the docstring here. I didn't know what to put in there.
tests/autopilot
There are some conflicts here ^
624 + def test_call_
That test just opens the page. It still needs to do an action and check its result.
And I thought you were going to add tests for the two other pages.
Jonas G. Drange (jonas-drange) wrote : | # |
19:47 < elopio> jgdx: we have helpers for switches, so you won't have to check if they are checked before clicking them.
19:48 < elopio> http://
19:49 < elopio> you use them like this: self.wait_
19:49 < elopio> objectName=
19:52 < elopio> also one for textfields: http://
19:52 < elopio> jgdx: you could do
19:52 < elopio> text_field = self.wait_
19:52 < elopio> text_field.
19:52 < elopio> it will take care of focusing the field, of using the right input device and of checking that it was written.
19:57 <
Leo Arias (elopio) wrote : | # |
<elopio> jgdx: we have helpers for switches, so you won't have to check if they are checked before clicking them.
<elopio> http://
--> mehow_ (~Adium@
<elopio> you use them like this: self.wait_
<elopio> objectName=
<elopio> also one for textfields: http://
<elopio> jgdx: you could do
<elopio> text_field = self.wait_
<elopio> text_field.
<elopio> it will take care of focusing the field, of using the right input device and of checking that it was written.
<jgdx> elopio, thanks!
<elopio> jgdx: I think you are not asserting the calls to the mocks anywhere.
<elopio> I got to go for a while. I'll leave this and a couple of other comments on the branch.
<elopio> thanks again jgdx. Nice work with this.
Using the helpers from the toolkit it's important because if they change the behaviour or the design, the change will be transparent for your tests.
Leo Arias (elopio) wrote : | # |
590 + @property
591 + def get_forwarding(
Properties and attributes should be named as sustantives, and methods as verbs.
So you can either remove the @property here, or remove the "get_" part of the name. I would find it more readable with a name like get_forwarding_
And, please remember to use single quotes for consistency on strings. There are some places where you use " and some where you use '.
804 + call_fwd_
809 + Eventually(
pura vida.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:866
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Sebastien Bacher (seb128) wrote : | # |
Thanks, the changes look mostly fine, I've some small style comments inline, the pre-require branch needs to be approved first as well
Sebastien Bacher (seb128) wrote : | # |
the CI shows the changes make the pep8 error, that needs to be fixed as well
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:867
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
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:870
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://
- 875. By Jonas G. Drange
-
merge trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:874
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://
Leo Arias (elopio) wrote : | # |
The autopilot code looks awesome, thanks. A new jenkins run is about to finish.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:875
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 : | # |
PASSED: Continuous integration, rev:875
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://
Leo Arias (elopio) wrote : | # |
All green!
Sebastien Bacher (seb128) wrote : | # |
looks fine to me but I don't have a dual sim to test, comment approving only, could somebody having access to the right config do a runtime test before changing the status?
Ken VanDine (ken-vandine) wrote : | # |
I tried this on my dual sim device, it's only showing me the first SIM under Phone.
- 876. By Jonas G. Drange
-
merge trunk
- 877. By Jonas G. Drange
-
refactor phone panel
- 878. By Jonas G. Drange
-
merge prereq
- 879. By Jonas G. Drange
-
merge prereq
- 880. By Jonas G. Drange
-
merge trunk
- 881. By Jonas G. Drange
-
merge prereq
- 882. By Jonas G. Drange
-
merge trunk
- 883. By Jonas G. Drange
-
be a bit more precise when using the callsettings
- 884. By Jonas G. Drange
-
merge trunk
- 885. By Jonas G. Drange
-
bad ref
- 886. By Jonas G. Drange
-
create the binding locally
- 887. By Jonas G. Drange
-
removing debug
- 888. By Jonas G. Drange
-
fix bad sim1/sim2 reference
Unmerged revisions
Preview Diff
1 | === modified file 'plugins/phone/CMakeLists.txt' | |||
2 | --- plugins/phone/CMakeLists.txt 2014-07-09 13:17:47 +0000 | |||
3 | +++ plugins/phone/CMakeLists.txt 2014-08-08 11:33:08 +0000 | |||
4 | @@ -1,9 +1,12 @@ | |||
5 | 1 | set(QML_SOURCES | 1 | set(QML_SOURCES |
6 | 2 | CallForwarding.qml | 2 | CallForwarding.qml |
7 | 3 | CallWaiting.qml | 3 | CallWaiting.qml |
8 | 4 | DualSim.qml | ||
9 | 5 | Ofono.qml | ||
10 | 4 | PageComponent.qml | 6 | PageComponent.qml |
11 | 5 | ServiceInfo.qml | 7 | ServiceInfo.qml |
12 | 6 | Services.qml | 8 | Services.qml |
13 | 9 | SingleSim.qml | ||
14 | 7 | dateUtils.js | 10 | dateUtils.js |
15 | 8 | ) | 11 | ) |
16 | 9 | 12 | ||
17 | 10 | 13 | ||
18 | === modified file 'plugins/phone/CallForwarding.qml' | |||
19 | --- plugins/phone/CallForwarding.qml 2014-07-22 20:10:26 +0000 | |||
20 | +++ plugins/phone/CallForwarding.qml 2014-08-08 11:33:08 +0000 | |||
21 | @@ -22,22 +22,22 @@ | |||
22 | 22 | import SystemSettings 1.0 | 22 | import SystemSettings 1.0 |
23 | 23 | import Ubuntu.Components 0.1 | 23 | import Ubuntu.Components 0.1 |
24 | 24 | import Ubuntu.Components.ListItems 0.1 as ListItem | 24 | import Ubuntu.Components.ListItems 0.1 as ListItem |
25 | 25 | import MeeGo.QOfono 0.2 | ||
26 | 26 | 25 | ||
27 | 27 | ItemPage { | 26 | ItemPage { |
28 | 28 | title: i18n.tr("Call forwarding") | ||
29 | 29 | 27 | ||
32 | 30 | property bool forwarding: callForwarding.voiceUnconditional !== "" | 28 | objectName: "callForwardingPage" |
33 | 31 | property string modem | 29 | title: headerTitle |
34 | 30 | property var sim | ||
35 | 31 | property bool forwarding: sim.callForwarding.voiceUnconditional !== "" | ||
36 | 32 | property string headerTitle: i18n.tr("Call forwarding") | ||
37 | 32 | 33 | ||
38 | 33 | onForwardingChanged: { | 34 | onForwardingChanged: { |
39 | 34 | if (callForwardingSwitch.checked !== forwarding) | 35 | if (callForwardingSwitch.checked !== forwarding) |
40 | 35 | callForwardingSwitch.checked = forwarding; | 36 | callForwardingSwitch.checked = forwarding; |
41 | 36 | } | 37 | } |
42 | 37 | 38 | ||
46 | 38 | OfonoCallForwarding { | 39 | Connections { |
47 | 39 | id: callForwarding | 40 | target: sim.callForwarding |
45 | 40 | modemPath: modem | ||
48 | 41 | onVoiceUnconditionalChanged: { | 41 | onVoiceUnconditionalChanged: { |
49 | 42 | destNumberField.text = voiceUnconditional; | 42 | destNumberField.text = voiceUnconditional; |
50 | 43 | } | 43 | } |
51 | @@ -50,13 +50,14 @@ | |||
52 | 50 | 50 | ||
53 | 51 | Switch { | 51 | Switch { |
54 | 52 | id: callForwardingSwitch | 52 | id: callForwardingSwitch |
55 | 53 | objectName: "callForwardingSwitch" | ||
56 | 53 | checked: forwarding | 54 | checked: forwarding |
57 | 54 | enabled: (forwarding === checked) | 55 | enabled: (forwarding === checked) |
58 | 55 | visible: callForwardingItem.control === callForwardingSwitch | 56 | visible: callForwardingItem.control === callForwardingSwitch |
59 | 56 | onCheckedChanged: { | 57 | onCheckedChanged: { |
60 | 57 | if (!checked && forwarding) { | 58 | if (!checked && forwarding) { |
61 | 58 | callForwardingIndicator.running = true; | 59 | callForwardingIndicator.running = true; |
63 | 59 | callForwarding.voiceUnconditional = ""; | 60 | sim.callForwarding.voiceUnconditional = ""; |
64 | 60 | } | 61 | } |
65 | 61 | } | 62 | } |
66 | 62 | } | 63 | } |
67 | @@ -101,17 +102,18 @@ | |||
68 | 101 | visible: callForwardingSwitch.checked | 102 | visible: callForwardingSwitch.checked |
69 | 102 | control: TextInput { | 103 | control: TextInput { |
70 | 103 | id: destNumberField | 104 | id: destNumberField |
71 | 105 | objectName: "destNumberField" | ||
72 | 104 | horizontalAlignment: TextInput.AlignRight | 106 | horizontalAlignment: TextInput.AlignRight |
73 | 105 | width: forwardToItem.width/2 | 107 | width: forwardToItem.width/2 |
74 | 106 | inputMethodHints: Qt.ImhDialableCharactersOnly | 108 | inputMethodHints: Qt.ImhDialableCharactersOnly |
76 | 107 | text: callForwarding.voiceUnconditional | 109 | text: sim.callForwarding.voiceUnconditional |
77 | 108 | font.pixelSize: units.dp(18) | 110 | font.pixelSize: units.dp(18) |
78 | 109 | font.weight: Font.Light | 111 | font.weight: Font.Light |
79 | 110 | font.family: "Ubuntu" | 112 | font.family: "Ubuntu" |
80 | 111 | color: "#AAAAAA" | 113 | color: "#AAAAAA" |
81 | 112 | maximumLength: 20 | 114 | maximumLength: 20 |
82 | 113 | focus: true | 115 | focus: true |
84 | 114 | cursorVisible: text !== callForwarding.voiceUnconditional || | 116 | cursorVisible: text !== sim.callForwarding.voiceUnconditional || |
85 | 115 | text === "" | 117 | text === "" |
86 | 116 | clip: true | 118 | clip: true |
87 | 117 | opacity: 0.9 | 119 | opacity: 0.9 |
88 | @@ -133,30 +135,32 @@ | |||
89 | 133 | spacing: units.gu(2) | 135 | spacing: units.gu(2) |
90 | 134 | 136 | ||
91 | 135 | Button { | 137 | Button { |
92 | 138 | objectName: "cancel" | ||
93 | 136 | text: i18n.tr("Cancel") | 139 | text: i18n.tr("Cancel") |
94 | 137 | width: (buttonsRowId.width-units.gu(2)*4)/3 | 140 | width: (buttonsRowId.width-units.gu(2)*4)/3 |
95 | 138 | enabled: !callForwardingIndicator.running | 141 | enabled: !callForwardingIndicator.running |
96 | 139 | onClicked: { | 142 | onClicked: { |
97 | 140 | destNumberField.text = | 143 | destNumberField.text = |
99 | 141 | callForwarding.voiceUnconditional; | 144 | sim.callForwarding.voiceUnconditional; |
100 | 142 | if (forwarding !== callForwardingSwitch.checked) | 145 | if (forwarding !== callForwardingSwitch.checked) |
101 | 143 | callForwardingSwitch.checked = forwarding; | 146 | callForwardingSwitch.checked = forwarding; |
102 | 144 | } | 147 | } |
103 | 145 | } | 148 | } |
104 | 146 | 149 | ||
105 | 147 | Button { | 150 | Button { |
106 | 151 | objectName: "set" | ||
107 | 148 | text: i18n.tr("Set") | 152 | text: i18n.tr("Set") |
108 | 149 | width: (buttonsRowId.width-units.gu(2)*4)/3 | 153 | width: (buttonsRowId.width-units.gu(2)*4)/3 |
109 | 150 | enabled: !callForwardingIndicator.running | 154 | enabled: !callForwardingIndicator.running |
110 | 151 | onClicked: { | 155 | onClicked: { |
111 | 152 | callForwardingIndicator.running = true; | 156 | callForwardingIndicator.running = true; |
113 | 153 | callForwarding.voiceUnconditional = destNumberField.text; | 157 | sim.callForwarding.voiceUnconditional = destNumberField.text; |
114 | 154 | } | 158 | } |
115 | 155 | } | 159 | } |
116 | 156 | } | 160 | } |
117 | 157 | visible: callForwardingSwitch.checked && | 161 | visible: callForwardingSwitch.checked && |
118 | 158 | (destNumberField.text !== | 162 | (destNumberField.text !== |
120 | 159 | callForwarding.voiceUnconditional) | 163 | sim.callForwarding.voiceUnconditional) |
121 | 160 | } | 164 | } |
122 | 161 | } | 165 | } |
123 | 162 | } | 166 | } |
124 | 163 | 167 | ||
125 | === modified file 'plugins/phone/CallWaiting.qml' | |||
126 | --- plugins/phone/CallWaiting.qml 2014-07-16 16:45:25 +0000 | |||
127 | +++ plugins/phone/CallWaiting.qml 2014-08-08 11:33:08 +0000 | |||
128 | @@ -22,15 +22,15 @@ | |||
129 | 22 | import SystemSettings 1.0 | 22 | import SystemSettings 1.0 |
130 | 23 | import Ubuntu.Components 0.1 | 23 | import Ubuntu.Components 0.1 |
131 | 24 | import Ubuntu.Components.ListItems 0.1 as ListItem | 24 | import Ubuntu.Components.ListItems 0.1 as ListItem |
132 | 25 | import MeeGo.QOfono 0.2 | ||
133 | 26 | 25 | ||
134 | 27 | ItemPage { | 26 | ItemPage { |
137 | 28 | title: i18n.tr("Call waiting") | 27 | objectName: "callWaitingPage" |
138 | 29 | property string modem | 28 | title: headerTitle |
139 | 29 | property var sim | ||
140 | 30 | property string headerTitle: i18n.tr("Call waiting") | ||
141 | 30 | 31 | ||
145 | 31 | OfonoCallSettings { | 32 | Connections { |
146 | 32 | id: callSettings | 33 | target: sim.callSettings |
144 | 33 | modemPath: modem | ||
147 | 34 | onVoiceCallWaitingChanged: { | 34 | onVoiceCallWaitingChanged: { |
148 | 35 | callWaitingIndicator.running = false; | 35 | callWaitingIndicator.running = false; |
149 | 36 | } | 36 | } |
150 | @@ -44,14 +44,15 @@ | |||
151 | 44 | 44 | ||
152 | 45 | Switch { | 45 | Switch { |
153 | 46 | id: callWaitingSwitch | 46 | id: callWaitingSwitch |
154 | 47 | objectName: "callWaitingSwitch" | ||
155 | 47 | visible: !callWaitingIndicator.running | 48 | visible: !callWaitingIndicator.running |
157 | 48 | checked: callSettings.voiceCallWaiting !== "disabled" | 49 | checked: sim.callSettings.voiceCallWaiting !== "disabled" |
158 | 49 | onClicked: { | 50 | onClicked: { |
159 | 50 | callWaitingIndicator.running = true; | 51 | callWaitingIndicator.running = true; |
160 | 51 | if (checked) | 52 | if (checked) |
162 | 52 | callSettings.voiceCallWaiting = "enabled"; | 53 | sim.callSettings.voiceCallWaiting = "enabled"; |
163 | 53 | else | 54 | else |
165 | 54 | callSettings.voiceCallWaiting = "disabled"; | 55 | sim.callSettings.voiceCallWaiting = "disabled"; |
166 | 55 | } | 56 | } |
167 | 56 | } | 57 | } |
168 | 57 | 58 | ||
169 | 58 | 59 | ||
170 | === added file 'plugins/phone/DualSim.qml' | |||
171 | --- plugins/phone/DualSim.qml 1970-01-01 00:00:00 +0000 | |||
172 | +++ plugins/phone/DualSim.qml 2014-08-08 11:33:08 +0000 | |||
173 | @@ -0,0 +1,146 @@ | |||
174 | 1 | /* | ||
175 | 2 | * Copyright (C) 2014 Canonical Ltd | ||
176 | 3 | * | ||
177 | 4 | * This program is free software: you can redistribute it and/or modify | ||
178 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
179 | 6 | * published by the Free Software Foundation. | ||
180 | 7 | * | ||
181 | 8 | * This program is distributed in the hope that it will be useful, | ||
182 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
183 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
184 | 11 | * GNU General Public License for more details. | ||
185 | 12 | * | ||
186 | 13 | * You should have received a copy of the GNU General Public License | ||
187 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
188 | 15 | * | ||
189 | 16 | * Authors: | ||
190 | 17 | * Ken Vandine <ken.vandine@canonical.com> | ||
191 | 18 | * Jonas G. Drange <jonas.drange@canonical.com> | ||
192 | 19 | * | ||
193 | 20 | */ | ||
194 | 21 | import QtQuick 2.0 | ||
195 | 22 | import GSettings 1.0 | ||
196 | 23 | import Ubuntu.Components 1.1 | ||
197 | 24 | import Ubuntu.Components.ListItems 0.1 as ListItem | ||
198 | 25 | |||
199 | 26 | Column { | ||
200 | 27 | |||
201 | 28 | anchors.left: parent.left | ||
202 | 29 | anchors.right: parent.right | ||
203 | 30 | |||
204 | 31 | Ofono { | ||
205 | 32 | id: sim1 | ||
206 | 33 | path: modemsSorted[0] | ||
207 | 34 | } | ||
208 | 35 | |||
209 | 36 | Ofono { | ||
210 | 37 | id: sim2 | ||
211 | 38 | path: modemsSorted[1] | ||
212 | 39 | } | ||
213 | 40 | |||
214 | 41 | ListItem.Standard { | ||
215 | 42 | text: sim1.title | ||
216 | 43 | } | ||
217 | 44 | |||
218 | 45 | ListItem.Standard { | ||
219 | 46 | objectName: "callFwdSim1" | ||
220 | 47 | text: i18n.tr("Call forwarding") | ||
221 | 48 | progression: true | ||
222 | 49 | onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"), { | ||
223 | 50 | sim: sim1, | ||
224 | 51 | headerTitle: sim1.title | ||
225 | 52 | }) | ||
226 | 53 | } | ||
227 | 54 | |||
228 | 55 | ListItem.Standard { | ||
229 | 56 | objectName: "callWaitSim1" | ||
230 | 57 | text: i18n.tr("Call waiting") | ||
231 | 58 | progression: true | ||
232 | 59 | onClicked: pageStack.push(Qt.resolvedUrl("CallWaiting.qml"), { | ||
233 | 60 | sim: sim1, | ||
234 | 61 | headerTitle: sim1.title | ||
235 | 62 | }) | ||
236 | 63 | } | ||
237 | 64 | |||
238 | 65 | ListItem.Standard { | ||
239 | 66 | objectName: "simServicesSim1" | ||
240 | 67 | text: i18n.tr("Services") | ||
241 | 68 | progression: true | ||
242 | 69 | enabled: sim1.simMng.present | ||
243 | 70 | onClicked: pageStack.push(Qt.resolvedUrl("Services.qml"), { | ||
244 | 71 | carrierString: sim1.netReg.name, | ||
245 | 72 | sim: sim1.simMng, | ||
246 | 73 | headerTitle: sim1.title | ||
247 | 74 | }) | ||
248 | 75 | } | ||
249 | 76 | |||
250 | 77 | ListItem.Divider {} | ||
251 | 78 | |||
252 | 79 | ListItem.Standard { | ||
253 | 80 | text: sim2.title | ||
254 | 81 | } | ||
255 | 82 | |||
256 | 83 | ListItem.Standard { | ||
257 | 84 | objectName: "callFwdSim2" | ||
258 | 85 | text: i18n.tr("Call forwarding") | ||
259 | 86 | progression: true | ||
260 | 87 | onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"), { | ||
261 | 88 | sim: sim2, | ||
262 | 89 | headerTitle: sim2.title | ||
263 | 90 | }) | ||
264 | 91 | } | ||
265 | 92 | |||
266 | 93 | ListItem.Standard { | ||
267 | 94 | objectName: "callWaitSim2" | ||
268 | 95 | text: i18n.tr("Call waiting") | ||
269 | 96 | progression: true | ||
270 | 97 | onClicked: pageStack.push(Qt.resolvedUrl("CallWaiting.qml"), { | ||
271 | 98 | sim: sim2, | ||
272 | 99 | headerTitle: sim2.title | ||
273 | 100 | }) | ||
274 | 101 | } | ||
275 | 102 | |||
276 | 103 | ListItem.Standard { | ||
277 | 104 | objectName: "simServicesSim2" | ||
278 | 105 | text: i18n.tr("Services") | ||
279 | 106 | progression: true | ||
280 | 107 | enabled: sim2.simMng.present | ||
281 | 108 | onClicked: pageStack.push(Qt.resolvedUrl("Services.qml"), { | ||
282 | 109 | carrierString: sim2.netReg.name, | ||
283 | 110 | sim: sim2.simMng, | ||
284 | 111 | headerTitle: sim2.title | ||
285 | 112 | }) | ||
286 | 113 | } | ||
287 | 114 | |||
288 | 115 | |||
289 | 116 | GSettings { | ||
290 | 117 | id: phoneSettings | ||
291 | 118 | schema.id: "com.ubuntu.phone" | ||
292 | 119 | Component.onCompleted: { | ||
293 | 120 | // set default names | ||
294 | 121 | var simNames = phoneSettings.simNames; | ||
295 | 122 | var m0 = sim1.path | ||
296 | 123 | var m1 = sim2.path | ||
297 | 124 | if (!simNames[m0]) { | ||
298 | 125 | simNames[m0] = "SIM 1"; | ||
299 | 126 | } | ||
300 | 127 | if (!simNames[m1])Â { | ||
301 | 128 | simNames[m1] = "SIM 2"; | ||
302 | 129 | } | ||
303 | 130 | phoneSettings.simNames = simNames; | ||
304 | 131 | } | ||
305 | 132 | } | ||
306 | 133 | |||
307 | 134 | Binding { | ||
308 | 135 | target: sim1 | ||
309 | 136 | property: "name" | ||
310 | 137 | value: phoneSettings.simNames[modemsSorted[0]] | ||
311 | 138 | } | ||
312 | 139 | |||
313 | 140 | Binding { | ||
314 | 141 | target: sim2 | ||
315 | 142 | property: "name" | ||
316 | 143 | value: phoneSettings.simNames[modemsSorted[1]] | ||
317 | 144 | } | ||
318 | 145 | |||
319 | 146 | } | ||
320 | 0 | 147 | ||
321 | === added file 'plugins/phone/Ofono.qml' | |||
322 | --- plugins/phone/Ofono.qml 1970-01-01 00:00:00 +0000 | |||
323 | +++ plugins/phone/Ofono.qml 2014-08-08 11:33:08 +0000 | |||
324 | @@ -0,0 +1,55 @@ | |||
325 | 1 | /* | ||
326 | 2 | * Copyright (C) 2014 Canonical Ltd | ||
327 | 3 | * | ||
328 | 4 | * This program is free software: you can redistribute it and/or modify | ||
329 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
330 | 6 | * published by the Free Software Foundation. | ||
331 | 7 | * | ||
332 | 8 | * This program is distributed in the hope that it will be useful, | ||
333 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
334 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
335 | 11 | * GNU General Public License for more details. | ||
336 | 12 | * | ||
337 | 13 | * You should have received a copy of the GNU General Public License | ||
338 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
339 | 15 | * | ||
340 | 16 | * Authors: | ||
341 | 17 | * Jonas G. Drange <jonas.drange@canonical.com> | ||
342 | 18 | * | ||
343 | 19 | */ | ||
344 | 20 | import QtQuick 2.0 | ||
345 | 21 | import MeeGo.QOfono 0.2 | ||
346 | 22 | |||
347 | 23 | Item { | ||
348 | 24 | property alias callForwarding: callForwarding | ||
349 | 25 | property alias callSettings: callSettings | ||
350 | 26 | property alias netReg: netReg | ||
351 | 27 | property alias simMng: simMng | ||
352 | 28 | |||
353 | 29 | property string path | ||
354 | 30 | property string name | ||
355 | 31 | property string title: { | ||
356 | 32 | var number = simMng.subscriberNumbers[0] || simMng.subscriberIdentity; | ||
357 | 33 | return name + (number ? " (" + number + ")" : ""); | ||
358 | 34 | } | ||
359 | 35 | |||
360 | 36 | OfonoCallSettings { | ||
361 | 37 | id: callSettings | ||
362 | 38 | modemPath: path | ||
363 | 39 | } | ||
364 | 40 | |||
365 | 41 | OfonoCallForwarding { | ||
366 | 42 | id: callForwarding | ||
367 | 43 | modemPath: path | ||
368 | 44 | } | ||
369 | 45 | |||
370 | 46 | OfonoNetworkRegistration { | ||
371 | 47 | id: netReg | ||
372 | 48 | modemPath: path | ||
373 | 49 | } | ||
374 | 50 | |||
375 | 51 | OfonoSimManager { | ||
376 | 52 | id: simMng | ||
377 | 53 | modemPath: path | ||
378 | 54 | } | ||
379 | 55 | } | ||
380 | 0 | 56 | ||
381 | === modified file 'plugins/phone/PageComponent.qml' | |||
382 | --- plugins/phone/PageComponent.qml 2014-07-18 13:00:36 +0000 | |||
383 | +++ plugins/phone/PageComponent.qml 2014-08-08 11:33:08 +0000 | |||
384 | @@ -25,50 +25,64 @@ | |||
385 | 25 | import MeeGo.QOfono 0.2 | 25 | import MeeGo.QOfono 0.2 |
386 | 26 | 26 | ||
387 | 27 | ItemPage { | 27 | ItemPage { |
388 | 28 | id: root | ||
389 | 29 | objectName: "phonePage" | ||
390 | 28 | title: i18n.tr("Phone") | 30 | title: i18n.tr("Phone") |
393 | 29 | property string carrierName: netop.name | 31 | flickable: flick |
394 | 30 | property string carrierString: carrierName ? carrierName : i18n.tr("SIM") | 32 | |
395 | 33 | property var modemsSorted: manager.modems.slice(0).sort() | ||
396 | 34 | |||
397 | 35 | states: [ | ||
398 | 36 | State { | ||
399 | 37 | name: "singleSim" | ||
400 | 38 | PropertyChanges { | ||
401 | 39 | target: singleSim | ||
402 | 40 | source: "SingleSim.qml" | ||
403 | 41 | } | ||
404 | 42 | }, | ||
405 | 43 | State { | ||
406 | 44 | name: "dualSim" | ||
407 | 45 | PropertyChanges { | ||
408 | 46 | target: dualSim | ||
409 | 47 | source: "DualSim.qml" | ||
410 | 48 | } | ||
411 | 49 | } | ||
412 | 50 | ] | ||
413 | 31 | 51 | ||
414 | 32 | OfonoManager { | 52 | OfonoManager { |
415 | 33 | id: manager | 53 | id: manager |
430 | 34 | } | 54 | Component.onCompleted: { |
431 | 35 | 55 | if (modems.length === 1) { | |
432 | 36 | OfonoNetworkRegistration { | 56 | root.state = "singleSim"; |
433 | 37 | id: netop; | 57 | } else if (modems.length === 2) { |
434 | 38 | modemPath: manager.modems[0] | 58 | root.state = "dualSim"; |
435 | 39 | onNameChanged: carrierName = netop.name | 59 | } |
436 | 40 | } | 60 | } |
437 | 41 | 61 | } | |
438 | 42 | OfonoSimManager { | 62 | |
439 | 43 | id: sim | 63 | Flickable { |
440 | 44 | modemPath: manager.modems[0] | 64 | id: flick |
427 | 45 | } | ||
428 | 46 | |||
429 | 47 | Column { | ||
441 | 48 | anchors.fill: parent | 65 | anchors.fill: parent |
465 | 49 | 66 | contentWidth: parent.width | |
466 | 50 | ListItem.Standard { | 67 | contentHeight: contentItem.childrenRect.height |
467 | 51 | text: i18n.tr("Call forwarding") | 68 | boundsBehavior: (contentHeight > root.height) ? |
468 | 52 | progression: true | 69 | Flickable.DragAndOvershootBounds : Flickable.StopAtBounds |
469 | 53 | onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"), {modem: manager.modems[0]}) | 70 | |
470 | 54 | } | 71 | Column { |
471 | 55 | 72 | anchors.left: parent.left | |
472 | 56 | ListItem.Standard { | 73 | anchors.right: parent.right |
473 | 57 | text: i18n.tr("Call waiting") | 74 | |
474 | 58 | progression: true | 75 | Loader { |
475 | 59 | onClicked: pageStack.push(Qt.resolvedUrl("CallWaiting.qml"), {modem: manager.modems[0]}) | 76 | id: singleSim |
476 | 60 | showDivider: false | 77 | anchors.left: parent.left |
477 | 61 | } | 78 | anchors.right: parent.right |
478 | 62 | 79 | } | |
479 | 63 | ListItem.Divider {} | 80 | |
480 | 64 | 81 | Loader { | |
481 | 65 | ListItem.Standard { | 82 | id: dualSim |
482 | 66 | // TRANSLATORS: %1 is the name of the (network) carrier | 83 | anchors.left: parent.left |
483 | 67 | text: i18n.tr("%1 Services").arg(carrierString) | 84 | anchors.right: parent.right |
484 | 68 | progression: true | 85 | } |
462 | 69 | enabled: sim.present | ||
463 | 70 | onClicked: pageStack.push(Qt.resolvedUrl("Services.qml"), | ||
464 | 71 | {carrierString: carrierString, sim: sim}) | ||
485 | 72 | } | 86 | } |
486 | 73 | } | 87 | } |
487 | 74 | } | 88 | } |
488 | 75 | 89 | ||
489 | === modified file 'plugins/phone/Services.qml' | |||
490 | --- plugins/phone/Services.qml 2014-06-19 03:54:01 +0000 | |||
491 | +++ plugins/phone/Services.qml 2014-08-08 11:33:08 +0000 | |||
492 | @@ -24,12 +24,15 @@ | |||
493 | 24 | import Ubuntu.Components.ListItems 0.1 as ListItem | 24 | import Ubuntu.Components.ListItems 0.1 as ListItem |
494 | 25 | 25 | ||
495 | 26 | ItemPage { | 26 | ItemPage { |
496 | 27 | objectName: "servicesPage" | ||
497 | 28 | title: headerTitle | ||
498 | 27 | property string carrierString | 29 | property string carrierString |
499 | 28 | property variant sim | 30 | property variant sim |
500 | 29 | property var names: [] | 31 | property var names: [] |
501 | 30 | 32 | ||
502 | 31 | // TRANSLATORS: %1 is the name of the (network) carrier | 33 | // TRANSLATORS: %1 is the name of the (network) carrier |
504 | 32 | title: i18n.tr("%1 Services").arg(carrierString) | 34 | property string headerTitle: i18n.tr("%1 Services").arg(carrierString) |
505 | 35 | |||
506 | 33 | 36 | ||
507 | 34 | Component.onCompleted: { | 37 | Component.onCompleted: { |
508 | 35 | var keys = []; | 38 | var keys = []; |
509 | 36 | 39 | ||
510 | === added file 'plugins/phone/SingleSim.qml' | |||
511 | --- plugins/phone/SingleSim.qml 1970-01-01 00:00:00 +0000 | |||
512 | +++ plugins/phone/SingleSim.qml 2014-08-08 11:33:08 +0000 | |||
513 | @@ -0,0 +1,64 @@ | |||
514 | 1 | /* | ||
515 | 2 | * Copyright (C) 2014 Canonical Ltd | ||
516 | 3 | * | ||
517 | 4 | * This program is free software: you can redistribute it and/or modify | ||
518 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
519 | 6 | * published by the Free Software Foundation. | ||
520 | 7 | * | ||
521 | 8 | * This program is distributed in the hope that it will be useful, | ||
522 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
523 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
524 | 11 | * GNU General Public License for more details. | ||
525 | 12 | * | ||
526 | 13 | * You should have received a copy of the GNU General Public License | ||
527 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
528 | 15 | * | ||
529 | 16 | * Authors: | ||
530 | 17 | * Ken Vandine <ken.vandine@canonical.com> | ||
531 | 18 | * Jonas G. Drange <jonas.drange@canonical.com> | ||
532 | 19 | * | ||
533 | 20 | */ | ||
534 | 21 | import QtQuick 2.0 | ||
535 | 22 | import Ubuntu.Components 1.1 | ||
536 | 23 | import Ubuntu.Components.ListItems 0.1 as ListItem | ||
537 | 24 | |||
538 | 25 | Column { | ||
539 | 26 | |||
540 | 27 | anchors.left: parent.left | ||
541 | 28 | anchors.right: parent.right | ||
542 | 29 | |||
543 | 30 | property string carrierName: sim.netReg.name | ||
544 | 31 | property string carrierString: carrierName ? carrierName : i18n.tr("SIM") | ||
545 | 32 | |||
546 | 33 | Ofono { | ||
547 | 34 | id: sim | ||
548 | 35 | path: modemsSorted[0] | ||
549 | 36 | } | ||
550 | 37 | |||
551 | 38 | ListItem.Standard { | ||
552 | 39 | objectName: "callFwd" | ||
553 | 40 | text: i18n.tr("Call forwarding") | ||
554 | 41 | progression: true | ||
555 | 42 | onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"), {sim: sim}) | ||
556 | 43 | } | ||
557 | 44 | |||
558 | 45 | ListItem.Standard { | ||
559 | 46 | objectName: "callWait" | ||
560 | 47 | text: i18n.tr("Call waiting") | ||
561 | 48 | progression: true | ||
562 | 49 | onClicked: pageStack.push(Qt.resolvedUrl("CallWaiting.qml"), {sim: sim}) | ||
563 | 50 | showDivider: false | ||
564 | 51 | } | ||
565 | 52 | |||
566 | 53 | ListItem.Divider {} | ||
567 | 54 | |||
568 | 55 | ListItem.Standard { | ||
569 | 56 | objectName: "simServices" | ||
570 | 57 | // TRANSLATORS: %1 is the name of the (network) carrier | ||
571 | 58 | text: i18n.tr("%1 Services").arg(carrierString) | ||
572 | 59 | progression: true | ||
573 | 60 | enabled: sim.simMng.present | ||
574 | 61 | onClicked: pageStack.push(Qt.resolvedUrl("Services.qml"), | ||
575 | 62 | {carrierString: carrierString, sim: sim.simMng}) | ||
576 | 63 | } | ||
577 | 64 | } | ||
578 | 0 | 65 | ||
579 | === modified file 'tests/autopilot/ubuntu_system_settings/__init__.py' | |||
580 | --- tests/autopilot/ubuntu_system_settings/__init__.py 2014-08-01 00:24:24 +0000 | |||
581 | +++ tests/autopilot/ubuntu_system_settings/__init__.py 2014-08-08 11:33:08 +0000 | |||
582 | @@ -23,6 +23,7 @@ | |||
583 | 23 | 23 | ||
584 | 24 | from time import sleep | 24 | from time import sleep |
585 | 25 | 25 | ||
586 | 26 | from autopilot.input import Keyboard | ||
587 | 26 | import autopilot.logging | 27 | import autopilot.logging |
588 | 27 | import ubuntuuitoolkit | 28 | import ubuntuuitoolkit |
589 | 28 | from autopilot import introspection, platform | 29 | from autopilot import introspection, platform |
590 | @@ -102,6 +103,10 @@ | |||
591 | 102 | self.pointing_device.click_object(item) | 103 | self.pointing_device.click_object(item) |
592 | 103 | 104 | ||
593 | 104 | @autopilot.logging.log_action(logger.debug) | 105 | @autopilot.logging.log_action(logger.debug) |
594 | 106 | def go_to_phone_page(self): | ||
595 | 107 | return self._go_to_page('entryComponent-phone', 'phonePage') | ||
596 | 108 | |||
597 | 109 | @autopilot.logging.log_action(logger.debug) | ||
598 | 105 | def go_to_reset_phone(self): | 110 | def go_to_reset_phone(self): |
599 | 106 | return self._go_to_page('entryComponent-reset', 'resetPage') | 111 | return self._go_to_page('entryComponent-reset', 'resetPage') |
600 | 107 | 112 | ||
601 | @@ -299,6 +304,146 @@ | |||
602 | 299 | return False | 304 | return False |
603 | 300 | 305 | ||
604 | 301 | 306 | ||
605 | 307 | class PhonePage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | ||
606 | 308 | |||
607 | 309 | """Autopilot helper for the Phone page.""" | ||
608 | 310 | |||
609 | 311 | @classmethod | ||
610 | 312 | def validate_dbus_object(cls, path, state): | ||
611 | 313 | name = introspection.get_classname_from_path(path) | ||
612 | 314 | if name == b'PageComponent': | ||
613 | 315 | if state['objectName'][1] == 'phonePage': | ||
614 | 316 | return True | ||
615 | 317 | return False | ||
616 | 318 | |||
617 | 319 | @autopilot.logging.log_action(logger.info) | ||
618 | 320 | def go_to_call_forwarding(self, sim=None): | ||
619 | 321 | """Open the Call Forwarding settings page. | ||
620 | 322 | |||
621 | 323 | :param sim: Number of what SIM to use, either 1 or 2. | ||
622 | 324 | Required parameter in dual SIM setups | ||
623 | 325 | :returns: The Call Forwarding settings page. | ||
624 | 326 | |||
625 | 327 | """ | ||
626 | 328 | find = "callFwd" | ||
627 | 329 | if sim: | ||
628 | 330 | find = "callFwdSim%d" % sim | ||
629 | 331 | |||
630 | 332 | return self._go_to_page(find, 'callForwardingPage') | ||
631 | 333 | |||
632 | 334 | def _go_to_page(self, item_object_name, page_object_name): | ||
633 | 335 | self._click_item(item_object_name) | ||
634 | 336 | page = self.get_root_instance().wait_select_single( | ||
635 | 337 | objectName=page_object_name) | ||
636 | 338 | page.active.wait_for(True) | ||
637 | 339 | return page | ||
638 | 340 | |||
639 | 341 | def _click_item(self, object_name): | ||
640 | 342 | item = self.select_single(objectName=object_name) | ||
641 | 343 | item.swipe_into_view() | ||
642 | 344 | self.pointing_device.click_object(item) | ||
643 | 345 | |||
644 | 346 | @autopilot.logging.log_action(logger.info) | ||
645 | 347 | def go_to_call_waiting(self, sim=None): | ||
646 | 348 | """Open the Call Waiting settings page. | ||
647 | 349 | |||
648 | 350 | :param sim: Number of what SIM to use, either 1 or 2. | ||
649 | 351 | Required parameter in dual SIM setups | ||
650 | 352 | :returns: The Call Waiting settings page. | ||
651 | 353 | |||
652 | 354 | """ | ||
653 | 355 | find = "callWait" | ||
654 | 356 | if sim: | ||
655 | 357 | find = "callWaitSim%d" % sim | ||
656 | 358 | return self._go_to_page(find, 'callWaitingPage') | ||
657 | 359 | |||
658 | 360 | @autopilot.logging.log_action(logger.info) | ||
659 | 361 | def go_to_sim_services(self, sim=None): | ||
660 | 362 | """Open the SIM Services settings page. | ||
661 | 363 | |||
662 | 364 | :param sim: Number of what SIM to use, either 1 or 2. | ||
663 | 365 | Required parameter in dual SIM setups | ||
664 | 366 | :returns: The SIM Services settings page. | ||
665 | 367 | |||
666 | 368 | """ | ||
667 | 369 | find = "simServices" | ||
668 | 370 | if sim: | ||
669 | 371 | find = "simServicesSim%d" % sim | ||
670 | 372 | |||
671 | 373 | return self._go_to_page(find, 'servicesPage') | ||
672 | 374 | |||
673 | 375 | |||
674 | 376 | class CallWaiting(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | ||
675 | 377 | |||
676 | 378 | """Autopilot helper for the Call waiting page.""" | ||
677 | 379 | |||
678 | 380 | @property | ||
679 | 381 | def _switch(self): | ||
680 | 382 | return self.wait_select_single( | ||
681 | 383 | ubuntuuitoolkit.CheckBox, | ||
682 | 384 | objectName='callWaitingSwitch') | ||
683 | 385 | |||
684 | 386 | def enable_call_waiting(self): | ||
685 | 387 | self._switch.check() | ||
686 | 388 | |||
687 | 389 | def disable_call_waiting(self): | ||
688 | 390 | self._switch.uncheck() | ||
689 | 391 | |||
690 | 392 | |||
691 | 393 | class CallForwarding(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | ||
692 | 394 | |||
693 | 395 | """Autopilot helper for the Call forwarding page.""" | ||
694 | 396 | |||
695 | 397 | @property | ||
696 | 398 | def _switch(self): | ||
697 | 399 | return self.wait_select_single( | ||
698 | 400 | ubuntuuitoolkit.CheckBox, | ||
699 | 401 | objectName='callForwardingSwitch') | ||
700 | 402 | |||
701 | 403 | @property | ||
702 | 404 | def _number_field(self): | ||
703 | 405 | return self.wait_select_single( | ||
704 | 406 | objectName='destNumberField') | ||
705 | 407 | |||
706 | 408 | def _click_set(self): | ||
707 | 409 | button = self.wait_select_single( | ||
708 | 410 | objectName='set') | ||
709 | 411 | self.pointing_device.click_object(button) | ||
710 | 412 | |||
711 | 413 | def _click_cancel(self): | ||
712 | 414 | button = self.wait_select_single( | ||
713 | 415 | objectName='cancel') | ||
714 | 416 | self.pointing_device.click_object(button) | ||
715 | 417 | |||
716 | 418 | @property | ||
717 | 419 | def current_forwarding(self): | ||
718 | 420 | return self.wait_select_single( | ||
719 | 421 | objectName='destNumberField').text | ||
720 | 422 | |||
721 | 423 | def enable_call_forwarding(self): | ||
722 | 424 | self._switch.check() | ||
723 | 425 | |||
724 | 426 | def disable_call_forwarding(self): | ||
725 | 427 | self._switch.uncheck() | ||
726 | 428 | |||
727 | 429 | def set_forward(self, number): | ||
728 | 430 | input_method = Keyboard.create() | ||
729 | 431 | self.enable_call_forwarding() | ||
730 | 432 | self.pointing_device.click_object(self._number_field) | ||
731 | 433 | input_method.type(number) | ||
732 | 434 | self._click_set() | ||
733 | 435 | |||
734 | 436 | |||
735 | 437 | class Services(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | ||
736 | 438 | |||
737 | 439 | """Autopilot helper for the Call waiting page.""" | ||
738 | 440 | |||
739 | 441 | # TODO: add pages for each relevant sim services page | ||
740 | 442 | def open_sim_service(self, service): | ||
741 | 443 | """Return a sim service page""" | ||
742 | 444 | pass | ||
743 | 445 | |||
744 | 446 | |||
745 | 302 | class ResetPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | 447 | class ResetPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): |
746 | 303 | 448 | ||
747 | 304 | """Autopilot helper for the Reset page.""" | 449 | """Autopilot helper for the Reset page.""" |
748 | 305 | 450 | ||
749 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/__init__.py' | |||
750 | --- tests/autopilot/ubuntu_system_settings/tests/__init__.py 2014-08-07 09:52:19 +0000 | |||
751 | +++ tests/autopilot/ubuntu_system_settings/tests/__init__.py 2014-08-08 11:33:08 +0000 | |||
752 | @@ -34,6 +34,8 @@ | |||
753 | 34 | RDO_IFACE = 'org.ofono.RadioSettings' | 34 | RDO_IFACE = 'org.ofono.RadioSettings' |
754 | 35 | SIM_IFACE = 'org.ofono.SimManager' | 35 | SIM_IFACE = 'org.ofono.SimManager' |
755 | 36 | NETREG_IFACE = 'org.ofono.NetworkRegistration' | 36 | NETREG_IFACE = 'org.ofono.NetworkRegistration' |
756 | 37 | CALL_FWD_IFACE = 'org.ofono.CallForwarding' | ||
757 | 38 | CALL_SETTINGS_IFACE = 'org.ofono.CallSettings' | ||
758 | 37 | SYSTEM_IFACE = 'com.canonical.SystemImage' | 39 | SYSTEM_IFACE = 'com.canonical.SystemImage' |
759 | 38 | SYSTEM_SERVICE_OBJ = '/Service' | 40 | SYSTEM_SERVICE_OBJ = '/Service' |
760 | 39 | 41 | ||
761 | @@ -202,18 +204,43 @@ | |||
762 | 202 | "PropertyChanged", "sv", [args[0], args[1]])' | 204 | "PropertyChanged", "sv", [args[0], args[1]])' |
763 | 203 | .replace('IFACE', SIM_IFACE)), ]) | 205 | .replace('IFACE', SIM_IFACE)), ]) |
764 | 204 | 206 | ||
765 | 207 | def mock_call_forwarding(self, modem): | ||
766 | 208 | modem.AddProperty( | ||
767 | 209 | CALL_FWD_IFACE, 'VoiceUnconditional', '') | ||
768 | 210 | modem.AddMethods( | ||
769 | 211 | CALL_FWD_IFACE, | ||
770 | 212 | [('GetProperties', '', 'a{sv}', | ||
771 | 213 | 'ret = self.GetAll("%s")' % CALL_FWD_IFACE), | ||
772 | 214 | ('SetProperty', 'sv', '', | ||
773 | 215 | 'self.Set("IFACE", args[0], args[1]); ' | ||
774 | 216 | 'self.EmitSignal("IFACE",\ | ||
775 | 217 | "PropertyChanged", "sv", [args[0], args[1]])' | ||
776 | 218 | .replace('IFACE', CALL_FWD_IFACE)), ]) | ||
777 | 219 | |||
778 | 220 | def mock_call_settings(self, modem): | ||
779 | 221 | modem.AddProperty( | ||
780 | 222 | CALL_SETTINGS_IFACE, 'VoiceCallWaiting', 'disabled') | ||
781 | 223 | modem.AddMethods( | ||
782 | 224 | CALL_SETTINGS_IFACE, | ||
783 | 225 | [('GetProperties', '', 'a{sv}', | ||
784 | 226 | 'ret = self.GetAll("%s")' % CALL_SETTINGS_IFACE), | ||
785 | 227 | ('SetProperty', 'sv', '', | ||
786 | 228 | 'self.Set("IFACE", args[0], args[1]); ' | ||
787 | 229 | 'self.EmitSignal("IFACE",\ | ||
788 | 230 | "PropertyChanged", "sv", [args[0], args[1]])' | ||
789 | 231 | .replace('IFACE', CALL_SETTINGS_IFACE)), ]) | ||
790 | 232 | |||
791 | 205 | def add_sim1(self): | 233 | def add_sim1(self): |
792 | 206 | # create modem_0 proxy | 234 | # create modem_0 proxy |
793 | 207 | self.modem_0 = self.dbus_con.get_object('org.ofono', '/ril_0') | 235 | self.modem_0 = self.dbus_con.get_object('org.ofono', '/ril_0') |
794 | 208 | 236 | ||
795 | 209 | # Add an available carrier | 237 | # Add an available carrier |
796 | 210 | self.mock_carriers('ril_0') | 238 | self.mock_carriers('ril_0') |
797 | 211 | |||
798 | 212 | self.mock_radio_settings(self.modem_0) | 239 | self.mock_radio_settings(self.modem_0) |
799 | 213 | |||
800 | 214 | self.mock_connection_manager(self.modem_0) | 240 | self.mock_connection_manager(self.modem_0) |
801 | 215 | |||
802 | 216 | self.mock_sim_manager(self.modem_0) | 241 | self.mock_sim_manager(self.modem_0) |
803 | 242 | self.mock_call_forwarding(self.modem_0) | ||
804 | 243 | self.mock_call_settings(self.modem_0) | ||
805 | 217 | 244 | ||
806 | 218 | self.modem_0.AddMethods('org.ofono.NetworkRegistration', [ | 245 | self.modem_0.AddMethods('org.ofono.NetworkRegistration', [ |
807 | 219 | ('GetProperties', '', 'a{sv}', | 246 | ('GetProperties', '', 'a{sv}', |
808 | @@ -242,6 +269,8 @@ | |||
809 | 242 | self.mock_carriers(second_modem) | 269 | self.mock_carriers(second_modem) |
810 | 243 | self.mock_radio_settings(self.modem_1) | 270 | self.mock_radio_settings(self.modem_1) |
811 | 244 | self.mock_connection_manager(self.modem_1) | 271 | self.mock_connection_manager(self.modem_1) |
812 | 272 | self.mock_call_forwarding(self.modem_1) | ||
813 | 273 | self.mock_call_settings(self.modem_1) | ||
814 | 245 | 274 | ||
815 | 246 | self.mock_sim_manager(self.modem_1, { | 275 | self.mock_sim_manager(self.modem_1, { |
816 | 247 | 'SubscriberNumbers': ['08123', '938762783'] | 276 | 'SubscriberNumbers': ['08123', '938762783'] |
817 | @@ -272,6 +301,13 @@ | |||
818 | 272 | super(CellularBaseTestCase, self).setUp('cellular') | 301 | super(CellularBaseTestCase, self).setUp('cellular') |
819 | 273 | 302 | ||
820 | 274 | 303 | ||
821 | 304 | class PhoneOfonoBaseTestCase(UbuntuSystemSettingsOfonoTestCase): | ||
822 | 305 | def setUp(self): | ||
823 | 306 | """ Go to Phone page """ | ||
824 | 307 | super(PhoneOfonoBaseTestCase, self).setUp() | ||
825 | 308 | self.phone_page = self.system_settings.main_view.go_to_phone_page() | ||
826 | 309 | |||
827 | 310 | |||
828 | 275 | class AboutBaseTestCase(UbuntuSystemSettingsTestCase): | 311 | class AboutBaseTestCase(UbuntuSystemSettingsTestCase): |
829 | 276 | def setUp(self): | 312 | def setUp(self): |
830 | 277 | """Go to About page.""" | 313 | """Go to About page.""" |
831 | 278 | 314 | ||
832 | === added file 'tests/autopilot/ubuntu_system_settings/tests/test_phone.py' | |||
833 | --- tests/autopilot/ubuntu_system_settings/tests/test_phone.py 1970-01-01 00:00:00 +0000 | |||
834 | +++ tests/autopilot/ubuntu_system_settings/tests/test_phone.py 2014-08-08 11:33:08 +0000 | |||
835 | @@ -0,0 +1,111 @@ | |||
836 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
837 | 2 | # Copyright 2014 Canonical | ||
838 | 3 | # | ||
839 | 4 | # This program is free software: you can redistribute it and/or modify it | ||
840 | 5 | # under the terms of the GNU General Public License version 3, as published | ||
841 | 6 | # by the Free Software Foundation. | ||
842 | 7 | |||
843 | 8 | from __future__ import absolute_import | ||
844 | 9 | |||
845 | 10 | from autopilot.matchers import Eventually | ||
846 | 11 | from testtools.matchers import Contains, Equals | ||
847 | 12 | |||
848 | 13 | from ubuntu_system_settings.tests import ( | ||
849 | 14 | PhoneOfonoBaseTestCase, CALL_FWD_IFACE, CALL_SETTINGS_IFACE) | ||
850 | 15 | |||
851 | 16 | |||
852 | 17 | class PhoneTestCase(PhoneOfonoBaseTestCase): | ||
853 | 18 | """Tests for Phone Page""" | ||
854 | 19 | |||
855 | 20 | def test_call_fwd(self): | ||
856 | 21 | call_fwd_page = self.phone_page.go_to_call_forwarding() | ||
857 | 22 | call_fwd_page.set_forward("41444424") | ||
858 | 23 | |||
859 | 24 | # Check that the forward has been set | ||
860 | 25 | self.assertThat( | ||
861 | 26 | call_fwd_page.current_forwarding, | ||
862 | 27 | Eventually(Equals('41444424'))) | ||
863 | 28 | |||
864 | 29 | # Check that dbus properties have been updated | ||
865 | 30 | self.assertThat( | ||
866 | 31 | lambda: str(self.modem_0.Get(CALL_FWD_IFACE, | ||
867 | 32 | 'VoiceUnconditional')), | ||
868 | 33 | Eventually(Contains('41444424'))) | ||
869 | 34 | |||
870 | 35 | def test_call_waiting(self): | ||
871 | 36 | call_wait = self.phone_page.go_to_call_waiting() | ||
872 | 37 | # we have to help our test here, this normally takes quite a while | ||
873 | 38 | self.modem_0.EmitSignal( | ||
874 | 39 | CALL_SETTINGS_IFACE, 'PropertyChanged', 'sv', | ||
875 | 40 | ['VoiceCallWaiting', 'disabled']) | ||
876 | 41 | call_wait.enable_call_waiting() | ||
877 | 42 | |||
878 | 43 | # Check that dbus properties have been updated | ||
879 | 44 | self.assertThat( | ||
880 | 45 | lambda: str(self.modem_0.Get(CALL_SETTINGS_IFACE, | ||
881 | 46 | 'VoiceCallWaiting')), | ||
882 | 47 | Eventually(Contains('enabled'))) | ||
883 | 48 | |||
884 | 49 | |||
885 | 50 | class PhoneDualSimTestCase(PhoneOfonoBaseTestCase): | ||
886 | 51 | """Tests for Phone Page""" | ||
887 | 52 | |||
888 | 53 | use_sims = 2 | ||
889 | 54 | |||
890 | 55 | def test_call_fwd_sim_1(self): | ||
891 | 56 | call_fwd_page = self.phone_page.go_to_call_forwarding(sim=1) | ||
892 | 57 | call_fwd_page.set_forward("41444424") | ||
893 | 58 | |||
894 | 59 | # Check that the forward has been set | ||
895 | 60 | self.assertThat( | ||
896 | 61 | call_fwd_page.current_forwarding, | ||
897 | 62 | Eventually(Equals('41444424'))) | ||
898 | 63 | |||
899 | 64 | # Check that dbus properties have been updated | ||
900 | 65 | self.assertThat( | ||
901 | 66 | lambda: str(self.modem_0.Get(CALL_FWD_IFACE, | ||
902 | 67 | 'VoiceUnconditional')), | ||
903 | 68 | Eventually(Contains('41444424'))) | ||
904 | 69 | |||
905 | 70 | def test_call_fwd_sim_2(self): | ||
906 | 71 | call_fwd_page = self.phone_page.go_to_call_forwarding(sim=2) | ||
907 | 72 | call_fwd_page.set_forward("41444424") | ||
908 | 73 | |||
909 | 74 | # Check that the forward has been set | ||
910 | 75 | self.assertThat( | ||
911 | 76 | call_fwd_page.current_forwarding, | ||
912 | 77 | Eventually(Equals('41444424'))) | ||
913 | 78 | |||
914 | 79 | # Check that dbus properties have been updated | ||
915 | 80 | self.assertThat( | ||
916 | 81 | lambda: str(self.modem_1.Get(CALL_FWD_IFACE, | ||
917 | 82 | 'VoiceUnconditional')), | ||
918 | 83 | Eventually(Contains('41444424'))) | ||
919 | 84 | |||
920 | 85 | def test_call_waiting_sim_1(self): | ||
921 | 86 | call_wait = self.phone_page.go_to_call_waiting(sim=1) | ||
922 | 87 | # we have to help our test here, this normally takes quite a while | ||
923 | 88 | self.modem_0.EmitSignal( | ||
924 | 89 | CALL_SETTINGS_IFACE, 'PropertyChanged', 'sv', | ||
925 | 90 | ['VoiceCallWaiting', 'disabled']) | ||
926 | 91 | call_wait.enable_call_waiting() | ||
927 | 92 | |||
928 | 93 | # Check that dbus properties have been updated | ||
929 | 94 | self.assertThat( | ||
930 | 95 | lambda: str(self.modem_0.Get(CALL_SETTINGS_IFACE, | ||
931 | 96 | 'VoiceCallWaiting')), | ||
932 | 97 | Eventually(Contains('enabled'))) | ||
933 | 98 | |||
934 | 99 | def test_call_waiting_sim_2(self): | ||
935 | 100 | call_wait = self.phone_page.go_to_call_waiting(sim=2) | ||
936 | 101 | # we have to help our test here, this normally takes quite a while | ||
937 | 102 | self.modem_1.EmitSignal( | ||
938 | 103 | CALL_SETTINGS_IFACE, 'PropertyChanged', 'sv', | ||
939 | 104 | ['VoiceCallWaiting', 'disabled']) | ||
940 | 105 | call_wait.enable_call_waiting() | ||
941 | 106 | |||
942 | 107 | # Check that dbus properties have been updated | ||
943 | 108 | self.assertThat( | ||
944 | 109 | lambda: str(self.modem_1.Get(CALL_SETTINGS_IFACE, | ||
945 | 110 | 'VoiceCallWaiting')), | ||
946 | 111 | Eventually(Contains('enabled'))) |
FAILED: Continuous integration, rev:866 /code.launchpad .net/~jonas- drange/ ubuntu- system- settings/ call-fwd- wait-dual- sim/+merge/ 229774/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http:// jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- ci/1160/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/3104 jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 2438 jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- utopic- amd64-ci/ 352 jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- utopic- armhf-ci/ 352 jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- utopic- armhf-ci/ 352/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- utopic- i386-ci/ 352 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/3141 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/4348 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/4348/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 11089 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-utopic/ 2019 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/2708 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/2708/ artifact/ work/output/ *zip*/output. zip
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: s-jenkins. ubuntu- ci:8080/ job/ubuntu- system- settings- ci/1160/ rebuild
http://