Merge lp:~unity-api-team/ubuntu-system-settings/apneditor into lp:ubuntu-system-settings

Proposed by Jussi Pakkanen
Status: Superseded
Proposed branch: lp:~unity-api-team/ubuntu-system-settings/apneditor
Merge into: lp:ubuntu-system-settings
Diff against target: 1664 lines (+1283/-100)
17 files modified
plugins/cellular/CMakeLists.txt (+4/-0)
plugins/cellular/Components/CMakeLists.txt (+6/-0)
plugins/cellular/Components/MultiSim.qml (+5/-4)
plugins/cellular/Components/SingleSim.qml (+4/-3)
plugins/cellular/CustomApnEditor.qml (+322/-0)
plugins/cellular/PageChooseApn.qml (+580/-0)
plugins/cellular/PageChooseCarrier.qml (+165/-80)
plugins/cellular/PageChooseCarriers.qml (+2/-3)
plugins/cellular/PageComponent.qml (+1/-1)
plugins/cellular/ofonoactivator.cpp (+119/-0)
plugins/cellular/ofonoactivator.h (+42/-0)
plugins/cellular/plugin.cpp (+2/-0)
plugins/cellular/sims.js (+4/-0)
plugins/phone/PageComponent.qml (+3/-2)
plugins/phone/sims.js (+4/-0)
tests/autopilot/ubuntu_system_settings/tests/__init__.py (+7/-7)
tests/autopilot/ubuntu_system_settings/tests/test_cellular.py (+13/-0)
To merge this branch: bzr merge lp:~unity-api-team/ubuntu-system-settings/apneditor
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Jonas G. Drange (community) Needs Fixing
Ken VanDine Needs Fixing
Iain Lane Needs Fixing
Review via email: mp+227534@code.launchpad.net

This proposal has been superseded by a proposal from 2014-10-03.

Commit message

Add an APN editor.
Fix object creation of OfonoNetworkOperators in ChooseCarrier.qml

Description of the change

Adding a custom MMS APN will not actually work because of:
https://bugs.launchpad.net/ubuntu/+source/ofono/+bug/1362068

As of our platform is not currently able to handle max. 1 MMS APN[0], here is the "logic" of the editor:

- it will always create a custom internet APN if none exists for the system
- ofono provisioning might add Internet APN's that are also used for MMS
  - these are identified by having a MessageCenter property set, although
    strictly speaking this is violating ofono API
- When user switches between Internet APNs, NetworkManager is told
  to activate the selected APN through ofonoActivator::activate()
- as the system is only able to handle one MMS APN, custom MMS APN is only
  created if user explicitly configures one
  - if there is a provisioned MMS APN it will get removed and one custom one
    created
  - as the QOfono API does not offer a way to directly access an APN created
    with ConnectionManager::addContext(), we have to detect a newly created
    MMS APN by magic (isEmptyCustom()) and lazily populate it when detected
    (pendingMmsData)
- Any configured MMS APN (both custom and provisioned) will be removed if
  user activates a dual Internet APN with MMS capability

[0] https://bugs.launchpad.net/bugs/1362795

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

FAILED: Continuous integration, rev:798
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1028/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2226
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1853
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/220
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/220
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/220/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/220
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2437
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3408
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3408/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10130
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1557
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2072
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2072/artifact/work/output/*zip*/output.zip

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

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

FAILED: Continuous integration, rev:799
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1029/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2248
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1865
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/221
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/221
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/221/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/221
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2453
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3432
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3432/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10148
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1567
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2084
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2084/artifact/work/output/*zip*/output.zip

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

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

FAILED: Continuous integration, rev:800
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1035/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2327
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1914
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/227
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/227
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/227/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/227
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2509
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3538
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3538/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10230
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1605
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2144
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2144/artifact/work/output/*zip*/output.zip

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

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

FAILED: Continuous integration, rev:801
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1040/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2369
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1940
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/232
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/232
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/232/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/232
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2546
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3589
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3589/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10280
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1625
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2185
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2185/artifact/work/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Iain Lane (laney) wrote :

Not reviewed, but please make sure to wrap all lines at 80 characters and fix the copyright years.

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

We don't have an 80 character line limit any more. It's 132 now. See for example:

https://bazaar.launchpad.net/~unity-team/unity-api/trunk/view/head:/astyle-config

Revision history for this message
Iain Lane (laney) wrote :

On Wed, Jul 23, 2014 at 02:08:11PM -0000, Jussi Pakkanen wrote:
> We don't have an 80 character line limit any more. It's 132 now. See for example:

Who decided this for ubuntu-system-settings.

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

Revision history for this message
Sebastien Bacher (seb128) wrote :

@Jussi, the document you pointed is not from the settings project, we use a 80 chars wrap count here

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

FAILED: Continuous integration, rev:802
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1042/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2378
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1945
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/234
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/234
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/234/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/234
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2550
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3599
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3599/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10284
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1628
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2190
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2190/artifact/work/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Iain Lane (laney) wrote :

On Wed, Jul 23, 2014 at 03:15:53PM -0000, Sebastien Bacher wrote:
> @Jussi, the document you pointed is not from the settings project, we use a 80 chars wrap count here

However we are discussing it - GNOME recommends between 80 and 120 & we
might align on this.

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

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

FAILED: Continuous integration, rev:803
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1043/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2385
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1948
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/235
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/235
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/235/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/235
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2555
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3607
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3607/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10289
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1631
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2193
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2193/artifact/work/output/*zip*/output.zip

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

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

FAILED: Continuous integration, rev:805
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1048/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2418
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1970
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/240
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/240
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/240/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/240
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2587
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3649
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3649/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10331
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1649
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2220
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2220/artifact/work/output/*zip*/output.zip

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

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

FAILED: Continuous integration, rev:807
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1064/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2503
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2021
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/256
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/256
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/256/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/256
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2655
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3746
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3746/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10428
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1690
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2274
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2274/artifact/work/output/*zip*/output.zip

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

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

FAILED: Continuous integration, rev:809
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1222/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3462
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2722
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/415
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/411
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/411/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/414
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3366
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4709
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4709/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11380
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2199
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2999
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2999/artifact/work/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Iain Lane (laney) wrote :

Please could you make sure the AP tests are passing. Also remove all stray warnings.

If this isn't ready - some comments suggest it isn't - set the branch to WIP please.

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

FAILED: Continuous integration, rev:810
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1223/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3473
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2730
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/416
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/412
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/412/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/415
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3374
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4720
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4720/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11394
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2206
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/3007
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/3007/artifact/work/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

See inline comments. There's some Loader magic going on. Happy to explain, but for now, remove the data preference code in PageComponent as well as the code that re-creates a lot of ofono objects.

review: Needs Fixing
Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

Fixed one, need some help with the other. Thanks.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
950. By Mathieu Trudel-Lapierre

Fix PIN code or passcode requests by properly matching the tag for the original request. Fixes: 1355152
Approved by: Sebastien Bacher, PS Jenkins bot

951. By PS Jenkins bot

Releasing 0.3+14.10.20140827.1-0ubuntu1

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

There are a number of asserts in the code with comments that they should be removed, like:
// just asserting to verify the logic
// remove once proven functional

Those should probably removed.

There are a number of places with commented out code (like properties), other than the TODOs and place holders for future work. Please remove them if they aren't needed.

review: Needs Fixing
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :
Download full text (3.9 KiB)

I see the following output using those debs

2014-08-27 16:23:38,267 - WARNING - file:///usr/share/ubuntu/settings/system/qml-plugins/cellular/PageChooseCarrier.qml:67:17: Unable to assign [undefined] to QObject*
2014-08-27 16:23:38,308 - WARNING - QOfonoNetworkOperator::registerOperator() failed: QDBusError("org.ofono.Error.AccessDenied", "Operation not permitted")
2014-08-27 16:23:38,308 - WARNING - registerComplete failed with error: org.ofono.Error.AccessDenied Operation not permitted Falling back to default
2014-08-27 16:24:12,488 - WARNING - file:///usr/share/ubuntu/settings/system/qml-plugins/cellular/PageChooseApn.qml:268:5: QML Connections: Cannot assign to non-existent propert
y "onContextsChanged"
2014-08-27 16:24:12,493 - WARNING - file:///usr/share/ubuntu/settings/system/qml-plugins/cellular/PageChooseApn.qml:55: TypeError: Cannot read property 'contexts' of undefined
2014-08-27 16:24:12,494 - WARNING - file:///usr/share/ubuntu/settings/system/qml-plugins/cellular/PageChooseApn.qml:269:17: Unable to assign [undefined] to QObject*
pa

and this is syslog:

Aug 20 09:04:19 ubuntu-phablet URfkill[22242]: Modem found: '/ril_0'
Aug 20 09:04:19 ubuntu-phablet URfkill[22242]: killswitch state: KILLSWITCH_STATE_NO_ADAPTER new_state: KILLSWITCH_STATE_UNBLOCKED
Aug 20 09:04:19 ubuntu-phablet URfkill[22242]: Setting device 100 (WWAN) to unblocked
Aug 20 09:04:19 ubuntu-phablet URfkill[22242]: device_changed_cb: Fake Manufacturer Fake Modem Model
Aug 20 09:04:19 ubuntu-phablet URfkill[22242]: killswitch state: KILLSWITCH_STATE_UNBLOCKED new_state: KILLSWITCH_STATE_SOFT_BLOCKED
Aug 20 09:04:19 ubuntu-phablet URfkill[22242]: <warning> Could not set Online property in oFono: GDBus.Error:org.ofono.Error.Failed: Operation failed
Aug 20 09:04:19 ubuntu-phablet NetworkManager[1633]: <warn> OFONO modem set enabled failed: (19) Method "SetProperty" with signature "sv" on interface "org.ofono.ConnectionManag
er" doesn't exist
Aug 20 09:04:19 ubuntu-phablet /03mmsproxy: Adding route for MMS connection /310410528924256/context2 on /ril_0 (rmnet_usb0)
Aug 20 09:04:19 ubuntu-phablet /03mmsproxy: failed to add route: org.freedesktop.DBus.Error.UnknownObject: Method "GetProperties" with signature "" on interface "org.ofono.Conne
ctionContext" doesn't exist
Aug 20 09:04:19 ubuntu-phablet kernel: [34624.654748] mmc0: mmc_start_bkops: Starting bkops
Aug 20 09:04:20 ubuntu-phablet kernel: [34626.169291] mdm_power_down_common: MDM2AP_STATUS never went low. Doing a hard reset
Aug 20 09:04:21 ubuntu-phablet NetworkManager[1633]: <info> Auto-activating connection '/310410528924256/context2'.
Aug 20 09:04:21 ubuntu-phablet NetworkManager[1633]: <info> Activation (/ril_0) starting connection '/310410528924256/context2'
Aug 20 09:04:21 ubuntu-phablet NetworkManager[1633]: <info> (/ril_0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
Aug 20 09:04:21 ubuntu-phablet NetworkManager[1633]: <info> Activation (/ril_0) Stage 1 of 5 (Device Prepare) scheduled...
Aug 20 09:04:21 ubuntu-phablet NetworkManager[1633]: <info> Activation (/ril_0) Stage 1 of 5 (Device Prepare) started...
Aug 20 09:04:21 ubuntu-phablet NetworkManager[1633]: <info> Activation (...

Read more...

952. By Jonas G. Drange

[main panel] add visual feedback on press
Approved by: Ken VanDine, PS Jenkins bot

953. By Sebastien Bacher

[language] workaround inconsistent languages casing Fixes: 1362123
Approved by: PS Jenkins bot

954. By Ken VanDine

SIM PIN lock implementation
Approved by: Jonas G. Drange

955. By Jonas G. Drange

[cellular] uses modemtechnologies property from ofono to populate technology preference options Fixes: 1346790
Approved by: Ken VanDine, PS Jenkins bot

956. By Sebastien Bacher

[background] Display the default background selected Fixes: 1349329
Approved by: Jonas G. Drange, PS Jenkins bot

957. By Sebastien Bacher

[storage] display translated names Fixes: 1360207
Approved by: Ken VanDine, PS Jenkins bot

958. By Sebastien Bacher

[updates] don't display animations when clicking on update rows Fixes: 1360364
Approved by: Ken VanDine, Alejandro J. Cura, PS Jenkins bot

959. By Sebastien Bacher

[background] don't use an icon in the headerbar Fixes: 1362122
Approved by: Jonas G. Drange

960. By PS Jenkins bot

Releasing 0.3+14.10.20140827.3-0ubuntu1

961. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

962. By Roberto Alsina

Don't crash the push helper in locales that have no .mo file Fixes: 1357506
Approved by: Sebastien Bacher, PS Jenkins bot

963. By Michael Terry

Update look and feel of wizard to more closely match the visual design.
Approved by: Sebastien Bacher, PS Jenkins bot

964. By Jussi Pakkanen

Minor cleanups.
Approved by: Ken VanDine, Sebastien Bacher, PS Jenkins bot

965. By PS Jenkins bot

Releasing 0.3+14.10.20140828.2-0ubuntu1

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

Implement the "When locked, allow:" portion of the Security & Privacy panel, so now the user can control whether the launcher and/or indicators are available while locked. (LP: #1358340) Fixes: 1358340
Approved by: Sebastien Bacher

967. By PS Jenkins bot

Releasing 0.3+14.10.20140828.3-0ubuntu1

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

OK, after extensive testing this should be good to go.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
968. By Sebastien Bacher

[security] tweak some pin locking details to match the design better
Approved by: Ken VanDine, PS Jenkins bot

969. By Michael Terry

When changing to swipe mode, it was possible that our policykit agent would not unregister itself, making the next attempt to change modes appear to work, but in truth fail. Also, no longer ask for a password to switch to swipe mode if policykit has a cached authentication for us.
 Fixes: 1350381, 1361137
Approved by: Ken VanDine, PS Jenkins bot

970. By PS Jenkins bot

Releasing 0.3+14.10.20140829.1-0ubuntu1

971. By PS Jenkins bot

Resync trunk

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

I get a large number (>50) of these when I enter the APN panel
2014-08-29 08:58:11,004 - WARNING - file:///usr/share/ubuntu/settings/system/qml-plugins/cellular/PageChooseCarrier.qml:28:1: QML PageChooseCarrier: Binding loop detected for property "height"

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

actually the above happens when you scroll the page

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

note to test these debs you need latest from
https://launchpad.net/ubuntu/utopic/armhf/accountsservice-ubuntu-schemas/0.0.3+14.10.20140827-0ubuntu1

Other than the binding loop seems good

Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

WFM (krillin, telenor)

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

CI is failing because you changed the carrierSelector from an ItemSelector to an OptionSelector but didn't change the tests to match.

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

Inline comment, typo in a visible string.

review: Needs Fixing
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

> I get a large number (>50) of these when I enter the APN panel
> 2014-08-29 08:58:11,004 - WARNING - file:///usr/share/ubuntu/settings/system
> /qml-plugins/cellular/PageChooseCarrier.qml:28:1: QML PageChooseCarrier:
> Binding loop detected for property "height"

This is a height property of the top level ItemPage which is not even being modified in PageChooseCarrier.qml at all. I would suspect it something to do with UITK or the OSK work that has gone in to the low levels.

If this does not affect the UX in any visible way, I would say it's totally minor and no reason to block the landing.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

You're anchoring the buttonRectangle to parent.bottom, which causes it to get pushed up above the input fields when the OSK is displayed. You should put it inside the flickable, so they stay below the inputs.

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

Testing on krillin, I can't get a working context for my t-mobile US SIM. Looking at the output of list-contexts, it isn't setting the value I entered for MessageCenter.

Looking at the upstart logs, I see this output when trying to set the context:
2014-08-29 15:39:19,973 - CRITICAL - Context error on /ril_0/context3: Invalid arguments in method call

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

After re-reading the MP description, I see that the failure I get above is consistent with bug 1362068. So apparently this can't work until we get that bug fixed?

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

The implementation is considerably different from the [1]design, has someone from design looked at this?

[1] https://wiki.ubuntu.com/Networking

972. By Ken VanDine

Added setting for dialpad sounds to both the sound and phone panels.
Approved by: Jonas G. Drange, PS Jenkins bot

973. By Diego Sarmentero

- Fix out of sync image download
- Refresh scope after installation Fixes: 1324923, 1360369
Approved by: Jonas G. Drange, PS Jenkins bot

974. By Sebastien Bacher

[battery] refresh the graph on a minute basis
Approved by: Ken VanDine, PS Jenkins bot

975. By Sebastien Bacher

[notifications] use normal text style and ubuntushaped icons
Approved by: Ken VanDine, PS Jenkins bot

976. By PS Jenkins bot

Releasing 0.3+14.10.20140829.2-0ubuntu1

977. By PS Jenkins bot

Resync trunk

978. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

979. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

980. By Martin Pitt

POT update

981. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

982. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

983. By Loïc Minier

Manually merge lp:~mterry/ubuntu-system-settings/here-fixes and resync with
citrain PPA upload.

[ Michael Terry ]
* Make the HERE license optional, clearly mark it as a HERE license
  instead of an Ubuntu license, and connect it to the HERE backend.
[ CI bot ]
* Resync trunk
[ Martin Pitt ]
* POT update

984. By Sebastien Bacher

[security] don't mark "%1" string as translatable
Approved by: Ken VanDine, PS Jenkins bot

985. By Andrea Cimitan

Various fixes for wifi wizard page Fixes: 1362296, 1362553
Approved by: Michael Terry

986. By Jonas G. Drange

[about] print out phone numbers for dual sims as well
Approved by: PS Jenkins bot

987. By Michael Terry

Avoid another race condition when switching password types by completing all DBus operations synchronously as we exit the policykit agent. LP: 1361137
 Fixes: 1361137
Approved by: Ken VanDine, PS Jenkins bot

988. By Michael Terry

Fix the OSK not working on first boot.
When the wizard closes, shut down maliit-server and the indicators so that unity8 can start them itself. LP: 1362679

This was my fault, when I added logic to restart maliit-server and indicators after the language screen, I just moved those lines from the end of the wizard to the language screen. But we also need to restart after the wizard to capture the changed MIR_SOCKET value. Fixes: 1362679
Approved by: Ken VanDine, PS Jenkins bot

989. By Sebastien Bacher

[security] give a translation context to the 'None' string Fixes: 1362143
Approved by: Ken VanDine, PS Jenkins bot

990. By Sebastien Bacher

[licenses] display an error when the copyright can't be read Fixes: 1206150
Approved by: Ken VanDine, PS Jenkins bot

991. By Jonas G. Drange

[about/wifi] adding mac addresses for bt and wifi, and ip for wifi Fixes: 1356239
Approved by: Ken VanDine, Sebastien Bacher, PS Jenkins bot

992. By Jonas G. Drange

[language] explain to the user that a reboot is necessary for the change to take effect Fixes: 1240875
Approved by: PS Jenkins bot

993. By PS Jenkins bot

Releasing 0.3+14.10.20140904-0ubuntu1

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

Here's the design review.

------

Thanks for helping me get the APN settings going on my handset. For
your convenience, I've attached a couple of screenshots of what I see.
Comparing the current implementation with
<https://wiki.ubuntu.com/Networking#apn-mobile>:

* "On the carrier screen, the “APN” item should be insensitive
    whenever the SIM is not associated with a carrier."

    When I'm in Flight Mode, (a) the carrier menu is empty, but (b) the
    "APN" item is still choosable. At least one of those is wrong
    (possibly both).

* On the APN screen, the radio lists are in Ubuntu shapes. If these
    are quick to remove, please remove them. Compare with the
    "Automatically"/"Manually" list on the Cellular screen, which
    looks much nicer.

* "The “Internet APN:” and “MMS APN:” radio lists should each consist
    of: * a “None” item, if no APN is currently activated for that
    connection type;..."

    On my handset, there are two items in the "Internet APN:" list, but
    neither of them are selected. If it's really true that no Internet
    APN is set on my phone, there should be a selected "None" item.

* Consequently, in the "MMS APN:" list, if I tap "Same APN as for
    Internet", I get a dialog: "Error: No Internet APN has been
    selected." Abolish this dialog, and instead just make that "Same
    APN" item insensitive whenever no Internet APN is selected.

* "Choosing “Custom Internet APN…” or “Custom MMS APN…” should open
    the relevant dialog..."

    These screens are currently stack pages instead of dialogs. This
    means that I can enter some settings, complete or not, then tap
    the Back button, and it isn't clear whether those settings will be
    saved or not, which is pretty confusing. Even worse, in the "Custom
    MMS APN" screen, the "Password" field is hidden partly under the
    "Cancel" and "Save" buttons, and partly under the OSK. And the
    field labels are weirdly close to the left edge of the screen.

* "“Internet APN”, “MMS APN”, “MMSC”, and “Proxy” should be URL
    fields (using the URL OSK and ignoring non-URL characters)..."

    Currently, "Internet APN", "MMS APN", "MMSC", and "Proxy" are all
    normal text fields, allowing impossible characters, and assuming
    that I want to capitalize and spell-check their contents when I do
    not.

* "...auto-inserting http:// on unfocus if no protocol was entered."

    This doesn't happen.

* When I tap "Activate", even after entering a non-existent APN name,
    the settings are apparently accepted without being tried.

Though I'm a perfectionist, I have a low bar for whether a feature is
better than nothing. But that last point is what makes me say no, this
isn't ready to land. If custom APNs aren't implemented at all yet, the
buttons and screens to specify them shouldn't be present, because
that's actively misleading. And if they are implemented, why is a
non-existent APN accepted?

994. By Mathieu Trudel-Lapierre

Downgrade qFatal failure to register bluetooth agent to a qCritical.
Approved by: Ken VanDine

995. By Guillermo Gonzalez

Basic unittest for the push-helper script
Approved by: Ken VanDine, PS Jenkins bot

996. By PS Jenkins bot

Releasing 0.3+14.10.20140904.1-0ubuntu1

997. By PS Jenkins bot

Resync trunk

998. By Ken VanDine

Tweak the depends for accountsservice-ubuntu-schemas to handle a "~" version

Approved by: Loïc Minier

999. By PS Jenkins bot

Releasing 0.3+14.10.20140904.2-0ubuntu1

1000. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1001. By David Barth

Enable location panel, display contols for authorized applications.
Approved by: Alexandre Abreu, PS Jenkins bot, Alberto Mardegan

1002. By PS Jenkins bot

Releasing 0.3+14.10.20140905.1-0ubuntu1

1003. By PS Jenkins bot

Resync trunk

Revision history for this message
Matthew Paul Thomas (mpt) wrote :

Antti has explained to me the current asynchronous and uncommunicative API that makes validating a custom APN impossible to implement for MMS, and impractically difficult for Internet, at least without a new API. So I withdraw the last point, and instead suggest that "Activate" should be merely "OK" (since it won't be doing any activation right then).

1004. By Michael Terry

Don't crash when destructing the Wizard.Utils.System plugin.
This fixes the crash on wizard exit and the crash when pressing back on the HERE license.

I hadn't realized that Qml destroys each plugin class on exit (probably should have been obvious). And since ours was statically allocated, things blew up. Solution is to let Qml handle the singleton status itself. Just give it an object pointer and let it be destroyed by Qml.
Approved by: Sebastien Bacher, PS Jenkins bot, Alberto Mardegan

1005. By Sebastien Bacher

[developer-mode] working scrolling and correct spacing
Approved by: Ken VanDine, PS Jenkins bot

1006. By Sebastien Bacher

Use standard items for the categories and don't display dividers Fixes: 1365563
Approved by: Ken VanDine

1007. By Jonas G. Drange

[about/versions] create reusable component of singlevalue items that have long values Fixes: 1363927
Approved by: Sebastien Bacher, PS Jenkins bot

1008. By Sebastien Bacher

[orientation-lock] don't display a frame around the icon Fixes: 1365450
Approved by: Ken VanDine, PS Jenkins bot

1009. By PS Jenkins bot

Releasing 0.3+14.10.20140908-0ubuntu1

1010. By Ricardo Salveti

sound: setting default audio role for ringtone and messages
Approved by: Jim Hodapp, Sebastien Bacher

1011. By PS Jenkins bot

Releasing 0.3+14.10.20140908.1-0ubuntu1

1012. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1013. By Mathieu Trudel-Lapierre

Also allow Speakers and Carkits as valid audio devices to pair.
Approved by: Sebastien Bacher

1014. By Ken VanDine

- Notify the user if the phone needs to be plug to power for update

Approved by: PS Jenkins bot

1015. By Sebastien Bacher

[system-update] don't draw a frame around ubuntu updates Fixes: 1367136
Approved by: Ken VanDine

1016. By Michael Terry

Allow switch from PIN code to passphrase and back using the same password. (LP: #1357043)

The reason this bug exists in the first place is that passwd doesn't let you switch to the same password. So while we could change the AccountsService password display hint just fine, we'd see an error from passwd and bail out. So IF the user gave us the correct password, we can ignore any errors from passwd if the new password is the same.

I also added some more verbose output in some error cases while I was there. It'll be helpful when debugging in the future (and I didn't want to separate it out into its own branch because conflicts). Fixes: 1357043
Approved by: Sebastien Bacher

1017. By Michael Terry

Fix false-negatives from AccountsService when switching from swipe to password (LP: #1363405)

When AccountsService switches from swipe to password (or back), it does several things (delete user password if moving to swipe, then adjust some group memberships like nopasswdlogin, then adjust some internal state).

But on Touch, the group membership change will fail since /etc/group is readonly. (But it doesn't matter, since AccountsService will note from its inotify monitor on /var/lib/extrausers/shadow that it needs to update its internal state.)

However! USS will see the failure and try to rollback to swipe instead of changing away from swipe. Except even then it will mess up. It won't make the same call again to AS to delete the password again, so we'll end up with the password changed but left in place. Producing the symptoms in bug 1363405. Fixes: 1363405
Approved by: Sebastien Bacher

1018. By PS Jenkins bot

Releasing 0.3+14.10.20140909-0ubuntu1

1019. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1020. By Ken VanDine

Don't call downloadUpdate for system updates that are already downloading (LP: #1365646)
 Fixes: 1311219, 1365646
Approved by: Sebastien Bacher

1021. By PS Jenkins bot

Releasing 0.3+14.10.20140911-0ubuntu1

1022. By Jonas G. Drange

[background] always keep custom images, and remove press-and-hold action. Fixes: 1365167
Approved by: Sebastien Bacher, PS Jenkins bot

1023. By Jonas G. Drange

[wifi] do not use predictive text for network name input Fixes: 1365992
Approved by: Sebastien Bacher

1024. By Jonas G. Drange

[language] workaround for transition bug in keyboard layout menu Fixes: 1350809
Approved by: Sebastien Bacher

1025. By Jonas G. Drange

[wifi] factory was setting the icon property, which was causing the icon to not render Fixes: 1364366
Approved by: Sebastien Bacher

1026. By Alejandro J. Cura

Fixing the refreshing of the apps scope Fixes: 1360369
Approved by: Sebastien Bacher, Rodney Dawes

1027. By Sebastien Bacher

[sound] use the correct backend to control the keyboard sound toggle Fixes: 1366208, 1367288

1028. By PS Jenkins bot

Releasing 0.3+14.10.20140911.1-0ubuntu1

1029. By Martin Pitt

update POT

1030. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1031. By Sebastien Bacher

[system-update] open the ubuntuone subpanel rather than the list Fixes: 1348580
Approved by: Ken VanDine

1032. By Ken VanDine

Fixed tests for the dialpad settings failing on mako

Approved by: Sebastien Bacher

1033. By Ken VanDine

Don't call downloadUpdate when we see a system update ready, the service does that for us (LP: #1368294) Fixes: 1368294
Approved by: Sebastien Bacher

1034. By Ken VanDine

Translate desktop file (LP: #1318008)
 Fixes: 1318008
Approved by: Sebastien Bacher

1035. By Sebastien Bacher

[security-privacy] use ngettext strings when needed Fixes: 1368159
Approved by: Ken VanDine

1036. By Sebastien Bacher

Increase vertical spacing in the settings grid Fixes: 1348579
Approved by: Ken VanDine

1037. By PS Jenkins bot

Releasing 0.3+14.10.20140911.3-0ubuntu1

1038. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1039. By Jussi Pakkanen

Hide entry to connect to hidden network when wifi is off. Fixes: 1365960
Approved by: Ken VanDine

1040. By Jonas G. Drange

[wifi] "Other Network" -> "Connect to hidden network" Fixes: 1365984
Approved by: Ken VanDine

1041. By Jonas G. Drange

[wifi] fix bad looking buttons in "Other Networks" panel Fixes: 1362127
Approved by: Ken VanDine

1042. By PS Jenkins bot

Releasing 0.3+14.10.20140912-0ubuntu1

1043. By Ken VanDine

Don't try to tweak the bottomMargin for the OSK, it was trying to calculate
it based on an undefined component so failing. It shouldn't be needed anyway.

Put the buttons in the Column.
Approved by: Jonas G. Drange

1044. By PS Jenkins bot

Releasing 0.3+14.10.20140913-0ubuntu1

1045. By PS Jenkins bot

Resync trunk

1046. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1047. By John Lenton

Take the system settings push helper closer to implementing the spec at https://wiki.ubuntu.com/SoftwareUpdates#Prompting Fixes: 1363972
Approved by: Sebastien Bacher, Roberto Alsina

1048. By PS Jenkins bot

Releasing 0.3+14.10.20140915-0ubuntu1

1049. By Lars Karlitski

Use Icon instead of StatusIcon

The latter is deprecated. Fixes: 1343553
Approved by: Sebastien Bacher, PS Jenkins bot

1050. By Ken VanDine

When activated by a url request for a specific panel, clear the pageStack
to maintain the natural navigation instead of pushing a new page on top of a
page from a the previous panel (LP: #1362025) Fixes: 1359953, 1362025
Approved by: Sebastien Bacher, PS Jenkins bot

1051. By PS Jenkins bot

Releasing 0.3+14.10.20140915.1-0ubuntu1

1052. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1053. By Mathieu Trudel-Lapierre

[bluetooth] don't try to enable Discoverable if the device isn't powered yet. Fixes: 1355904
Approved by: PS Jenkins bot

1054. By Ken VanDine

Include an icon instead of using the themed icon (LP: #1365408)
 Fixes: 1365408
Approved by: Mathieu Trudel-Lapierre, PS Jenkins bot

1055. By PS Jenkins bot

Releasing 0.3+14.10.20140917-0ubuntu1

1056. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1057. By Ken VanDine

Make UpdateManager a singleton and refresh the availableUpdates count when the model updates (LP: #1325629) Fixes: 1325629
Approved by: Diego Sarmentero

1058. By PS Jenkins bot

Releasing 0.3+14.10.20140917.1-0ubuntu1

1059. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1060. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1061. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1062. By Albert Astals Cid

make pot

1063. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1064. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1065. By Oliver Grawert

fix LP: #1365903, add a watch to Developer Mode page so the page gets refreshed when going back through the page stack, also fix the page id and bounds Fixes: 1365903
Approved by: Iain Lane

1066. By PS Jenkins bot

Releasing 0.3+14.10.20140924-0ubuntu1

1067. By Michael Terry

Prevent the buttons of the wizard's password page from overlapping its content when the OSK appears. (LP: #1368346)

I added a Flickable to the page, so the page content can clip to the to top of the buttons. I also fixed the background image visibly moving up along with the OSK. Fixes: 1368346
Approved by: PS Jenkins bot

1068. By Ken VanDine

Set the version information in the SystemUpdate constructor (LP: #1371810)
 Fixes: 1371810
Approved by: Sebastien Bacher

1069. By Ken VanDine

[reset] Don't bail out on an isValid() check on the SystemImage QDBusInterface,
the docs say isValid() may not be reliable for remote interfaces (LP: #1370815) Fixes: 1370815
Approved by: Jonas G. Drange, Sebastien Bacher

1070. By Ken VanDine

Fixed reference error for count on the various device models (LP: #1362517)
 Fixes: 1362517
Approved by: Sebastien Bacher, PS Jenkins bot

1071. By Iain Lane

Don't check if the timedated interface is valid before calling SetTime on it, it might have timed out and we should reactivate it in that case.
Approved by: Sebastien Bacher

1072. By Iain Lane

Misc packaging fixes
Approved by: Sebastien Bacher, PS Jenkins bot

1073. By Iain Lane

[about] Fix developerMode property to be QMLish - read & write instead of separate "read" and "toggle" properties.
Approved by: Sebastien Bacher, PS Jenkins bot

1074. By Iain Lane

[about] Don't display a frame for icons that can't be found, improving the visual appearance. Also return the correct path for click packages which use the icon theme.
Approved by: Sebastien Bacher

1075. By Ken VanDine

[background] Use the ContentPeerPicker to select sources for
backgrounds (LP: #1356542) Fixes: 1356542
Approved by: Sebastien Bacher

1076. By Sebastien Bacher

[storage] handle the scope click .ini and get the correct icons Fixes: 1368920
Approved by: Iain Lane

1077. By PS Jenkins bot

Releasing 0.3+14.10.20140924.1-0ubuntu1

1078. By Michael Terry

Add a translator comment for what HERE means. (LP: #1368838) Fixes: 1368838
Approved by: Iain Lane, PS Jenkins bot

1079. By Michael Terry

Prevent a crash in unity8 when the wizard also crashes or stops early. (LP: #1355892)

Move some of the socket cleanup from the 'cleanup' wizard job to the main job, while also avoiding the race that would create by stopping and starting unity8's job more carefully. Fixes: 1355892
Approved by: Ken VanDine, Sebastien Bacher

1080. By PS Jenkins bot

Releasing 0.3+14.10.20140925-0ubuntu1

1081. By PS Jenkins bot

Resync trunk

1082. By Albert Astals Cid

Add i18n.tr
Approved by: Sebastien Bacher, PS Jenkins bot

1083. By Jonas G. Drange

[wifi] connect to hidden network is now a dialog Fixes: 1366005, 1366006
Approved by: Ken VanDine, PS Jenkins bot

1084. By Ken VanDine

Provide more keywords to make search useful (LP: #1370219)
 Fixes: 1370219
Approved by: Sebastien Bacher, PS Jenkins bot

1085. By Mathieu Trudel-Lapierre

[bluetooth] Properly handle device types for connection and disconnection. Fixes: 1369964
Approved by: Sebastien Bacher, PS Jenkins bot

1086. By Sebastien Bacher

[storage] use libclick rather than calling the command line Fixes: 1368967
Approved by: PS Jenkins bot, Alberto Mardegan

1087. By Ken VanDine

[background] set sourceSize in the image preview to work around an issue
loading large images Fixes: 1373462
Approved by: Sebastien Bacher

1088. By Sebastien Bacher

[storage] tweaks to the disk informations, limit the free space to the
user available one (excluding the system partitions), don't list the
external mounts, that's described in the design and is going to require
work on the categories computation to give correct values Fixes: 1284247
Approved by: Ken VanDine, PS Jenkins bot

1089. By Sebastien Bacher

[about] display the free space value next to the storage label Fixes: 1335144
Approved by: Ken VanDine

1090. By PS Jenkins bot

Releasing 0.3+14.10.20140926-0ubuntu1

1091. By PS Jenkins bot

Resync trunk

1092. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1093. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1094. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1095. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1096. By Ken VanDine

* Fixed handling of the Downloading/Installing label based on actual state.
* Forward updateProgress signals for system updates
* Layout fixes Fixes: 1312587, 1316933, 1318593, 1371157
Approved by: Diego Sarmentero, PS Jenkins bot

1097. By Ken VanDine

Use new splash screen
 Fixes: 1376242
Approved by: Pat McGowan, Sebastien Bacher, PS Jenkins bot

1098. By Ken VanDine

Improved tracking download states
Approved by: Jonas G. Drange, Sebastien Bacher

1099. By Ken VanDine

Use new target_build_number from system-image-dbus to determine visibility of the update notification
 Fixes: 1355803
Approved by: Sebastien Bacher

1100. By PS Jenkins bot

Releasing 0.3+14.10.20141001-0ubuntu1

1101. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

> Here's the design review.
>
> ------
>
> Thanks for helping me get the APN settings going on my handset. For
> your convenience, I've attached a couple of screenshots of what I see.
> Comparing the current implementation with
> <https://wiki.ubuntu.com/Networking#apn-mobile>:
>
> * "On the carrier screen, the “APN” item should be insensitive
> whenever the SIM is not associated with a carrier."
>
> When I'm in Flight Mode, (a) the carrier menu is empty, but (b) the
> "APN" item is still choosable. At least one of those is wrong
> (possibly both).

Fixed both.

> * On the APN screen, the radio lists are in Ubuntu shapes. If these
> are quick to remove, please remove them. Compare with the
> "Automatically"/"Manually" list on the Cellular screen, which
> looks much nicer.

We could argue that the OptionSelector looks way better, but let's be consistently ugly ;)
Fixed.

> * "The “Internet APN:” and “MMS APN:” radio lists should each consist
> of: * a “None” item, if no APN is currently activated for that
> connection type;..."
>
> On my handset, there are two items in the "Internet APN:" list, but
> neither of them are selected. If it's really true that no Internet
> APN is set on my phone, there should be a selected "None" item.

Will land this separately when we get nuntium support for multiple MMS APN contexts.

> * Consequently, in the "MMS APN:" list, if I tap "Same APN as for
> Internet", I get a dialog: "Error: No Internet APN has been
> selected." Abolish this dialog, and instead just make that "Same
> APN" item insensitive whenever no Internet APN is selected.

Done. No more dialogs.

> * "Choosing “Custom Internet APN…” or “Custom MMS APN…” should open
> the relevant dialog..."
>
> These screens are currently stack pages instead of dialogs. This
> means that I can enter some settings, complete or not, then tap
> the Back button, and it isn't clear whether those settings will be
> saved or not, which is pretty confusing. Even worse, in the "Custom
> MMS APN" screen, the "Password" field is hidden partly under the
> "Cancel" and "Save" buttons, and partly under the OSK. And the
> field labels are weirdly close to the left edge of the screen.

jgdx takes care of this in a separate landing.

> * "“Internet APN”, “MMS APN”, “MMSC”, and “Proxy” should be URL
> fields (using the URL OSK and ignoring non-URL characters)..."
>
> Currently, "Internet APN", "MMS APN", "MMSC", and "Proxy" are all
> normal text fields, allowing impossible characters, and assuming
> that I want to capitalize and spell-check their contents when I do
> not.

I set the relevant hints, but seems the TextField is not validating based on them. We should at least now get a custom OSK for them.

> * "...auto-inserting http:// on unfocus if no protocol was entered."
>
> This doesn't happen.

Nope. Will either fix this on the next landing or file a medium bug.

Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

> Antti has explained to me the current asynchronous and uncommunicative API
> that makes validating a custom APN impossible to implement for MMS, and
> impractically difficult for Internet, at least without a new API. So I
> withdraw the last point, and instead suggest that "Activate" should be merely
> "OK" (since it won't be doing any activation right then).

For Internet it's "Activate" as that we can actually try to activate but don't get any feedback if it succeeds or not. If the config is bad, NM starts to try the other available APNs until it either finds one that works or gives up. You see the selected APN changing in the list while NM does it's magic.

For MMS it's "Save" as that is what it does.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

APN editor: Buttons stay pressed after first tap:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-system-settings/+bug/1376696

APN editor: Grey selection box when tapping just below/above the last/first entry.
https://bugs.launchpad.net/ubuntu/+source/ubuntu-system-settings/+bug/1376713

APN editor: Pressing enter key should shift focus to next field.
https://bugs.launchpad.net/ubuntu/+source/ubuntu-system-settings/+bug/1376714

APN editor: Selected APN states don't persist on exit and re-entry
https://bugs.launchpad.net/ubuntu/+source/ubuntu-system-settings/+bug/1376720

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

Please put the button rectangle inside the flickable instead of anchoring the flickable to the top. We've run into this problem in a number of places in other plugins, putting them inside the flickable has worked out much better.

Please see inline comments

review: Needs Fixing
Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

Could you quickly improve the throwing of exceptions? It might be a bit cryptic as it is?

Also, I added a comment about the tmp variable not being a copy (forgive me if that was intended) and a small inconsistency referring to the __suppress… flag.

See inline comments.

review: Needs Fixing
1102. By Jonas G. Drange

[cellular] react to application.state changes and update potential out-of-date default SIM settings Fixes: 1364103
Approved by: Ken VanDine, PS Jenkins bot

1103. By Sebastien Bacher

[location] use a flickable so the list can be scrolled Fixes: 1374017
Approved by: Ken VanDine, PS Jenkins bot

1104. By Jonas G. Drange

[wifi] let removed networks update the previous network model so that we can reuse the model (and not pop the pagestack twice, causing this ux issue) Fixes: 1370389
Approved by: Ken VanDine, PS Jenkins bot

1105. By Sebastien Bacher

[security] get localized application names from the trust-store
 Fixes: 1374018
Approved by: Ken VanDine, Alberto Mardegan

1106. By PS Jenkins bot

Releasing 0.3+14.10.20141002-0ubuntu1

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1107. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1108. By Iain Lane

[storage/about] Use a QSharedPointer to manage freeing of the counter which we use to display all of the collected sizes at once. If the measuring process was cancelled, we were freeing it multiple times - once for each outstanding size measurement. This led to a crash. Fixes: 1375988
Approved by: Sebastien Bacher, PS Jenkins bot

1109. By Iain Lane

[security-privacy] Link with gobject, uses symbols from this library. Prevents "[…]libUbuntuSecurityPrivacyPanel.so contains an unresolvable reference to symbol g_signal_handlers_disconnect_matched: it's probably a plugin" warnings.
Approved by: Sebastien Bacher

1110. By PS Jenkins bot

Releasing 0.3+14.10.20141003-0ubuntu1

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1111. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1112. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1113. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

Fixed by the review comments in r980. The only non-trivial comments are:

Ken VanDine (ken-vandine) wrote:
> I think you shouldn't be anchoring to the buttonRectangle,
> the buttonRectangle should be in the Flickable.

Yes. I know, but in this case the user usually just enters two of the top fields and having the buttons always visible has some value. I took great care on verifying that the buttons react properly on the viewport changes. If I get it to break on my last testing round, then I will put the buttons inside the flickable, OK?

Ken VanDine (ken-vandine) wrote:
> Does this really return an empty list?
> Perhaps it would be safer to set connections to a QStringList()

the connection list is an array of object paths. QDBusPendingReply quarantees that .value() returns a default constructed T, which in this case is an empty array of dbus-paths.

For the logic that follows it's really irrelevant if an empty list is received (that is also a valid reply).

Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

Now resolving merge conflicts.
IMHO the dynamic SIM logic is a bit broken, but it's more or less a design question. Let's continue on that after this MP is in.

1114. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1115. By Jonas G. Drange

[wifi/phone] dynamically chooses what SIM to use when there's only one present. Fixes: 1375832
Approved by: Ken VanDine, PS Jenkins bot

1116. By PS Jenkins bot

Releasing 0.3+14.10.20141007-0ubuntu1

1117. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1118. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1119. By Ken VanDine

merged apneditor

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/cellular/CMakeLists.txt'
2--- plugins/cellular/CMakeLists.txt 2014-08-17 14:50:51 +0000
3+++ plugins/cellular/CMakeLists.txt 2014-10-03 20:40:51 +0000
4@@ -4,6 +4,8 @@
5 install(FILES settings-cellular.svg DESTINATION ${PLUGIN_MANIFEST_DIR}/icons)
6
7 set(QML_SOURCES
8+ CustomApnEditor.qml
9+ PageChooseApn.qml
10 PageChooseCarrier.qml
11 PageChooseCarriers.qml
12 PageComponent.qml
13@@ -18,6 +20,8 @@
14 plugin.h
15 hotspotmanager.cpp
16 hotspotmanager.h
17+ ofonoactivator.cpp
18+ ofonoactivator.h
19 nm_manager_proxy.h
20 nm_settings_proxy.h
21 nm_settings_connection_proxy.h
22
23=== modified file 'plugins/cellular/Components/CMakeLists.txt'
24--- plugins/cellular/Components/CMakeLists.txt 2014-08-21 20:25:08 +0000
25+++ plugins/cellular/Components/CMakeLists.txt 2014-10-03 20:40:51 +0000
26@@ -9,3 +9,9 @@
27 SimEditor.qml
28 )
29 install(FILES ${QML_SOURCES} DESTINATION ${PLUGIN_QML_DIR}/cellular/Components)
30+
31+# add a phony target to get the files visible in Qt Creator.
32+add_custom_target(
33+ plugins_cellular_components_sources
34+ SOURCES ${QML_SOURCES}
35+)
36
37=== modified file 'plugins/cellular/Components/MultiSim.qml'
38--- plugins/cellular/Components/MultiSim.qml 2014-08-19 23:24:04 +0000
39+++ plugins/cellular/Components/MultiSim.qml 2014-10-03 20:40:51 +0000
40@@ -33,7 +33,7 @@
41 property var settings: phoneSettings
42
43 CellularMultiSim {
44- anchors { left: parent.left; right: parent.right }
45+ anchors { left: parent.left; right: parent.right }
46 }
47
48 ListItem.Divider {}
49@@ -68,6 +68,7 @@
50 text: i18n.tr("Carriers")
51 id: chooseCarrier
52 objectName: "chooseCarrier"
53+ enabled: sim.netReg.status !== ""
54 progression: enabled
55 onClicked: {
56 pageStack.push(Qt.resolvedUrl("../PageChooseCarriers.qml"), {
57@@ -79,13 +80,13 @@
58 ListItem.Divider {}
59
60 SimEditor {
61- anchors { left: parent.left; right: parent.right }
62+ anchors { left: parent.left; right: parent.right }
63 }
64
65 ListItem.Divider {}
66
67 DefaultSim {
68- anchors { left: parent.left; right: parent.right }
69+ anchors { left: parent.left; right: parent.right }
70 }
71
72 GSettings {
73@@ -99,7 +100,7 @@
74 if (!simNames[m0]) {
75 simNames[m0] = "SIM 1";
76 }
77- if (!simNames[m1]) {
78+ if (!simNames[m1]) {
79 simNames[m1] = "SIM 2";
80 }
81 phoneSettings.simNames = simNames;
82
83=== modified file 'plugins/cellular/Components/SingleSim.qml'
84--- plugins/cellular/Components/SingleSim.qml 2014-08-22 10:53:16 +0000
85+++ plugins/cellular/Components/SingleSim.qml 2014-10-03 20:40:51 +0000
86@@ -28,10 +28,10 @@
87 property var sim
88
89 CellularSingleSim {
90- anchors { left: parent.left; right: parent.right }
91+ anchors { left: parent.left; right: parent.right }
92 }
93
94- ListItem.Divider {}
95+ ListItem.Divider {}
96
97 ListItem.SingleValue {
98 text : i18n.tr("Hotspot disabled because Wi-Fi is off.")
99@@ -60,9 +60,10 @@
100 objectName: "chooseCarrier"
101 progression: enabled
102 value: sim.netReg.name || i18n.tr("N/A")
103+ enabled: sim.netReg.status !== ""
104 onClicked: {
105 pageStack.push(Qt.resolvedUrl("../PageChooseCarrier.qml"), {
106- netReg: sim.netReg,
107+ sim: sim,
108 title: i18n.tr("Carrier")
109 })
110 }
111
112=== added file 'plugins/cellular/CustomApnEditor.qml'
113--- plugins/cellular/CustomApnEditor.qml 1970-01-01 00:00:00 +0000
114+++ plugins/cellular/CustomApnEditor.qml 2014-10-03 20:40:51 +0000
115@@ -0,0 +1,322 @@
116+/*
117+ * This file is part of system-settings
118+ *
119+ * Copyright (C) 2014 Canonical Ltd.
120+ *
121+ * Contact: Pat McGowan <pat.mcgowan@canonical.com>
122+ *
123+ * This program is free software: you can redistribute it and/or modify it
124+ * under the terms of the GNU General Public License version 3, as published
125+ * by the Free Software Foundation.
126+ *
127+ * This program is distributed in the hope that it will be useful, but
128+ * WITHOUT ANY WARRANTY; without even the implied warranties of
129+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
130+ * PURPOSE. See the GNU General Public License for more details.
131+ *
132+ * You should have received a copy of the GNU General Public License along
133+ * with this program. If not, see <http://www.gnu.org/licenses/>.
134+ */
135+
136+import QtQuick 2.0
137+import QtQuick.Layouts 1.1
138+import SystemSettings 1.0
139+import Ubuntu.Components 1.1
140+import Ubuntu.Components.ListItems 1.0 as ListItem
141+
142+ItemPage {
143+ objectName: "customapnPage"
144+ id: root
145+
146+ // "internet" or "mms"
147+ property var type
148+
149+ // dict of "type" : ctx
150+ property var contexts;
151+
152+ /// work around LP(#1361919)
153+ property var activateCb;
154+
155+ QtObject {
156+ id: d
157+ property var typeText : type === "internet" ? i18n.tr("Internet") : i18n.tr("MMS")
158+ property bool isMms : type === "mms"
159+
160+ property bool isValid : false
161+
162+ function validateFields() {
163+ if (apnName.text === "") {
164+ isValid = false;
165+ return
166+ }
167+ if (isMms) {
168+ if (mmsc.text === "") {
169+ isValid = false;
170+ return;
171+ }
172+ /// @todo validate proxy
173+ /// @todo force port to be integer and validate it's value
174+ }
175+
176+ // @todo the rest
177+ isValid = true;
178+ }
179+ }
180+
181+ //TRANSLATORS: %1 is either i18n.tr("Internet") or i18n.tr("MMS")
182+ title: i18n.tr("Custom %1 APN").arg(d.typeText)
183+
184+ // workaround of getting the following error on startup:
185+ // WARNING - ... : QML Page: Binding loop detected for property "flickable"
186+ flickable: null
187+ Component.onCompleted: {
188+ flickable: scrollWidget
189+
190+ var ctx;
191+ if (d.isMms) {
192+ ctx = contexts["mms"];
193+ if (ctx === undefined) {
194+ // @bug LP(:#1362795)
195+ return;
196+ }
197+ } else {
198+ ctx = contexts["internet"]
199+ }
200+
201+ apnName.text = ctx.accessPointName;
202+ userName.text = ctx.username;
203+ pword.text = ctx.password;
204+ mmsc.text = ctx.messageCenter;
205+ var proxyText = ctx.messageProxy.split(":");
206+ proxy.text = proxyText[0] !== undefined ? proxyText[0] : "";
207+ port.text = proxyText[1] !== undefined ? proxyText[1] : "";
208+ /// @todo protocol values
209+
210+ if (d.isMms) {
211+ /// @todo disabled for now
212+ doBoth.checked = false;
213+ return;
214+ var internetApn = contexts["internet"]
215+ if (ctx.accessPointName === internetApn.accessPointName &&
216+ ctx.username == internetApn.username &&
217+ ctx.password == internetApn.password
218+ /* auth + procol */) {
219+ doBoth.checked = true;
220+ }
221+ else
222+ doBoth.checked = false;
223+ }
224+ }
225+
226+ Flickable {
227+ id: scrollWidget
228+ anchors {
229+ top: parent.top
230+ left: parent.left
231+ right: parent.right
232+ bottom: parent.bottom
233+ }
234+ contentWidth: parent.width
235+ clip: true
236+ contentHeight: theContents.height
237+ boundsBehavior: (contentHeight > height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
238+ flickableDirection: Flickable.VerticalFlick
239+
240+ Item {
241+ id: theContents
242+ height: sameSwitch.height + theGrid.height
243+ width: parent.width
244+
245+ ListItem.Standard {
246+ id: sameSwitch
247+ anchors.top: parent.top
248+ /// @todo disable for now
249+ //visible: d.isMms
250+ visible: false
251+ text: i18n.tr("Same APN as for Internet")
252+ control: Switch {
253+ id: doBoth
254+ checked: false
255+ anchors.verticalCenter: parent.verticalCenter
256+ onClicked: {
257+ if (checked) {
258+ var internetApn = contexts["internet"]
259+ apnName.text = internetApn.accessPointName;
260+ userName.text = internetApn.username;
261+ pword.text = internetApn.password;
262+ }
263+ }
264+ }
265+ }
266+
267+ GridLayout {
268+ id: theGrid
269+ columns: 2
270+ columnSpacing: units.gu(1)
271+ rowSpacing: units.gu(1)
272+ anchors{
273+ top: d.isMms ? sameSwitch.bottom : parent.top
274+ right: parent.right
275+ left:parent.left
276+ margins: units.gu(0.5)
277+ }
278+
279+ Label {
280+ //TRANSLATORS: %1 is either i18n.tr("Internet") or i18n.tr("MMS")
281+ text: i18n.tr("%1 APN").arg(d.typeText)
282+ }
283+ TextField {
284+ id: apnName
285+ enabled: !doBoth.checked
286+ onTextChanged: d.validateFields()
287+ inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
288+ }
289+
290+ Label {
291+ text: i18n.tr("MMSC")
292+ visible: d.isMms
293+ }
294+ TextField {
295+ id: mmsc
296+ visible: d.isMms
297+ onTextChanged: d.validateFields()
298+ inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
299+ }
300+ Label {
301+ text: i18n.tr("Proxy")
302+ visible: d.isMms
303+ }
304+ TextField {
305+ id: proxy
306+ visible: d.isMms
307+ onTextChanged: d.validateFields()
308+ inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
309+ }
310+ Label {
311+ text: "Port"
312+ visible: d.isMms
313+ }
314+ TextField {
315+ id: port
316+ visible: d.isMms
317+ maximumLength: 4
318+ onTextChanged: d.validateFields()
319+ inputMethodHints: Qt.ImhDigitsOnly | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
320+ }
321+
322+ Label {
323+ text: i18n.tr("Username")
324+ }
325+ TextField {
326+ id: userName
327+ enabled: !doBoth.checked
328+ inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
329+ }
330+
331+ Label {
332+ text: i18n.tr("Password")
333+ }
334+ TextField {
335+ id: pword
336+ enabled: !doBoth.checked
337+ inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
338+ }
339+ /// @todo support for ipv6 will be added after RTM
340+ }
341+ Item {
342+ id: buttonRectangle
343+
344+ height: cancelButton.height + units.gu(2)
345+
346+ anchors {
347+ left: parent.left
348+ right: parent.right
349+ top: theGrid.bottom
350+ }
351+
352+ Button {
353+ id: cancelButton
354+
355+ text: i18n.tr("Cancel")
356+
357+ anchors {
358+ left: parent.left
359+ right: parent.horizontalCenter
360+ bottom: parent.bottom
361+ topMargin: units.gu(1)
362+ leftMargin: units.gu(2)
363+ rightMargin: units.gu(1)
364+ bottomMargin: units.gu(1)
365+ }
366+
367+ onClicked: {
368+ pageStack.pop()
369+ }
370+ }
371+
372+ Button {
373+ id: confirmButton
374+
375+ text: d.isMms ? i18n.tr("Save") : i18n.tr("Activate")
376+
377+ anchors {
378+ left: parent.horizontalCenter
379+ right: parent.right
380+ bottom: parent.bottom
381+ topMargin: units.gu(1)
382+ leftMargin: units.gu(1)
383+ rightMargin: units.gu(2)
384+ bottomMargin: units.gu(1)
385+ }
386+
387+ enabled: d.isValid;
388+
389+ onClicked: {
390+ var ctx;
391+ if (d.isMms)
392+ ctx = contexts["mms"];
393+ else
394+ ctx = contexts["internet"];
395+
396+ /// @bug LP(:#1362795)
397+ if (d.isMms && ctx === undefined) {
398+ var mmsData = ({})
399+ mmsData["accessPointName"] = apnName.text;
400+ mmsData["username"] = userName.text;
401+ mmsData["password"] = pword.text;
402+ mmsData["messageCenter"] = mmsc.text
403+ var proxyValue = "";
404+ if (proxy.text !== "") {
405+ proxyValue = proxy.text;
406+ if (port.text !== "")
407+ proxyValue = proxyValue + ":" + port.text;
408+ }
409+ mmsData["messageProxy"] = proxyValue;
410+ activateCb("mms", undefined, mmsData);
411+ pageStack.pop();
412+ return;
413+ }
414+
415+ ctx.accessPointName = apnName.text;
416+ ctx.username = userName.text;
417+ ctx.password = pword.text;
418+ if (d.isMms) {
419+ ctx.messageCenter = mmsc.text;
420+ var proxyValue = "";
421+ if (proxy.text !== "") {
422+ proxyValue = proxy.text;
423+ if (port.text !== "")
424+ proxyValue = proxyValue + ":" + port.text;
425+ }
426+ ctx.messageProxy = proxyValue
427+ }
428+ /// @todo map protocol values
429+
430+ activateCb(ctx.type, ctx.contextPath);
431+ pageStack.pop();
432+ }
433+ }
434+ } // item for buttons
435+ } // the contents
436+ } // the flickable
437+}
438
439=== added file 'plugins/cellular/PageChooseApn.qml'
440--- plugins/cellular/PageChooseApn.qml 1970-01-01 00:00:00 +0000
441+++ plugins/cellular/PageChooseApn.qml 2014-10-03 20:40:51 +0000
442@@ -0,0 +1,580 @@
443+/*
444+ * This file is part of system-settings
445+ *
446+ * Copyright (C) 2014 Canonical Ltd.
447+ *
448+ * Contact: Pat McGowan <pat.mcgowan@canonical.com>
449+ *
450+ * This program is free software: you can redistribute it and/or modify it
451+ * under the terms of the GNU General Public License version 3, as published
452+ * by the Free Software Foundation.
453+ *
454+ * This program is distributed in the hope that it will be useful, but
455+ * WITHOUT ANY WARRANTY; without even the implied warranties of
456+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
457+ * PURPOSE. See the GNU General Public License for more details.
458+ *
459+ * You should have received a copy of the GNU General Public License along
460+ * with this program. If not, see <http://www.gnu.org/licenses/>.
461+ */
462+
463+import QtQuick 2.0
464+import SystemSettings 1.0
465+import Ubuntu.Components 1.1
466+import Ubuntu.Components.Popups 0.1
467+import Ubuntu.Components.ListItems 0.1 as ListItem
468+import MeeGo.QOfono 0.2
469+import Ubuntu.SystemSettings.Cellular 1.0
470+
471+ItemPage {
472+ id: root
473+ title: i18n.tr("APN")
474+ objectName: "apnPage"
475+
476+ property var sim
477+
478+ QtObject {
479+ id: d
480+
481+ // map of contextPath : connCtx
482+ property var mContexts: ({})
483+
484+ readonly property string mCustomContextNameInternet: "___ubuntu_custom_apn_internet"
485+ readonly property string mCustomContextNameMms: "___ubuntu_custom_apn_mms"
486+ property var mCustomContextInternet : undefined
487+ property var mCustomContextMms : undefined
488+
489+ // LP(:#1362795)
490+ property var pendingCustomMmsData : ({})
491+
492+ // suppress any actions that we don't want to take
493+ // when updating selectedIndexes, etc
494+ property bool __suppressActivation : true;
495+
496+ function isEmptyCustom (type, ctx)
497+ {
498+ /* OK, this sucks _hard_,
499+ * QOfono does not return the added context, so instead we have to "figure it out"
500+ * by looking for "contextAdded" for totally empty context with default Name values.
501+ * LP(#1361864)
502+ */
503+
504+ var targetName = "";
505+ var targetAccessPointName = "";
506+ if (type === "internet") {
507+ targetName = "Internet";
508+ targetAccessPointName = "";
509+ } else if (type == "mms") {
510+ targetName = "MMS";
511+ targetAccessPointName = "";
512+ }
513+
514+ if (ctx.type === type &&
515+ ctx.name === targetName &&
516+ ctx.accessPointName === targetAccessPointName)
517+ return true;
518+ return false;
519+ }
520+
521+ function updateContexts()
522+ {
523+ var tmp = sim.connMan.contexts.slice(0);
524+ var added = tmp.filter(function(i) {
525+ return mContexts[i] === undefined;
526+ });
527+ var removed = Object.keys(mContexts).filter(function(i) {
528+ return tmp.indexOf(i) === -1;
529+ })
530+
531+ removed.forEach(function(currentValue, index, array) {
532+ // just asserting to verify the logic
533+ // remove once proven functional
534+ if (mContexts[currentValue] === undefined) {
535+ throw "updateContexts: removed is broken";
536+ }
537+
538+ if (mContexts[currentValue].name === mCustomContextNameInternet)
539+ mCustomContextInternet = undefined
540+ else if (mContexts[currentValue].name === mCustomContextNameMms)
541+ mCustomContextMms = undefined
542+
543+ mContexts[currentValue].destroy();
544+ delete mContexts[currentValue];
545+ });
546+
547+ added.forEach(function(currentValue, index, array) {
548+ // just asserting to verify the logic
549+ // remove once proven functional
550+ if (mContexts[currentValue] !== undefined) {
551+ throw "updateContexts: added is broken";
552+ }
553+
554+ var ctx = connCtx.createObject(parent,
555+ {
556+ "contextPath": currentValue
557+ });
558+ mContexts[currentValue] = ctx;
559+
560+ if (isEmptyCustom("internet", ctx))
561+ {
562+ ctx.name = mCustomContextNameInternet;
563+ // name updates async, so return here and
564+ // have the buildLists() called from Context::onNameChanged
565+ return;
566+ } else if (isEmptyCustom("mms", ctx))
567+ {
568+ ctx.name = mCustomContextNameMms;
569+ ctx.accessPointName = pendingCustomMmsData["accessPointName"];
570+ ctx.username = pendingCustomMmsData["username"];
571+ ctx.password = pendingCustomMmsData["password"];
572+ ctx.messageCenter = pendingCustomMmsData["messageCenter"];
573+ ctx.messageProxy = pendingCustomMmsData["messageProxy"];
574+ pendingCustomMmsData = ({});
575+ // values update async, so return here and
576+ // have the buildLists() called from Context::onNameChanged
577+ return;
578+ }
579+ });
580+
581+ // just asserting to verify the logic
582+ // remove once proven functional
583+ if (Object.keys(mContexts).length !== tmp.length) {
584+ throw "Object.keys(contexts).length !== tmp.length";
585+ }
586+ tmp.forEach(function(currentValue, index, array) {
587+ if (mContexts[currentValue] === undefined)
588+ throw "contexts[currentValue] === undefined";
589+ });
590+
591+ buildLists();
592+ }
593+
594+ // expects updateContexts() to have ran before executing.
595+ function checkAndCreateCustomContexts()
596+ {
597+ var customInternet = Object.keys(mContexts).filter(function (i) {
598+ var ctx = mContexts[i];
599+ return ctx.name === mCustomContextNameInternet ||
600+ isEmptyCustom("internet", ctx);
601+ });
602+ var customMms = Object.keys(mContexts).filter(function (i) {
603+ var ctx = mContexts[i];
604+ return ctx.name === mCustomContextNameMms ||
605+ isEmptyCustom("mms", ctx);
606+ });
607+
608+ // make sure there is only one context per type
609+ if (customInternet.length > 1) {
610+ customInternet.forEach(function(currentValue, index, array) {
611+ if (index === 0)
612+ return;
613+ sim.connMan.removeContext(currentValue);
614+ });
615+ }
616+ if (customMms.length > 1) {
617+ customMms.forEach(function(currentValue, index, array) {
618+ if (index === 0)
619+ return;
620+ sim.connMan.removeContext(currentValue);
621+ });
622+ }
623+
624+ if (customInternet.length === 0) {
625+ sim.connMan.addContext("internet");
626+ }
627+
628+ // @bug don't create the custom MMS context
629+ // LP(:#1362795)
630+ // if (customMms.length === 0) {
631+ // sim.connMan.addContext("mms");
632+ // }
633+
634+ buildLists();
635+ }
636+
637+ property var mInternetApns : [];
638+ property var mMmsApns : [];
639+ function buildLists()
640+ {
641+ d.__suppressActivation = true;
642+
643+ var internet = [];
644+ var mms = [];
645+
646+ internet = Object.keys(mContexts).filter(function(i) {
647+ var ctx = mContexts[i];
648+ if (ctx.type === "internet") {
649+ if (ctx.name === mCustomContextNameInternet) {
650+ mCustomContextInternet = ctx
651+ // don't add yet
652+ return false;
653+ }
654+ return true;
655+ }
656+ return false;
657+ });
658+ mms = Object.keys(mContexts).filter(function(i) {
659+ var ctx = mContexts[i];
660+ if ( ctx.type === "mms") {
661+ if (ctx.name === mCustomContextNameMms) {
662+ mCustomContextMms = ctx;
663+ // don't add yet
664+ return false;
665+ }
666+ return true;
667+ }
668+ return false;
669+ });
670+
671+ // make sure customized are the last on the lists
672+ if (mCustomContextInternet !== undefined)
673+ internet = internet.concat([mCustomContextInternet.contextPath])
674+ if (mCustomContextMms !== undefined)
675+ mms = mms.concat([mCustomContextMms.contextPath])
676+ else {
677+ /// @bug LP(#1361864)
678+ // add anyway a "dummy" Custom so we can show at least the one provisioned
679+ // MMS context as long as the user does not hit "Custom" in the MMS list.
680+ mms = mms.concat(["dummycustom"])
681+ }
682+
683+ // add "Same APN as for Internet" to be the first on the MMS list
684+ mms = ["/same/as/internet"].concat(mms);
685+
686+ mInternetApns = internet;
687+ mMmsApns = mms;
688+
689+ d.__suppressActivation = false;
690+ }
691+
692+ function openApnEditor(type) {
693+ var ctx;
694+ if (type === "internet") {
695+ ctx = mCustomContextInternet;
696+ } else if (type == "mms") {
697+ ctx = mCustomContextMms;
698+ }
699+ /// can't modify active context
700+ if (ctx !== undefined && ctx.active)
701+ ctx.active = false;
702+
703+ pageStack.push(Qt.resolvedUrl("CustomApnEditor.qml"),
704+ {
705+ type: type,
706+ contexts: {"internet": mCustomContextInternet,
707+ "mms": mCustomContextMms},
708+ activateCb: activateHelper
709+ });
710+ }
711+
712+ function activateHelper(type, contextPath, customMmsData) {
713+ if (type === "internet")
714+ activator.activate(contextPath, sim.simMng.subscriberIdentity, sim.simMng.modemPath)
715+ if (type === "mms") {
716+ if (contextPath === undefined) {
717+ // LP(:#1362795)
718+ pendingCustomMmsData = customMmsData
719+ /// remove any provisioned ones..
720+ var remove = []
721+ Object.keys(mContexts).forEach(function(currentValue, index, array) {
722+ var ctx = mContexts[currentValue];
723+ if (ctx.type === "mms")
724+ remove = remove.concat([ctx.contextPath])
725+ });
726+ remove.forEach(function(currentValue, index, array) {
727+ sim.connMan.removeContext(currentValue);
728+ });
729+ sim.connMan.addContext("mms")
730+ }
731+ }
732+ }
733+ }
734+
735+ OfonoActivator {
736+ id:activator
737+ }
738+
739+ Component {
740+ id: connCtx
741+ OfonoContextConnection {
742+
743+ // add helper property to detect dual internet/MMS contexts
744+ property bool dual : false
745+ Component.onCompleted:{
746+ if (type == "internet")
747+ if (messageCenter !== "")
748+ dual = true
749+ }
750+
751+ onActiveChanged: if (type === "internet") internetApnSelector.updateSelectedIndex()
752+ onNameChanged: d.buildLists()
753+ onAccessPointNameChanged: d.buildLists()
754+ onReportError: console.error("Context error on " + contextPath + ": " + errorString)
755+ }
756+ }
757+
758+ Connections {
759+ target: sim.connMan
760+ onContextsChanged: d.updateContexts()
761+
762+ Component.onCompleted: {
763+ d.updateContexts();
764+ // do this once.
765+ d.checkAndCreateCustomContexts();
766+ }
767+ }
768+
769+ Flickable {
770+ id: scrollWidget
771+ anchors.fill: parent
772+ contentHeight: contentItem.childrenRect.height
773+ boundsBehavior: (contentHeight > root.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
774+ flickableDirection: Flickable.VerticalFlick
775+
776+ Column {
777+
778+ anchors {
779+ left: parent.left
780+ right: parent.right
781+ }
782+
783+ ListItem.Standard {
784+ id: heading1
785+ objectName: "internetapn"
786+ text: i18n.tr("Internet APN:")
787+ progression: false
788+ }
789+ ListItem.ThinDivider {}
790+ ListItem.SingleControl {
791+ control: ListItem.ItemSelector {
792+ id: internetApnSelector
793+ width: parent.width - units.gu(4)
794+ model: d.mInternetApns
795+ expanded: true
796+ selectedIndex: -1
797+ onModelChanged: updateSelectedIndex()
798+
799+ function updateSelectedIndex()
800+ {
801+ var tmp = d.__suppressActivation
802+ d.__suppressActivation = true;
803+ var idx = -1;
804+ if (model) {
805+ model.forEach(function(currentValue, index, array) {
806+ if (d.mContexts[currentValue].active)
807+ idx = index;
808+ });
809+ }
810+ selectedIndex = idx;
811+ d.__suppressActivation = tmp;
812+ }
813+
814+ delegate: OptionSelectorDelegate {
815+ showDivider: false
816+ text: {
817+ var ctx = d.mContexts[modelData];
818+ if (ctx.name !== "") {
819+ if (ctx.name !== d.mCustomContextNameInternet) {
820+ return ctx.name
821+ } else {
822+ //: user visible name of the custom Internet APN
823+ return i18n.tr("Custom");
824+ }
825+ } else {
826+ return ctx.accessPointName
827+ }
828+ }
829+ }
830+ onSelectedIndexChanged: {
831+ if (selectedIndex === -1) {
832+ if (mmsApnSelector && mmsApnSelector.model[mmsApnSelector.selectedIndex] === "/same/as/internet")
833+ mmsApnSelector.selectedIndex = -1;
834+ return;
835+ }
836+
837+ var ctx = d.mContexts[model[selectedIndex]];
838+ if(ctx.dual) {
839+ if (!d.mCustomContextMms)
840+ mmsApnSelector.selectedIndex = mmsApnSelector.model.indexOf("/same/as/internet");
841+ }
842+ else if (mmsApnSelector.model[mmsApnSelector.selectedIndex] === "/same/as/internet")
843+ mmsApnSelector.selectedIndex = -1;
844+
845+ if (d.__suppressActivation)
846+ return;
847+
848+ if (d.mCustomContextInternet && model[selectedIndex] === d.mCustomContextInternet.contextPath) {
849+ if (d.mCustomContextInternet.accessPointName === "") {
850+ d.openApnEditor("internet");
851+ updateSelectedIndex();
852+ return;
853+ }
854+ }
855+
856+ d.activateHelper(ctx.contextPath);
857+ }
858+ }
859+ }
860+ ListItem.SingleControl {
861+ control: Button {
862+ objectName: "customApnEdit"
863+ text: i18n.tr("Custom Internet APN…")
864+ width: parent.width - units.gu(4)
865+ onClicked: d.openApnEditor("internet")
866+ }
867+ }
868+
869+ ListItem.Divider {}
870+
871+ ListItem.Standard {
872+ id: heading2
873+ objectName: "mmsapn"
874+ text: i18n.tr("MMS APN:")
875+ progression: false
876+ }
877+ ListItem.ThinDivider {}
878+ ListItem.SingleControl {
879+ control: ListItem.ItemSelector {
880+ id: mmsApnSelector
881+ width: parent.width - units.gu(4)
882+ model: d.mMmsApns
883+ expanded: true
884+ selectedIndex: -1
885+ delegate: OptionSelectorDelegate {
886+ showDivider: modelData === "/same/as/internet"
887+ enabled: {
888+ if (modelData !== "/same/as/internet")
889+ return true;
890+ else
891+ d.mContexts[internetApnSelector.model[internetApnSelector.selectedIndex]].dual
892+ }
893+ // work around OptionSelectorDelegate not having a visual change depending on being disabled
894+ opacity: enabled ? 1.0 : 0.5
895+ text: {
896+ if (modelData === "/same/as/internet") {
897+ return i18n.tr("Same APN as for Internet");
898+ }
899+ if (modelData === "dummycustom") {
900+ return i18n.tr("Custom");
901+ }
902+ var ctx = d.mContexts[modelData];
903+ if (ctx.name !== "") {
904+ if (ctx.name !== d.mCustomContextNameMms) {
905+ return ctx.name
906+ } else {
907+ //: user visible name of the custom MMS APN
908+ return i18n.tr("Custom");
909+ }
910+ } else {
911+ return ctx.accessPointName
912+ }
913+ }
914+ }
915+ onModelChanged: updateSelectedIndex();
916+ function updateSelectedIndex()
917+ {
918+ // if we have custom MMS context, it must be active.
919+ // @bug LP(#1361864)
920+ var tmp = d.__suppressActivation;
921+ d.__suppressActivation = true;
922+ if (d.mCustomContextMms) {
923+ selectedIndex = model.indexOf(d.mCustomContextMms.contextPath);
924+ } else if (model.length === 3) {
925+ /* meaning we have:
926+ * 0 - /same/as/internet
927+ * 1 - some provisioned one
928+ * 2 - dummycustom
929+ */
930+ selectedIndex = 1;
931+ } else if (internetApnSelector.model && internetApnSelector.selectedIndex !== -1) {
932+ if (d.mContexts[internetApnSelector.model[internetApnSelector.selectedIndex]].dual) {
933+ selectedIndex = model.indexOf("/same/as/internet");
934+ } else
935+ selectedIndex = -1;
936+ } else {
937+ selectedIndex = -1;
938+ }
939+ d.__suppressActivation = tmp;
940+ }
941+
942+ onSelectedIndexChanged: {
943+ if (selectedIndex === -1 || d.__suppressActivation)
944+ return;
945+
946+ if (model[selectedIndex] === "/same/as/internet") {
947+ // @bug delete _any_ actual MMS context
948+ // LP:(#1362795)
949+ var remove = [];
950+ Object.keys(d.mContexts).forEach(function(currentValue, index, array) {
951+ var ctx = d.mContexts[currentValue];
952+ if (ctx.type === "mms")
953+ remove = remove.concat([ctx.contextPath]);
954+ });
955+ remove.forEach(function(currentValue, index, array) {
956+ sim.connMan.removeContext(currentValue);
957+ });
958+ return;
959+ }
960+
961+ if (model[selectedIndex] === "dummycustom") {
962+ d.openApnEditor("mms");
963+ updateSelectedIndex()
964+ return;
965+ }
966+
967+ // no need to "activate" anything.
968+ // just fall through return here.
969+ // once we actually are able to suppport multiple MMS contexts
970+ // on the system, add some code here to set one of them active
971+ }
972+ }
973+ }
974+ ListItem.SingleControl {
975+ control: Button {
976+ objectName: "customApnEdit"
977+ text: i18n.tr("Custom MMS APN…")
978+ width: parent.width - units.gu(4)
979+ onClicked: d.openApnEditor("mms")
980+ }
981+ }
982+
983+ // @todo: no means of doing any meaningful reset right now.
984+ // LP(#1338758)
985+ // ListItem.ThinDivider {}
986+ // ListItem.SingleControl {
987+ // control: Button {
988+ // objectName: "resetButton"
989+ // text: i18n.tr("Reset APN Settings")
990+ // width: parent.width - units.gu(4)
991+ // onClicked: {
992+ // PopupUtils.open(resetDialog)
993+ // }
994+ // }
995+ // }
996+ }
997+ }
998+
999+ Component {
1000+ id: resetDialog
1001+ Dialog {
1002+ id: dialogue
1003+ title: i18n.tr("Reset APN Settings")
1004+ text: i18n.tr("Are you sure that you want to Reset APN Settings?")
1005+ Button {
1006+ text: i18n.tr("Cancel")
1007+ onClicked: PopupUtils.close(dialogue)
1008+ }
1009+ Button {
1010+ text: i18n.tr("Reset")
1011+ color: UbuntuColors.orange
1012+ onClicked: {
1013+ // delete all APNs
1014+ // kick ofono per
1015+ // https://bugs.launchpad.net/ubuntu/+source/ofono/+bug/1338758
1016+
1017+ }
1018+ }
1019+
1020+ }
1021+ }
1022+}
1023
1024=== modified file 'plugins/cellular/PageChooseCarrier.qml'
1025--- plugins/cellular/PageChooseCarrier.qml 2014-07-24 19:00:45 +0000
1026+++ plugins/cellular/PageChooseCarrier.qml 2014-10-03 20:40:51 +0000
1027@@ -19,55 +19,104 @@
1028 */
1029
1030 import QtQuick 2.0
1031+import QtQuick.Layouts 1.1
1032 import SystemSettings 1.0
1033-import Ubuntu.Components 0.1
1034-import Ubuntu.Components.ListItems 0.1 as ListItem
1035+import Ubuntu.Components 1.1
1036+import Ubuntu.Components.ListItems 1.0 as ListItem
1037 import MeeGo.QOfono 0.2
1038
1039 ItemPage {
1040- title: title
1041+ id: root
1042+ title: i18n.tr("Carrier")
1043+
1044 objectName: "chooseCarrierPage"
1045
1046- property var netReg
1047- property var operators: []
1048- property bool scanning: false
1049+ property var sim
1050+
1051 property variant operatorNames
1052- property variant operatorStatus
1053- property int curOp
1054- Component.onCompleted: buildLists();
1055+ property int mode
1056+
1057+ QtObject {
1058+ id: d
1059+ property bool __suppressActivation : true;
1060+ }
1061+
1062+ Component.onCompleted: {
1063+ updateNetworkOperators();
1064+ }
1065
1066 Connections {
1067- target: netReg
1068- onStatusChanged: {
1069- if (netReg.status === "registered")
1070- buildLists();
1071- }
1072- onNetworkOperatorsChanged: buildLists();
1073- onScanFinished: scanning = false;
1074- onScanError: {
1075- scanning = false;
1076- console.warn ("onScanError: " + message);
1077- }
1078+ target: sim.netReg
1079+ onNetworkOperatorsChanged: updateNetworkOperators();
1080+ onCurrentOperatorPathChanged: buildLists();
1081+ }
1082+
1083+ // map of operatorPath : netOp
1084+ // FIXME: comment on operators' value
1085+ property var operators: ({})
1086+ function updateNetworkOperators()
1087+ {
1088+ var tmp = sim.netReg.networkOperators;
1089+ var added = tmp.filter(function(i) {
1090+ return operators[i] === undefined;
1091+ });
1092+ var removed = Object.keys(operators).filter(function(i) {
1093+ return tmp.indexOf(i) === -1;
1094+ })
1095+
1096+ removed.forEach(function(currentValue, index, array) {
1097+ // just asserting to verify the logic
1098+ // remove once proven functional
1099+ if (operators[currentValue] === undefined) {
1100+ throw "updateNetworkOperators: removed is broken";
1101+ }
1102+
1103+ operators[currentValue].destroy();
1104+ delete operators[currentValue];
1105+ });
1106+
1107+ added.forEach(function(currentValue, index, array) {
1108+ // just asserting to verify the logic
1109+ // remove once proven functional
1110+ if (operators[currentValue] !== undefined) {
1111+ throw "updateNetworkOperators: added is broken";
1112+ }
1113+
1114+ operators[currentValue] = netOp.createObject(parent,
1115+ {
1116+ "operatorPath": currentValue
1117+ });
1118+ });
1119+
1120+ // just asserting to verify the logic
1121+ // remove once proven functional
1122+ if (Object.keys(operators).length !== tmp.length) {
1123+ throw "Object.keys(operators).length !== tmp.length";
1124+ }
1125+ tmp.forEach(function(currentValue, index, array) {
1126+ if (operators[currentValue] === undefined)
1127+ throw "operators[currentValue] === undefined";
1128+ });
1129+
1130+ buildLists();
1131 }
1132
1133 function buildLists()
1134 {
1135- var ops = [];
1136+ d.__suppressActivation = true;
1137 var oN = new Array();
1138- var oS = new Array();
1139- for (var i = 0; i < netReg.networkOperators.length; i++) {
1140- var tempOp = netOp.createObject(parent, {"operatorPath": netReg.networkOperators[i]});
1141+
1142+ for (var i in operators) {
1143+ var tempOp = operators[i];
1144 if (tempOp.status === "forbidden")
1145 continue
1146 oN.push(tempOp.name);
1147- oS.push(tempOp.status);
1148- ops.push(tempOp)
1149 }
1150- curOp = oS.indexOf("current");
1151 operatorNames = oN;
1152- operatorStatus = oS;
1153- operators = ops;
1154- carrierSelector.selectedIndex = curOp;
1155+
1156+ var cur = operators[sim.netReg.currentOperatorPath];
1157+ carrierSelector.selectedIndex = cur === undefined ? -1 : operatorNames.indexOf(cur.name);
1158+ d.__suppressActivation = false;
1159 }
1160
1161 Component {
1162@@ -78,78 +127,114 @@
1163 console.warn("registerComplete failed with error: " + errorString);
1164 } else if (error !== OfonoNetworkOperator.NoError) {
1165 console.warn("registerComplete failed with error: " + errorString + " Falling back to default");
1166- netReg.registration();
1167+ sim.netReg.registration();
1168 }
1169 }
1170+ onNameChanged: buildLists();
1171+ onStatusChanged: buildLists();
1172 }
1173 }
1174
1175 Flickable {
1176+ id: scrollWidget
1177 anchors.fill: parent
1178 contentWidth: parent.width
1179 contentHeight: parent.height
1180 boundsBehavior: (contentHeight > parent.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
1181
1182- Column {
1183- anchors.left: parent.left
1184- anchors.right: parent.right
1185+ ColumnLayout {
1186+
1187+ anchors {
1188+ left: parent.left
1189+ right: parent.right
1190+ }
1191
1192 ListItem.ItemSelector {
1193 id: chooseCarrier
1194 objectName: "autoChooseCarrierSelector"
1195 expanded: true
1196- enabled: netReg.mode !== "auto-only"
1197+ enabled: sim.netReg.mode !== "auto-only"
1198 text: i18n.tr("Choose carrier:")
1199 model: [i18n.tr("Automatically"), i18n.tr("Manually")]
1200- selectedIndex: netReg.mode === "manual" ? 1 : 0
1201+
1202+ delegate: OptionSelectorDelegate { showDivider: false }
1203+ selectedIndex: sim.netReg.mode === "manual" ? 1 : 0
1204+
1205+ // we only want to do this per user input
1206 onSelectedIndexChanged: {
1207- if (selectedIndex === 0)
1208- netReg.registration();
1209+ if (selectedIndex === -1 || d.__suppressActivation)
1210+ return;
1211+
1212+ if (selectedIndex === 0) {
1213+ sim.netReg.registration();
1214+ } else if (selectedIndex === 1) {
1215+ if (sim.netReg.status !== "searching")
1216+ sim.netReg.scan();
1217+ }
1218 }
1219 }
1220-
1221- ListItem.ItemSelector {
1222- id: carrierSelector
1223- objectName: "carrierSelector"
1224- expanded: enabled
1225+ ListItem.SingleControl {
1226 enabled: chooseCarrier.selectedIndex === 1
1227- model: operatorNames
1228- onSelectedIndexChanged: {
1229- if ((selectedIndex !== curOp) && operators[selectedIndex]) {
1230- operators[selectedIndex].registerOperator();
1231- }
1232- }
1233- }
1234- }
1235-
1236- ListItem.SingleControl {
1237- anchors.bottom: parent.bottom
1238- control: Button {
1239- objectName: "refreshButton"
1240- width: parent.width - units.gu(4)
1241- text: i18n.tr("Refresh")
1242- enabled: (netReg.status !== "searching") && (netReg.status !== "denied")
1243- onTriggered: {
1244- scanning = true;
1245- netReg.scan();
1246- }
1247- }
1248- }
1249-
1250- ActivityIndicator {
1251- id: activityIndicator
1252- anchors.centerIn: parent
1253- running: scanning
1254- }
1255-
1256- Label {
1257- anchors {
1258- top: activityIndicator.bottom
1259- topMargin: units.gu(2)
1260- horizontalCenter: activityIndicator.horizontalCenter
1261- }
1262- text: i18n.tr("Searching")
1263- visible: activityIndicator.running
1264+ anchors {
1265+ left: parent.left
1266+ leftMargin: units.gu(0)
1267+ }
1268+ control: ColumnLayout {
1269+ id: child
1270+ width: parent.width - units.gu(4)
1271+ anchors.left: parent.left
1272+ RowLayout {
1273+ id: searchingRow
1274+ spacing: units.gu(1)
1275+
1276+ visible: sim.netReg.status === "searching"
1277+ ActivityIndicator {
1278+ id: activityIndicator
1279+ anchors.verticalCenter: parent.verticalCenter
1280+ running: parent.visible
1281+ }
1282+ Label {
1283+ anchors.verticalCenter: parent.verticalCenter
1284+ text: i18n.tr("Searching for carriers…")
1285+ }
1286+ }
1287+ ListItem.ItemSelector {
1288+ id: carrierSelector
1289+ objectName: "carrierSelector"
1290+ expanded: true
1291+ enabled: sim.netReg.status !== "searching" && chooseCarrier.selectedIndex === 1
1292+ // work around ItemSelector not having a visual change depending on being disabled
1293+ opacity: enabled ? 1.0 : 0.5
1294+ width: parent.width
1295+ model: operatorNames
1296+ delegate: OptionSelectorDelegate { enabled: carrierSelector.enabled; showDivider: false }
1297+ onSelectedIndexChanged: {
1298+ if (selectedIndex === -1 || d.__suppressActivation)
1299+ return;
1300+
1301+ // this assumes operator names are unique,
1302+ // revise if not so
1303+ for (var op in operators) {
1304+ if (operators[op].name === operatorNames[selectedIndex]) {
1305+ operators[op].registerOperator();
1306+ return;
1307+ }
1308+ }
1309+ // just asserting to verify the logic
1310+ // remove once proven functional
1311+ throw "should not be reached.";
1312+ }
1313+ }
1314+ }
1315+ }
1316+ ListItem.Standard {
1317+ text: i18n.tr("APN")
1318+ progression: true
1319+ enabled: sim.connMan.powered
1320+ onClicked: {
1321+ pageStack.push(Qt.resolvedUrl("PageChooseApn.qml"), {sim: sim})
1322+ }
1323+ }
1324 }
1325 }
1326 }
1327
1328=== modified file 'plugins/cellular/PageChooseCarriers.qml'
1329--- plugins/cellular/PageChooseCarriers.qml 2014-08-17 14:50:51 +0000
1330+++ plugins/cellular/PageChooseCarriers.qml 2014-10-03 20:40:51 +0000
1331@@ -21,7 +21,6 @@
1332 import SystemSettings 1.0
1333 import Ubuntu.Components 0.1
1334 import Ubuntu.Components.ListItems 0.1 as ListItem
1335-import MeeGo.QOfono 0.2
1336
1337 ItemPage {
1338 id: root
1339@@ -50,7 +49,7 @@
1340 progression: true
1341 onClicked: {
1342 pageStack.push(Qt.resolvedUrl("PageChooseCarrier.qml"), {
1343- netReg: sims[0].netReg,
1344+ sim: sims[0],
1345 title: sims[0].title
1346 })
1347 }
1348@@ -66,7 +65,7 @@
1349 progression: true
1350 onClicked: {
1351 pageStack.push(Qt.resolvedUrl("PageChooseCarrier.qml"), {
1352- netReg: sims[1].netReg,
1353+ sim: sims[1],
1354 title: sims[1].title
1355 })
1356 }
1357
1358=== modified file 'plugins/cellular/PageComponent.qml'
1359--- plugins/cellular/PageComponent.qml 2014-08-19 10:58:01 +0000
1360+++ plugins/cellular/PageComponent.qml 2014-10-03 20:40:51 +0000
1361@@ -47,7 +47,7 @@
1362 name: "singleSim"
1363 StateChangeScript {
1364 script: loader.setSource("Components/SingleSim.qml", {
1365- sim: Sims.get(0)
1366+ sim: Sims.getFirstPresent()
1367 })
1368 }
1369 when: simsLoaded && (Sims.getPresentCount() === 1)
1370
1371=== added file 'plugins/cellular/ofonoactivator.cpp'
1372--- plugins/cellular/ofonoactivator.cpp 1970-01-01 00:00:00 +0000
1373+++ plugins/cellular/ofonoactivator.cpp 2014-10-03 20:40:51 +0000
1374@@ -0,0 +1,119 @@
1375+/*
1376+ * Copyright (C) 2014 Canonical, Ltd.
1377+ *
1378+ * Authors:
1379+ * Jussi Pakkanen <jussi.pakkanen@canonical.com>
1380+ *
1381+ * This program is free software: you can redistribute it and/or modify it
1382+ * under the terms of the GNU General Public License version 3, as published
1383+ * by the Free Software Foundation.
1384+ *
1385+ * This library is distributed in the hope that it will be useful, but WITHOUT
1386+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1387+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
1388+ * details.
1389+ *
1390+ * You should have received a copy of the GNU General Public License
1391+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1392+ */
1393+
1394+#include "ofonoactivator.h"
1395+
1396+#include"nm_manager_proxy.h"
1397+#include"nm_settings_proxy.h"
1398+#include"nm_settings_connection_proxy.h"
1399+#include<QCoreApplication>
1400+
1401+typedef QMap<QString,QVariantMap> Vardict;
1402+Q_DECLARE_METATYPE(Vardict)
1403+
1404+namespace {
1405+
1406+QString nmService("org.freedesktop.NetworkManager");
1407+QString nmSettingsPath("/org/freedesktop/NetworkManager/Settings");
1408+QString nmPath("/org/freedesktop/NetworkManager");
1409+
1410+QDBusObjectPath detectConnection(const QString &ofonoContext, const QString imsi) {
1411+ auto ofonoContextBase = ofonoContext.split('/').back();
1412+ auto target = "/" + imsi + "/" + ofonoContextBase;
1413+
1414+ OrgFreedesktopNetworkManagerSettingsInterface settings(nmService, nmSettingsPath,
1415+ QDBusConnection::systemBus());
1416+ auto reply = settings.ListConnections();
1417+ reply.waitForFinished();
1418+ if(!reply.isValid()) {
1419+ qWarning() << "Error getting connection list: " << reply.error().message() << "\n";
1420+ }
1421+ auto connections = reply.value(); // Empty list if failed.
1422+
1423+ for(const auto &c : connections) {
1424+ OrgFreedesktopNetworkManagerSettingsConnectionInterface connProxy(nmService,
1425+ c.path(), QDBusConnection::systemBus());
1426+ auto reply2 = connProxy.GetSettings();
1427+ reply2.waitForFinished();
1428+ if(!reply2.isValid()) {
1429+ qWarning() << "Error getting property: " << reply2.error().message() << "\n";
1430+ continue;
1431+ }
1432+ auto settings = reply2.value();
1433+ auto id = settings["connection"]["id"].toString();
1434+ if(id == target) {
1435+ return c;
1436+ }
1437+ }
1438+ return QDBusObjectPath("");
1439+}
1440+
1441+QDBusObjectPath detectDevice(const QString &modemPath) {
1442+ OrgFreedesktopNetworkManagerInterface nm(nmService, nmPath, QDBusConnection::systemBus());
1443+ auto reply = nm.GetDevices();
1444+ reply.waitForFinished();
1445+ auto devices = reply.value();
1446+
1447+ for(const auto &device : devices) {
1448+ QDBusInterface iface(nmService, device.path(), "org.freedesktop.DBus.Properties",
1449+ QDBusConnection::systemBus());
1450+ QDBusReply<QDBusVariant> ifaceReply = iface.call("Get",
1451+ "org.freedesktop.NetworkManager.Device", "Interface");
1452+ if(!ifaceReply.isValid()) {
1453+ qWarning() << "Error getting property: " << ifaceReply.error().message() << "\n";
1454+ continue;
1455+ }
1456+ auto devIface = ifaceReply.value().variant().toString();
1457+ if(devIface == modemPath) {
1458+ return device;
1459+ }
1460+ }
1461+ return QDBusObjectPath("");
1462+}
1463+}
1464+
1465+void activateOfono(QDBusObjectPath connection, QDBusObjectPath device)
1466+{
1467+ OrgFreedesktopNetworkManagerInterface nm(nmService, nmPath, QDBusConnection::systemBus());
1468+ nm.ActivateConnection(connection, device, QDBusObjectPath("/"));
1469+}
1470+
1471+OfonoActivator::OfonoActivator(QObject *parent) : QObject(parent) {
1472+ static bool isRegistered = false;
1473+ if(!isRegistered) {
1474+ qDBusRegisterMetaType<Vardict>();
1475+ isRegistered = true;
1476+ }
1477+}
1478+
1479+Q_INVOKABLE bool OfonoActivator::activate(const QString ofonoContext, const QString imsi, const QString modemPath)
1480+{
1481+ auto dev = detectDevice(modemPath);
1482+ if(dev.path() == "") {
1483+ qWarning() << "Could not detect device object to use for Ofono activation.\n";
1484+ return false;
1485+ }
1486+ auto conn = detectConnection(ofonoContext, imsi);
1487+ if(conn.path() == "") {
1488+ qWarning() << "Could not detect connection object to use for Ofono activation.\n";
1489+ return false;
1490+ }
1491+ activateOfono(conn, dev);
1492+ return true;
1493+}
1494
1495=== added file 'plugins/cellular/ofonoactivator.h'
1496--- plugins/cellular/ofonoactivator.h 1970-01-01 00:00:00 +0000
1497+++ plugins/cellular/ofonoactivator.h 2014-10-03 20:40:51 +0000
1498@@ -0,0 +1,42 @@
1499+/*
1500+ * Copyright (C) 2014 Canonical, Ltd.
1501+ *
1502+ * Authors:
1503+ * Jussi Pakkanen <jussi.pakkanen@canonical.com>
1504+ *
1505+ * This program is free software: you can redistribute it and/or modify it
1506+ * under the terms of the GNU General Public License version 3, as published
1507+ * by the Free Software Foundation.
1508+ *
1509+ * This library is distributed in the hope that it will be useful, but WITHOUT
1510+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1511+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
1512+ * details.
1513+ *
1514+ * You should have received a copy of the GNU General Public License
1515+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1516+ */
1517+
1518+#ifndef OFONO_ACTIVATOR
1519+#define OFONO_ACTIVATOR
1520+
1521+#include <QObject>
1522+
1523+/**
1524+ * For exposing ofono controls to qml.
1525+ */
1526+
1527+class OfonoActivator : public QObject {
1528+ Q_OBJECT
1529+
1530+public:
1531+ OfonoActivator(QObject *parent = nullptr);
1532+ ~OfonoActivator() {};
1533+
1534+ Q_INVOKABLE bool activate(const QString ofonoContext, const QString imsi, const QString modemPath);
1535+
1536+private:
1537+};
1538+
1539+
1540+#endif
1541
1542=== modified file 'plugins/cellular/plugin.cpp'
1543--- plugins/cellular/plugin.cpp 2014-07-23 13:44:31 +0000
1544+++ plugins/cellular/plugin.cpp 2014-10-03 20:40:51 +0000
1545@@ -20,11 +20,13 @@
1546 #include <QtQml>
1547 #include <QtQml/QQmlContext>
1548 #include "hotspotmanager.h"
1549+#include "ofonoactivator.h"
1550
1551 void BackendPlugin::registerTypes(const char *uri)
1552 {
1553 Q_ASSERT(uri == QLatin1String("Ubuntu.SystemSettings.Cellular"));
1554 qmlRegisterType<HotspotManager>(uri, 1, 0, "HotspotManager");
1555+ qmlRegisterType<OfonoActivator>(uri, 1, 0, "OfonoActivator");
1556 }
1557
1558 void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
1559
1560=== modified file 'plugins/cellular/sims.js'
1561--- plugins/cellular/sims.js 2014-08-19 10:58:01 +0000
1562+++ plugins/cellular/sims.js 2014-10-03 20:40:51 +0000
1563@@ -13,6 +13,10 @@
1564 return getAll()[n];
1565 }
1566
1567+function getFirstPresent () {
1568+ return getPresent()[0];
1569+}
1570+
1571 function getCount () {
1572 return getAll().length;
1573 }
1574
1575=== modified file 'plugins/phone/PageComponent.qml'
1576--- plugins/phone/PageComponent.qml 2014-08-28 17:33:40 +0000
1577+++ plugins/phone/PageComponent.qml 2014-10-03 20:40:51 +0000
1578@@ -46,8 +46,9 @@
1579 State {
1580 name: "singleSim"
1581 StateChangeScript {
1582- script: loader.setSource("SingleSim.qml", { sim: Sims.get(0) })
1583-
1584+ script: loader.setSource("SingleSim.qml", {
1585+ sim: Sims.getFirstPresent()
1586+ })
1587 }
1588 when: simsLoaded && (Sims.getPresentCount() === 1)
1589 },
1590
1591=== modified file 'plugins/phone/sims.js'
1592--- plugins/phone/sims.js 2014-08-19 15:59:18 +0000
1593+++ plugins/phone/sims.js 2014-10-03 20:40:51 +0000
1594@@ -13,6 +13,10 @@
1595 return getAll()[n];
1596 }
1597
1598+function getFirstPresent () {
1599+ return getPresent()[0];
1600+}
1601+
1602 function getCount () {
1603 return getAll().length;
1604 }
1605
1606=== modified file 'tests/autopilot/ubuntu_system_settings/tests/__init__.py'
1607--- tests/autopilot/ubuntu_system_settings/tests/__init__.py 2014-09-26 12:52:31 +0000
1608+++ tests/autopilot/ubuntu_system_settings/tests/__init__.py 2014-10-03 20:40:51 +0000
1609@@ -110,7 +110,6 @@
1610 dbusmock.DBusTestCase):
1611 """Class for cellular tests which sets up an Ofono mock """
1612
1613- technology_preference = 'gsm'
1614 use_sims = 1
1615
1616 @property
1617@@ -183,11 +182,12 @@
1618 ]
1619 )
1620
1621- def mock_radio_settings(self, modem):
1622- modem.AddProperty(
1623- RDO_IFACE, 'TechnologyPreference', self.technology_preference)
1624- modem.AddProperty(
1625- RDO_IFACE, 'ModemTechnologies', ['gsm', 'umts', 'lte'])
1626+ def mock_radio_settings(self, modem, preference='gsm',
1627+ technologies=['gsm', 'umts', 'lte']):
1628+ modem.AddProperty(
1629+ RDO_IFACE, 'TechnologyPreference', preference)
1630+ modem.AddProperty(
1631+ RDO_IFACE, 'ModemTechnologies', technologies)
1632 modem.AddMethods(
1633 RDO_IFACE,
1634 [('GetProperties', '', 'a{sv}',
1635@@ -260,7 +260,7 @@
1636 self.get_all_operators(second_modem)),
1637 ])
1638 self.mock_carriers(second_modem)
1639- self.mock_radio_settings(self.modem_1)
1640+ self.mock_radio_settings(self.modem_1, technologies=['gsm'])
1641 self.mock_connection_manager(self.modem_1)
1642 self.mock_call_forwarding(self.modem_1)
1643 self.mock_call_settings(self.modem_1)
1644
1645=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_cellular.py'
1646--- tests/autopilot/ubuntu_system_settings/tests/test_cellular.py 2014-08-25 11:33:04 +0000
1647+++ tests/autopilot/ubuntu_system_settings/tests/test_cellular.py 2014-10-03 20:40:51 +0000
1648@@ -673,3 +673,16 @@
1649 self.assertThat(
1650 lambda: self.system_settings.main_view.select_single(
1651 objectName='singleSim'), raises(StateNotFoundError))
1652+
1653+ # regression test for 1375832
1654+ # tests that the second slot only exposes gsm, which
1655+ # the testdata indicates
1656+ def test_slot_two(self):
1657+ self.modem_0.EmitSignal(
1658+ SIM_IFACE,
1659+ 'PropertyChanged',
1660+ 'sv',
1661+ ['Present', 'False'])
1662+ self.select_preference(PREFERENCE_2G)
1663+ self.assertRaises(StateNotFoundError,
1664+ self.select_preference, PREFERENCE_UMTS)

Subscribers

People subscribed via source and target branches