Merge lp:~larsu/unity8/per-profile-indicator-positions into lp:unity8
- per-profile-indicator-positions
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | MichaĆ Sawicz |
Approved revision: | 415 |
Merged at revision: | 548 |
Proposed branch: | lp:~larsu/unity8/per-profile-indicator-positions |
Merge into: | lp:unity8 |
Diff against target: |
135 lines (+18/-28) 6 files modified
Panel/Indicators/client/IndicatorsTree.qml (+2/-3) plugins/Unity/Indicators/indicator.cpp (+8/-16) plugins/Unity/Indicators/indicator.h (+1/-1) plugins/Unity/Indicators/indicatorsmanager.cpp (+3/-1) plugins/Unity/Indicators/qml/IndicatorBase.qml (+3/-4) tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp (+1/-3) |
To merge this branch: | bzr merge lp:~larsu/unity8/per-profile-indicator-positions |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Nick Dedekind (community) | Approve | ||
Review via email: mp+190472@code.launchpad.net |
Commit message
Allow setting different indicator positions for different profiles
Description of the change
Allow setting different indicator positions for different profiles
The order of the indicators is different on the phone [1] and on the desktop [2].
[1] https:/
[2] https:/
PS Jenkins bot (ps-jenkins) wrote : | # |
Nick Dedekind (nick-dedekind) wrote : | # |
menuObjectPaths is used by IndicatorBase in the Indicators plugin to get the path. It's implicitly set by iterating over all the properties in the map.
I have a feeling we may need to support multiple profiles in the shell ("greeter" vs "phone") at some point. Maybe the profile should be a property on the IndicatorsModel.
But I guess this is OK for now, as long as the IndicatorBase issue is fixed.
Nick Dedekind (nick-dedekind) : | # |
Nick Dedekind (nick-dedekind) wrote : | # |
> menuObjectPaths is used by IndicatorBase in the Indicators plugin to get the
> path. It's implicitly set by iterating over all the properties in the map.
>
> I have a feeling we may need to support multiple profiles in the shell
> ("greeter" vs "phone") at some point. Maybe the profile should be a property
> on the IndicatorsModel.
> But I guess this is OK for now, as long as the IndicatorBase issue is fixed.
my bad. i'm blind
Lars Karlitski (larsu) wrote : | # |
Thanks for having a look. I fixed that place and also the test.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:415
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
UNSTABLE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
None: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'Panel/Indicators/client/IndicatorsTree.qml' |
2 | --- Panel/Indicators/client/IndicatorsTree.qml 2013-10-02 09:38:06 +0000 |
3 | +++ Panel/Indicators/client/IndicatorsTree.qml 2013-10-11 20:22:29 +0000 |
4 | @@ -29,10 +29,9 @@ |
5 | |
6 | property string busName: unityModel.busName |
7 | property string actionsObjectPath |
8 | - property var menuObjectPaths: undefined |
9 | - readonly property string device: "phone" |
10 | + property string menuObjectPath |
11 | |
12 | - property string deviceMenuObjectPath: menuObjectPaths.hasOwnProperty(device) ? menuObjectPaths[device] : "" |
13 | + property string deviceMenuObjectPath: menuObjectPath |
14 | |
15 | function start() { |
16 | } |
17 | |
18 | === modified file 'plugins/Unity/Indicators/indicator.cpp' |
19 | --- plugins/Unity/Indicators/indicator.cpp 2013-09-02 07:39:53 +0000 |
20 | +++ plugins/Unity/Indicators/indicator.cpp 2013-10-11 20:22:29 +0000 |
21 | @@ -31,32 +31,24 @@ |
22 | { |
23 | } |
24 | |
25 | -void Indicator::init(const QString& busName, const QSettings& settings) |
26 | +void Indicator::init(const QString &profile, const QString& busName, const QSettings& settings) |
27 | { |
28 | setId(settings.value("Indicator Service/Name").toString()); |
29 | - setPosition(settings.value("Indicator Service/Position", QVariant::fromValue(0)).toInt()); |
30 | + |
31 | + QVariant pos = settings.value(profile + "/Position"); |
32 | + if (!pos.isValid()) |
33 | + pos = settings.value("Indicator Service/Position", QVariant::fromValue(0)); |
34 | + setPosition(pos.toInt()); |
35 | |
36 | QString actionObjectPath = settings.value("Indicator Service/ObjectPath").toString(); |
37 | - |
38 | - QVariantMap mapMenuObjectPaths; |
39 | - Q_FOREACH(const QString& childGroup, settings.childGroups()) |
40 | - { |
41 | - if (childGroup == "Indicator Service") |
42 | - continue; |
43 | - |
44 | - QString menuPath = childGroup+"/ObjectPath"; |
45 | - if (settings.contains(menuPath)) |
46 | - { |
47 | - mapMenuObjectPaths[childGroup] = settings.value(menuPath).toString(); |
48 | - } |
49 | - } |
50 | + QString menuObjectPath = settings.value(profile + "/ObjectPath").toString(); |
51 | |
52 | QVariantMap properties; |
53 | properties.clear(); |
54 | properties.insert("busType", 1); |
55 | properties.insert("busName", busName); |
56 | properties.insert("actionsObjectPath", actionObjectPath); |
57 | - properties.insert("menuObjectPaths", mapMenuObjectPaths); |
58 | + properties.insert("menuObjectPath", menuObjectPath); |
59 | setIndicatorProperties(properties); |
60 | } |
61 | |
62 | |
63 | === modified file 'plugins/Unity/Indicators/indicator.h' |
64 | --- plugins/Unity/Indicators/indicator.h 2013-09-02 07:39:53 +0000 |
65 | +++ plugins/Unity/Indicators/indicator.h 2013-10-11 20:22:29 +0000 |
66 | @@ -35,7 +35,7 @@ |
67 | Indicator(QObject *parent = 0); |
68 | virtual ~Indicator(); |
69 | |
70 | - void init(const QString& busName, const QSettings& settings); |
71 | + void init(const QString &profile, const QString& busName, const QSettings& settings); |
72 | |
73 | QString identifier() const; |
74 | int position() const; |
75 | |
76 | === modified file 'plugins/Unity/Indicators/indicatorsmanager.cpp' |
77 | --- plugins/Unity/Indicators/indicatorsmanager.cpp 2013-10-10 18:00:54 +0000 |
78 | +++ plugins/Unity/Indicators/indicatorsmanager.cpp 2013-10-11 20:22:29 +0000 |
79 | @@ -26,6 +26,8 @@ |
80 | |
81 | #include "paths.h" |
82 | |
83 | +const QString profile = "phone"; |
84 | + |
85 | |
86 | class IndicatorsManager::IndicatorData |
87 | { |
88 | @@ -298,7 +300,7 @@ |
89 | Indicator::Ptr new_indicator(new Indicator(this)); |
90 | data->m_indicator = new_indicator; |
91 | QSettings settings(data->m_fileInfo.absoluteFilePath(), QSettings::IniFormat, this); |
92 | - new_indicator->init(data->m_fileInfo.fileName(), settings); |
93 | + new_indicator->init(profile, data->m_fileInfo.fileName(), settings); |
94 | return new_indicator; |
95 | } |
96 | |
97 | |
98 | === modified file 'plugins/Unity/Indicators/qml/IndicatorBase.qml' |
99 | --- plugins/Unity/Indicators/qml/IndicatorBase.qml 2013-09-30 16:37:55 +0000 |
100 | +++ plugins/Unity/Indicators/qml/IndicatorBase.qml 2013-10-11 20:22:29 +0000 |
101 | @@ -24,16 +24,15 @@ |
102 | Item { |
103 | id: indicatorItem |
104 | |
105 | - enabled: menuObjectPaths.hasOwnProperty(device) |
106 | + enabled: menuObjectPath != "" |
107 | |
108 | //const |
109 | property string busName |
110 | property string actionsObjectPath |
111 | - property var menuObjectPaths: undefined |
112 | - readonly property string device: "phone" |
113 | + property string menuObjectPath |
114 | property string rootMenuType: "com.canonical.indicator.root" |
115 | |
116 | - property string deviceMenuObjectPath: menuObjectPaths.hasOwnProperty(device) ? menuObjectPaths[device] : "" |
117 | + property string deviceMenuObjectPath: menuObjectPath |
118 | |
119 | property alias menuModel: cachedModel.model |
120 | |
121 | |
122 | === modified file 'tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp' |
123 | --- tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp 2013-08-14 09:07:45 +0000 |
124 | +++ tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp 2013-10-11 20:22:29 +0000 |
125 | @@ -80,9 +80,7 @@ |
126 | QCOMPARE(props["busName"].toString(), QString("com.canonical.indicator.fake1")); |
127 | QCOMPARE(props["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake1")); |
128 | |
129 | - QVariantMap objectPaths = props["menuObjectPaths"].toMap(); |
130 | - QCOMPARE(objectPaths["phone"].toString(), QString("/com/canonical/indicator/fake1/phone")); |
131 | - QCOMPARE(objectPaths["desktop"].toString(), QString("/com/canonical/indicator/fake1/desktop")); |
132 | + QCOMPARE(props["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake1/phone")); |
133 | } |
134 | |
135 | /* |
FAILED: Continuous integration, rev:413 jenkins. qa.ubuntu. com/job/ unity8- ci/1357/ jenkins. qa.ubuntu. com/job/ generic- mediumtests- saucy/4922/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- touch/2803/ console jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- saucy/2223/ console jenkins. qa.ubuntu. com/job/ unity8- saucy-amd64- ci/380/ console jenkins. qa.ubuntu. com/job/ unity8- saucy-armhf- ci/1357/ console jenkins. qa.ubuntu. com/job/ unity8- saucy-i386- ci/1356/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-amd64/ 797/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-armhf/ 2805/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: 10.97.0. 26:8080/ job/unity8- ci/1357/ rebuild
http://