Merge lp:~pete-woods/unity8/add-ethernet-item into lp:unity8

Proposed by Pete Woods on 2016-11-22
Status: Merged
Approved by: Marco Trevisan (Treviño) on 2016-11-30
Approved revision: 2707
Merged at revision: 2741
Proposed branch: lp:~pete-woods/unity8/add-ethernet-item
Merge into: lp:unity8
Diff against target: 80 lines (+28/-2)
2 files modified
qml/Panel/Indicators/MenuItemFactory.qml (+22/-1)
tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml (+6/-1)
To merge this branch: bzr merge lp:~pete-woods/unity8/add-ethernet-item
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve on 2016-12-06
Marco Trevisan (Treviño) 2016-11-28 Approve on 2016-11-30
Michał Sawicz 2016-11-22 Approve on 2016-11-30
Review via email: mp+311502@code.launchpad.net

Commit Message

MenuItemFactory: Add subtitle support to SwitchItem widget

Description of the Change

* Are there any related MPs required for this MP to build/function as expected? Please list.

 - https://code.launchpad.net/~pete-woods/ubuntu-settings-components/add-ethernet-item/+merge/311503
 - https://code.launchpad.net/~pete-woods/indicator-network/ethernet-support/+merge/311755

* Did you perform an exploratory manual test run of your code change and any related functionality?

Tested on laptop. Phone/tablet devices don't have ethernet support.

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

N/A

* If you changed the UI, has there been a design review?

Yes, implementation was carried out with design team oversight.

To post a comment you must log in.
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2704
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2564/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3376
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1939
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1939
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/1939
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3404
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3255
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3255/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3255
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3255/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3255
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3255/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3255
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3255/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3255
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3255/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3255
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3255/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3255
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3255/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3255
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3255/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3255
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3255/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2564/rebuild

review: Needs Fixing (continuous-integration)
Michał Sawicz (saviq) wrote :

Hey, please bump the ubuntu-settings-components dependency version after you bump the other.

I added a secret thing ;) to the description so it tests against the silo.

review: Needs Fixing
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2704
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2568/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/3380/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3408
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3259/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3259
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3259/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3259
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3259/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3259/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3259
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3259/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3259
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3259/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3259/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3259
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3259/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3259
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3259/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2568/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2706
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2573/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/3387/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3415
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3266/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3266/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3266/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3266/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3266
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3266/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3266
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3266/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3266/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3266/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3266/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2573/rebuild

review: Needs Fixing (continuous-integration)
Michał Sawicz (saviq) wrote :

Yup!

review: Abstain
2705. By Pete Woods on 2016-11-30

Add subtitle support to SwitchItem

Michał Sawicz (saviq) :
review: Needs Fixing
2706. By Pete Woods on 2016-11-30

Fix Saviq's review comments

2707. By Pete Woods on 2016-11-30

Reduce formatting noise

Michał Sawicz (saviq) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Y
 * Did CI run pass? If not, please explain why.
Waiting

review: Approve
Marco Trevisan (Treviño) (3v1n0) wrote :

Yeah, this is better to me.

Thanks.

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2707
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2644/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3476
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1998
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/1998
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3504
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3351
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3351/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3351
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3351/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3351
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3351/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3351
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3351/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3351
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3351/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3351
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3351/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2644/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2707
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2654/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3487
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2006
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2006
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3515
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3362
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3362/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3362
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3362/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3362
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3362/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3362
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3362/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3362
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3362/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3362
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3362/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2654/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2707
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2655/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3488
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2007
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2007
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3516
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3363
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3363/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3363
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3363/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3363
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3363/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3363
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3363/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3363
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3363/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3363
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3363/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2655/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Panel/Indicators/MenuItemFactory.qml'
2--- qml/Panel/Indicators/MenuItemFactory.qml 2016-11-16 10:44:00 +0000
3+++ qml/Panel/Indicators/MenuItemFactory.qml 2016-11-30 12:28:32 +0000
4@@ -106,7 +106,7 @@
5 }
6
7 if (component === undefined) {
8- console.debug("Don't know how to make " + modelData.type + " for " + indicator);
9+ console.debug("Don't know how to make " + type + " for " + indicator);
10 }
11
12 return component
13@@ -398,7 +398,9 @@
14 id: switchItem
15 objectName: "switchMenu"
16 property QtObject menuData: null
17+ property var menuModel: menuFactory.menuModel
18 property int menuIndex: -1
19+ property var extendedData: menuData && menuData.ext || undefined
20 property bool serverChecked: menuData && menuData.isToggled || false
21
22 text: menuData && menuData.label || ""
23@@ -407,6 +409,25 @@
24 checked: serverChecked
25 highlightWhenPressed: false
26
27+ property var subtitleAction: UnityMenuAction {
28+ model: menuModel
29+ index: menuIndex
30+ name: getExtendedProperty(extendedData, "xCanonicalSubtitleAction", "")
31+ }
32+ subtitle.text: subtitleAction.valid ? subtitleAction.state : ""
33+
34+ onMenuModelChanged: {
35+ loadAttributes();
36+ }
37+ onMenuIndexChanged: {
38+ loadAttributes();
39+ }
40+
41+ function loadAttributes() {
42+ if (!menuModel || menuIndex == -1) return;
43+ menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-subtitle-action': 'string'});
44+ }
45+
46 ServerPropertySynchroniser {
47 objectName: "sync"
48 syncTimeout: Utils.Constants.indicatorValueTimeout
49
50=== modified file 'tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml'
51--- tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml 2016-11-16 10:44:00 +0000
52+++ tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml 2016-11-30 12:28:32 +0000
53@@ -370,7 +370,8 @@
54 function test_create_switchMenu_data() {
55 return [
56 {label: "testLabel1", enabled: true, checked: false, icon: "file:///testIcon1" },
57- {label: "testLabel2", enabled: false, checked: true, icon: "file:///testIcon2" },
58+ {label: "testLabel2", enabled: false, checked: true, icon: "file:///testIcon2", subtitleAction: "action::subtitle1" },
59+ {label: "testLabel2", enabled: false, checked: true, icon: "file:///testIcon3", subtitleAction: "action::subtitle2" },
60 ];
61 }
62
63@@ -380,6 +381,9 @@
64 menuData.sensitive = data.enabled;
65 menuData.icon = data.icon;
66 menuData.isToggled = data.checked;
67+ menuData.ext = {
68+ 'xCanonicalSubtitleAction': data.subtitleAction,
69+ };
70
71 loader.data = menuData;
72 loader.sourceComponent = factory.load(menuData);
73@@ -390,6 +394,7 @@
74 compare(loader.item.iconSource, data.icon, "Icon does not match data");
75 compare(loader.item.checked, data.checked, "Checked does not match data");
76 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
77+ compare(loader.item.subtitleAction.name, data.subtitleAction === undefined ? "" : data.subtitleAction, "Subtitle action does not match data");
78 }
79
80 function test_create_alarmMenu_data() {

Subscribers

People subscribed via source and target branches