Merge lp:~ken-vandine/ubuntu-system-settings/rtm-lp1205294 into lp:ubuntu-system-settings/rtm-14.09

Proposed by Ken VanDine
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 965
Merged at revision: 981
Proposed branch: lp:~ken-vandine/ubuntu-system-settings/rtm-lp1205294
Merge into: lp:ubuntu-system-settings/rtm-14.09
Diff against target: 77 lines (+20/-11)
3 files modified
plugins/about/PageComponent.qml (+19/-3)
tests/autopilot/ubuntu_system_settings/__init__.py (+1/-1)
tests/autopilot/ubuntu_system_settings/tests/test_about.py (+0/-7)
To merge this branch: bzr merge lp:~ken-vandine/ubuntu-system-settings/rtm-lp1205294
Reviewer Review Type Date Requested Status
Sebastien Bacher (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+246727@code.launchpad.net

Commit message

[about] properly display IMEI values for no devices ("None"), one device and multiple devices. Remove test now redundant.

Description of the change

[about] properly display IMEI values for no devices ("None"), one device and multiple devices. Remove test now redundant.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Looks fine to me, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/about/PageComponent.qml'
2--- plugins/about/PageComponent.qml 2015-01-09 13:10:56 +0000
3+++ plugins/about/PageComponent.qml 2015-01-16 15:29:27 +0000
4@@ -33,6 +33,7 @@
5
6 title: i18n.tr("About this phone")
7 flickable: scrollWidget
8+ property var modemsSorted: manager.modems.slice(0).sort()
9
10 UbuntuStorageAboutPanel {
11 id: backendInfos
12@@ -52,7 +53,7 @@
13 if (manager.modems.length === 1) {
14 phoneNumbers.setSource("PhoneNumber.qml", {path: manager.modems[0]})
15 } else if (manager.modems.length > 1) {
16- phoneNumbers.setSource("PhoneNumbers.qml", {paths: manager.modems.slice(0).sort()})
17+ phoneNumbers.setSource("PhoneNumbers.qml", {paths: modemsSorted})
18 }
19 }
20 }
21@@ -121,8 +122,23 @@
22 property string imeiNumber
23 imeiNumber: deviceInfos.imei(0)
24 text: "IMEI"
25- value: imeiNumber
26- visible: imeiNumber
27+ value: modemsSorted.length ? (imeiNumber || i18n.tr("None")) :
28+ i18n.tr("None")
29+ visible: modemsSorted.length <= 1
30+ }
31+
32+ ListItem.MultiValue {
33+ text: "IMEI"
34+ objectName: "imeiItems"
35+ values: {
36+ var imeis = [];
37+ modemsSorted.forEach(function (path, i) {
38+ var imei = deviceInfos.imei(i);
39+ imei ? imeis.push(imei) : imeis.push(i18n.tr("None"));
40+ });
41+ return imeis;
42+ }
43+ visible: modemsSorted.length > 1
44 }
45
46 ListItem.SingleValue {
47
48=== modified file 'tests/autopilot/ubuntu_system_settings/__init__.py'
49--- tests/autopilot/ubuntu_system_settings/__init__.py 2015-01-13 19:46:25 +0000
50+++ tests/autopilot/ubuntu_system_settings/__init__.py 2015-01-16 15:29:27 +0000
51@@ -407,7 +407,7 @@
52 @classmethod
53 def validate_dbus_object(cls, path, state):
54 name = introspection.get_classname_from_path(path)
55- if name == b'ItemPage':
56+ if name == b'PageComponent':
57 if state['objectName'][1] == 'aboutPage':
58 return True
59 return False
60
61=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_about.py'
62--- tests/autopilot/ubuntu_system_settings/tests/test_about.py 2015-01-12 16:22:55 +0000
63+++ tests/autopilot/ubuntu_system_settings/tests/test_about.py 2015-01-16 15:29:27 +0000
64@@ -132,13 +132,6 @@
65 displayed_imei = self.about_page.get_imei()
66 self.assertThat(displayed_imei, Equals(device_imei))
67
68- def test_device_without_imei_must_not_display_it(self):
69- device_imei = self._get_imei_from_dbus()
70- if device_imei:
71- self.skipTest('The device has imei.')
72- else:
73- self.assertFalse(self.about_page.is_imei_visible())
74-
75 def test_phone_number(self):
76 self.assertEqual(str(self.about_page.get_number('numberItem')),
77 '123456789')

Subscribers

People subscribed via source and target branches