Merge lp:~mterry/ubuntu-system-settings/check-both-sims into lp:ubuntu-system-settings

Proposed by Michael Terry
Status: Merged
Approved by: Ken VanDine
Approved revision: 875
Merged at revision: 910
Proposed branch: lp:~mterry/ubuntu-system-settings/check-both-sims
Merge into: lp:ubuntu-system-settings
Diff against target: 32 lines (+11/-4)
1 file modified
wizard/qml/Pages/10-welcome.qml (+11/-4)
To merge this branch: bzr merge lp:~mterry/ubuntu-system-settings/check-both-sims
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ken VanDine Approve
Review via email: mp+229991@code.launchpad.net

Commit message

Make the wizard properly handle devices with zero, one, or two SIM modem slots. Previously it assumed exactly one slot.

Description of the change

Make the wizard properly handle devices with zero, one, or two SIM modem slots. Previously it assumed exactly one slot.

The method I chose here is hard-coded to max of two slots, because dual SIM isn't uncommong. I'd like a better way, but that API apparently doesn't exist yet [1]. So this is fine for now.

[1] I *could* run a for loop, creating dynamic OfonoSimManager objects, checking their 'present' properties, then destroying the objects. But that seems not very QML-like.

== Checklist ==

 * Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
 - Yes

 * Did you build your software in a clean sbuild/pbuilder chroot or ppa?
 - NA, just QML changes

 * Did you build your software in a clean sbuild/pbuilder armhf chroot or ppa?
 - NA, just QML changes

 * Has your component "TestPlan” been executed successfully on emulator, N4?
 - Yeah

 * Has a 5 minute exploratory testing run been executed on N4?
 - Yes

 * If you changed the packaging (debian), did you subscribe a core-dev to this MP?
 - NA

 * If you changed the UI, did you subscribe the design-reviewers to this MP?
 - NA

 * What components might get impacted by your changes?
 - None

 * Have you requested review by the teams of these owning components?
 - NA

To post a comment you must log in.
Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

You could use states and Loader elements to dynamically create Ofono objects for one or two sims, as demonstrated in this non-functional example[1].

Either way, the current code LGTM.

[1] http://pastebin.ubuntu.com/7983861

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
875. By Michael Terry

Merge from trunk

Revision history for this message
Michael Terry (mterry) wrote :

Your code example is fine, but it's not the static OfonoSimManager stanzas that bother me, but rather the fact that we hard-code two of them instead of however many modems there are (like, what about some insane phone with five SIM slots?). And in your example at least, two is still hard-coded.

Anyway, I think hard-coding is good enough to deal with the immediate problem, and 99% of phones anyway. If it looks good to you, please-rereview/approve. Thanks!

Revision history for this message
Ken VanDine (ken-vandine) wrote :

Looks good

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

PASSED: Continuous integration, rev:875
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1230/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3552
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2791
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/423
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/419
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/419/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/422
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3447
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4799
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4799/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11487
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2261
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/3070
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/3070/artifact/work/output/*zip*/output.zip

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

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'wizard/qml/Pages/10-welcome.qml'
2--- wizard/qml/Pages/10-welcome.qml 2014-07-14 19:00:38 +0000
3+++ wizard/qml/Pages/10-welcome.qml 2014-08-14 13:18:50 +0000
4@@ -33,9 +33,16 @@
5 id: manager
6 }
7
8- OfonoSimManager {
9- id: simManager
10- modemPath: manager.modems[0]
11+ // Ideally we would query the system more cleverly than hardcoding two
12+ // modems. But we don't yet have a more clever way. :(
13+ OfonoSimManager {
14+ id: simManager0
15+ modemPath: manager.modems.length >= 1 ? manager.modems[0] : ""
16+ }
17+
18+ OfonoSimManager {
19+ id: simManager1
20+ modemPath: manager.modems.length >= 2 ? manager.modems[1] : ""
21 }
22
23 Item {
24@@ -82,7 +89,7 @@
25 text: i18n.tr("Start")
26 onClicked: {
27 plugin.currentLanguage = languageList.selectedIndex
28- if (simManager.present)
29+ if (manager.modems.length == 0 || simManager0.present || simManager1.present)
30 pageStack.next()
31 else
32 pageStack.push(Qt.resolvedUrl("no-sim.qml"))

Subscribers

People subscribed via source and target branches