Merge lp:~jonas-drange/ubuntu-system-settings/about-dynamic-imei-fixes-1205294 into lp:ubuntu-system-settings

Proposed by Jonas G. Drange
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 1211
Merged at revision: 1228
Proposed branch: lp:~jonas-drange/ubuntu-system-settings/about-dynamic-imei-fixes-1205294
Merge into: lp:ubuntu-system-settings
Diff against target: 64 lines (+19/-10)
2 files modified
plugins/about/PageComponent.qml (+19/-3)
tests/autopilot/ubuntu_system_settings/tests/test_about.py (+0/-7)
To merge this branch: bzr merge lp:~jonas-drange/ubuntu-system-settings/about-dynamic-imei-fixes-1205294
Reviewer Review Type Date Requested Status
Sebastien Bacher (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+241977@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

Shows multiple IMEIs in a multivalue list according to spec [1].

I have removed the test that has become redundant by doing this.

[1] https://wiki.ubuntu.com/AboutThisDevice#phone

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, is the gsettings/simnames snippet part of that changeset or some other work? It doesn't seme required for emei display...

Otherwise looks fine, might be better to only have 2 items though? The first one could have "visible: length <= 1" and "value: length = 1 ? imei : "none""

The second point is not a blocker, mostly a matter of taste so feel free to keep your version

review: Needs Information
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

Thanks @seb128, that was indeed part of an older version where SIM names appeared before the relevant IMEI. After talking to mpt, this was changed to no mention of SIM names, which makes more sense.

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

Thanks, small nitpick

> value: modemsSorted.length ? (imeiNumber || i18n.tr("None"))

the (imeiNumber || i18n.tr("None")) doesn't seem an obvious syntax to me, what would think of using
"value (modemsSorted.length && imeiNumber) ? imeiNumber : i18n.tr("None"))"
instead?

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
Sebastien Bacher (seb128) wrote :

Looks fine to me, but do you have any clue with those CI tests are failing?

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
Sebastien Bacher (seb128) wrote :

The tests failing is issues with the CI machines, the changes look good so let's approve it

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 2014-10-31 14:53:32 +0000
3+++ plugins/about/PageComponent.qml 2014-11-19 12:03:52 +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@@ -117,8 +118,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/tests/test_about.py'
49--- tests/autopilot/ubuntu_system_settings/tests/test_about.py 2014-09-03 14:48:02 +0000
50+++ tests/autopilot/ubuntu_system_settings/tests/test_about.py 2014-11-19 12:03:52 +0000
51@@ -132,13 +132,6 @@
52 displayed_imei = self.about_page.get_imei()
53 self.assertThat(displayed_imei, Equals(device_imei))
54
55- def test_device_without_imei_must_not_display_it(self):
56- device_imei = self._get_imei_from_dbus()
57- if device_imei:
58- self.skipTest('The device has imei.')
59- else:
60- self.assertFalse(self.about_page.is_imei_visible())
61-
62 def test_phone_number(self):
63 number = self.system_settings.main_view.about_page.select_single(
64 objectName="numberItem"

Subscribers

People subscribed via source and target branches