Merge lp:~macslow/unity8/use-set-progress-api into lp:unity8
- use-set-progress-api
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Michael Zanetti |
Approved revision: | 1848 |
Merged at revision: | 1888 |
Proposed branch: | lp:~macslow/unity8/use-set-progress-api |
Merge into: | lp:unity8 |
Prerequisite: | lp:~macslow/unity8/launcher-icon-wobble |
Diff against target: |
427 lines (+125/-43) 17 files modified
plugins/Greeter/Unity/Launcher/launchermodelas.cpp (+22/-12) plugins/Unity/Launcher/asadapter.cpp (+1/-0) plugins/Unity/Launcher/dbusinterface.cpp (+16/-4) plugins/Unity/Launcher/dbusinterface.h (+1/-0) plugins/Unity/Launcher/launchermodel.cpp (+1/-0) qml/Launcher/LauncherDelegate.qml (+14/-14) qml/Launcher/graphics/progressbar-fill@30.sci (+0/-5) qml/Launcher/graphics/progressbar-trough@30.sci (+0/-5) tests/mocks/Unity/Launcher/MockLauncherModel.cpp (+10/-0) tests/mocks/Unity/Launcher/MockLauncherModel.h (+1/-0) tests/plugins/Greeter/Unity/Launcher/launchermodelastest.cpp (+3/-0) tests/qmltests/Launcher/tst_Launcher.qml (+40/-3) tests/scripts/README (+4/-0) tests/scripts/get-progress.sh (+3/-0) tests/scripts/set-count-visible.sh (+3/-0) tests/scripts/set-count.sh (+3/-0) tests/scripts/set-progress.sh (+3/-0) |
To merge this branch: | bzr merge lp:~macslow/unity8/use-set-progress-api |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Michael Zanetti (community) | Approve | ||
Lukáš Tinkl | Pending | ||
Nick Dedekind | Pending | ||
Review via email: mp+265639@code.launchpad.net |
This proposal supersedes a proposal from 2015-06-19.
Commit message
Added corresponding tests and visual tweaks to a launcher-item's progress-overlay.
Description of the change
Added corresponding tests and visual tweaks to a launcher-item's progress-overlay.
For the reviewers convenience here's a screencast of the branch in action on a device: https:/
* Are there any related MPs required for this MP to build/function as expected? Please list.
Yes. lp:~macslow/unity8/launcher-icon-wobble needs to be landed in unity8 first.
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes.
* Did you make sure that your branch does not contain spurious tags?
Yes.
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Not applicable.
* If you changed the UI, has there been a design review?
Yes.
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1824
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1826
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1827
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal | # |
As I commented on the related unity-api branch, I don't think we need to define an API for that. Unity8 itself doesn't ever set the progress.
* You can then completely revert the change in launchermodeas.
* I haven't tested it yet, but reading through the code it seems you didn't wire up the Set method on D-Bus.
* in asadapter.cpp you need to sync the progress value to AS too.
* in launchermodelas.cpp you need to read the change from AS and set that to the LauncherItems
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1828
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1829
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1831
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1831
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1832
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Lukáš Tinkl (lukas-kde) wrote : Posted in a previous version of this proposal | # |
See inline comments
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1833
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1834
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1835
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1836
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
Small comment, otherwise code looks
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
Having a "progressVisible" property only for the test is a bit of overkill. Can you go in on the "progressOverlay" named object with findChild and change visibility.
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
*check visiblilty
Mirco Müller (macslow) wrote : Posted in a previous version of this proposal | # |
> Having a "progressVisible" property only for the test is a bit of overkill.
> Can you go in on the "progressOverlay" named object with findChild and change
> visibility.
This and inline comment addressed with r1837.
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1837
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Lukáš Tinkl (lukas-kde) wrote : Posted in a previous version of this proposal | # |
Approving, looks good now
* Are there any related MPs required for this MP to build/function as expected? Please list.
No
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* Did you make sure that your branch does not contain spurious tags?
Yes
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Yes
* If you changed the UI, has there been a design review?
Yes
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal | # |
> * Did you perform an exploratory manual test run of your code change and any related functionality?
> Yes.
So you did that? Both? How come it doesn't work then?
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1838
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1839
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1840
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1841
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1842
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1842
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1843
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1844
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1845
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1845
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal | # |
"progress" doesn't show up in introspection:
# qdbus com.canonical.Unity /com/canonical/
property readwrite int com.canonical.
property readwrite bool com.canonical.
signal void org.freedesktop
method QDBusVariant org.freedesktop
method QVariantMap org.freedesktop
method void org.freedesktop
method QString org.freedesktop
method QString org.freedesktop
method void org.freedesktop
====
There are some minor inline comments
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal | # |
* Did you perform an exploratory manual test run of the code change and any related functionality?
yes
* Did CI run pass? If not, please explain why.
as much as it could
* Did you make sure that the branch does not contain spurious tags?
yes
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1846
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michael Zanetti (mzanetti) wrote : | # |
reapproving as per superseded MP
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1848
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1849. By Mirco Müller
-
Merged again with launcher-
icon-wobble branch. - 1850. By Mirco Müller
-
Fixed alertViaCountAn
dCountVisible qmltest. - 1851. By Mirco Müller
-
Sorted out another issue with alertViaCountAn
dCountVisible qmltest.
Preview Diff
1 | === modified file 'plugins/Greeter/Unity/Launcher/launchermodelas.cpp' | |||
2 | --- plugins/Greeter/Unity/Launcher/launchermodelas.cpp 2015-07-25 13:57:22 +0000 | |||
3 | +++ plugins/Greeter/Unity/Launcher/launchermodelas.cpp 2015-07-25 13:57:22 +0000 | |||
4 | @@ -207,16 +207,24 @@ | |||
5 | 207 | Q_FOREACH (LauncherItem* item, m_list) { | 207 | Q_FOREACH (LauncherItem* item, m_list) { |
6 | 208 | bool found = false; | 208 | bool found = false; |
7 | 209 | Q_FOREACH(const QVariant &asItem, items) { | 209 | Q_FOREACH(const QVariant &asItem, items) { |
9 | 210 | if (asItem.toMap().value("id").toString() == item->appId()) { | 210 | QVariantMap cachedMap = asItem.toMap(); |
10 | 211 | if (cachedMap.value("id").toString() == item->appId()) { | ||
11 | 211 | // Only keep and update it if we either show unpinned or it is pinned | 212 | // Only keep and update it if we either show unpinned or it is pinned |
13 | 212 | if (!m_onlyPinned || asItem.toMap().value("pinned").toBool()) { | 213 | if (!m_onlyPinned || cachedMap.value("pinned").toBool()) { |
14 | 213 | found = true; | 214 | found = true; |
19 | 214 | item->setName(asItem.toMap().value("name").toString()); | 215 | item->setName(cachedMap.value("name").toString()); |
20 | 215 | item->setIcon(asItem.toMap().value("icon").toString()); | 216 | item->setIcon(cachedMap.value("icon").toString()); |
21 | 216 | item->setCount(asItem.toMap().value("count").toInt()); | 217 | item->setCount(cachedMap.value("count").toInt()); |
22 | 217 | item->setCountVisible(asItem.toMap().value("countVisible").toBool()); | 218 | item->setCountVisible(cachedMap.value("countVisible").toBool()); |
23 | 219 | item->setProgress(cachedMap.value("progress").toInt()); | ||
24 | 218 | int idx = m_list.indexOf(item); | 220 | int idx = m_list.indexOf(item); |
26 | 219 | Q_EMIT dataChanged(index(idx), index(idx), QVector<int>() << RoleName << RoleIcon); | 221 | Q_EMIT dataChanged(index(idx), |
27 | 222 | index(idx), | ||
28 | 223 | {RoleName, | ||
29 | 224 | RoleIcon, | ||
30 | 225 | RoleCount, | ||
31 | 226 | RoleCountVisible, | ||
32 | 227 | RoleProgress}); | ||
33 | 220 | } | 228 | } |
34 | 221 | break; | 229 | break; |
35 | 222 | } | 230 | } |
36 | @@ -254,14 +262,16 @@ | |||
37 | 254 | } | 262 | } |
38 | 255 | 263 | ||
39 | 256 | if (itemIndex == -1) { | 264 | if (itemIndex == -1) { |
40 | 265 | QVariantMap chachedMap = entry.toMap(); | ||
41 | 257 | // Need to add it. Just add it into the addedIndex to keep same ordering as the list in AS. | 266 | // Need to add it. Just add it into the addedIndex to keep same ordering as the list in AS. |
45 | 258 | LauncherItem *item = new LauncherItem(entry.toMap().value("id").toString(), | 267 | LauncherItem *item = new LauncherItem(chachedMap.value("id").toString(), |
46 | 259 | entry.toMap().value("name").toString(), | 268 | chachedMap.value("name").toString(), |
47 | 260 | entry.toMap().value("icon").toString(), | 269 | chachedMap.value("icon").toString(), |
48 | 261 | this); | 270 | this); |
49 | 262 | item->setPinned(true); | 271 | item->setPinned(true); |
52 | 263 | item->setCount(entry.toMap().value("count").toInt()); | 272 | item->setCount(chachedMap.value("count").toInt()); |
53 | 264 | item->setCountVisible(entry.toMap().value("countVisible").toBool()); | 273 | item->setCountVisible(chachedMap.value("countVisible").toBool()); |
54 | 274 | item->setProgress(chachedMap.value("progress").toInt()); | ||
55 | 265 | beginInsertRows(QModelIndex(), newPosition, newPosition); | 275 | beginInsertRows(QModelIndex(), newPosition, newPosition); |
56 | 266 | m_list.insert(newPosition, item); | 276 | m_list.insert(newPosition, item); |
57 | 267 | endInsertRows(); | 277 | endInsertRows(); |
58 | 268 | 278 | ||
59 | === modified file 'plugins/Unity/Launcher/asadapter.cpp' | |||
60 | --- plugins/Unity/Launcher/asadapter.cpp 2015-02-11 14:13:26 +0000 | |||
61 | +++ plugins/Unity/Launcher/asadapter.cpp 2015-07-25 13:57:22 +0000 | |||
62 | @@ -56,5 +56,6 @@ | |||
63 | 56 | details.insert("count", item->count()); | 56 | details.insert("count", item->count()); |
64 | 57 | details.insert("countVisible", item->countVisible()); | 57 | details.insert("countVisible", item->countVisible()); |
65 | 58 | details.insert("pinned", item->pinned()); | 58 | details.insert("pinned", item->pinned()); |
66 | 59 | details.insert("progress", item->progress()); | ||
67 | 59 | return details; | 60 | return details; |
68 | 60 | } | 61 | } |
69 | 61 | 62 | ||
70 | === modified file 'plugins/Unity/Launcher/dbusinterface.cpp' | |||
71 | --- plugins/Unity/Launcher/dbusinterface.cpp 2015-07-25 13:57:22 +0000 | |||
72 | +++ plugins/Unity/Launcher/dbusinterface.cpp 2015-07-25 13:57:22 +0000 | |||
73 | @@ -62,6 +62,7 @@ | |||
74 | 62 | "<interface name=\"com.canonical.Unity.Launcher.Item\">" | 62 | "<interface name=\"com.canonical.Unity.Launcher.Item\">" |
75 | 63 | "<property name=\"count\" type=\"i\" access=\"readwrite\" />" | 63 | "<property name=\"count\" type=\"i\" access=\"readwrite\" />" |
76 | 64 | "<property name=\"countVisible\" type=\"b\" access=\"readwrite\" />" | 64 | "<property name=\"countVisible\" type=\"b\" access=\"readwrite\" />" |
77 | 65 | "<property name=\"progress\" type=\"i\" access=\"readwrite\" />" | ||
78 | 65 | "<method name=\"Alert\" />" | 66 | "<method name=\"Alert\" />" |
79 | 66 | "</interface>"; | 67 | "</interface>"; |
80 | 67 | return nodeiface; | 68 | return nodeiface; |
81 | @@ -175,33 +176,44 @@ | |||
82 | 175 | 176 | ||
83 | 176 | QVariantList retval; | 177 | QVariantList retval; |
84 | 177 | if (message.member() == "Get") { | 178 | if (message.member() == "Get") { |
85 | 179 | QString cachedString = message.arguments()[1].toString(); | ||
86 | 178 | if (!item) { | 180 | if (!item) { |
87 | 179 | return false; | 181 | return false; |
88 | 180 | } | 182 | } |
90 | 181 | if (message.arguments()[1].toString() == "count") { | 183 | if (cachedString == "count") { |
91 | 182 | retval.append(QVariant::fromValue(QDBusVariant(item->count()))); | 184 | retval.append(QVariant::fromValue(QDBusVariant(item->count()))); |
93 | 183 | } else if (message.arguments()[1].toString() == "countVisible") { | 185 | } else if (cachedString == "countVisible") { |
94 | 184 | retval.append(QVariant::fromValue(QDBusVariant(item->countVisible()))); | 186 | retval.append(QVariant::fromValue(QDBusVariant(item->countVisible()))); |
95 | 187 | } else if (cachedString == "progress") { | ||
96 | 188 | retval.append(QVariant::fromValue(QDBusVariant(item->progress()))); | ||
97 | 185 | } | 189 | } |
98 | 186 | } else if (message.member() == "Set") { | 190 | } else if (message.member() == "Set") { |
100 | 187 | if (message.arguments()[1].toString() == "count") { | 191 | QString cachedString = message.arguments()[1].toString(); |
101 | 192 | if (cachedString == "count") { | ||
102 | 188 | int newCount = message.arguments()[2].value<QDBusVariant>().variant().toInt(); | 193 | int newCount = message.arguments()[2].value<QDBusVariant>().variant().toInt(); |
103 | 189 | if (!item || newCount != item->count()) { | 194 | if (!item || newCount != item->count()) { |
104 | 190 | Q_EMIT countChanged(appid, newCount); | 195 | Q_EMIT countChanged(appid, newCount); |
105 | 191 | notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "count", QVariant(newCount)); | 196 | notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "count", QVariant(newCount)); |
106 | 192 | } | 197 | } |
108 | 193 | } else if (message.arguments()[1].toString() == "countVisible") { | 198 | } else if (cachedString == "countVisible") { |
109 | 194 | bool newVisible = message.arguments()[2].value<QDBusVariant>().variant().toBool(); | 199 | bool newVisible = message.arguments()[2].value<QDBusVariant>().variant().toBool(); |
110 | 195 | if (!item || newVisible != item->countVisible()) { | 200 | if (!item || newVisible != item->countVisible()) { |
111 | 196 | Q_EMIT countVisibleChanged(appid, newVisible); | 201 | Q_EMIT countVisibleChanged(appid, newVisible); |
112 | 197 | notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "countVisible", newVisible); | 202 | notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "countVisible", newVisible); |
113 | 198 | } | 203 | } |
114 | 204 | } else if (cachedString == "progress") { | ||
115 | 205 | int newProgress = message.arguments()[2].value<QDBusVariant>().variant().toInt(); | ||
116 | 206 | if (!item || newProgress != item->progress()) { | ||
117 | 207 | Q_EMIT progressChanged(appid, newProgress); | ||
118 | 208 | notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "progress", QVariant(newProgress)); | ||
119 | 209 | } | ||
120 | 199 | } | 210 | } |
121 | 200 | } else if (message.member() == "GetAll") { | 211 | } else if (message.member() == "GetAll") { |
122 | 201 | if (item) { | 212 | if (item) { |
123 | 202 | QVariantMap all; | 213 | QVariantMap all; |
124 | 203 | all.insert("count", item->count()); | 214 | all.insert("count", item->count()); |
125 | 204 | all.insert("countVisible", item->countVisible()); | 215 | all.insert("countVisible", item->countVisible()); |
126 | 216 | all.insert("progress", item->progress()); | ||
127 | 205 | retval.append(all); | 217 | retval.append(all); |
128 | 206 | } | 218 | } |
129 | 207 | } else { | 219 | } else { |
130 | 208 | 220 | ||
131 | === modified file 'plugins/Unity/Launcher/dbusinterface.h' | |||
132 | --- plugins/Unity/Launcher/dbusinterface.h 2015-07-25 13:57:22 +0000 | |||
133 | +++ plugins/Unity/Launcher/dbusinterface.h 2015-07-25 13:57:22 +0000 | |||
134 | @@ -36,6 +36,7 @@ | |||
135 | 36 | Q_SIGNALS: | 36 | Q_SIGNALS: |
136 | 37 | void countChanged(const QString &appId, int count); | 37 | void countChanged(const QString &appId, int count); |
137 | 38 | void countVisibleChanged(const QString &appId, bool countVisible); | 38 | void countVisibleChanged(const QString &appId, bool countVisible); |
138 | 39 | void progressChanged(const QString &appId, int progress); | ||
139 | 39 | void refreshCalled(); | 40 | void refreshCalled(); |
140 | 40 | void alertCalled(const QString &appId); | 41 | void alertCalled(const QString &appId); |
141 | 41 | 42 | ||
142 | 42 | 43 | ||
143 | === modified file 'plugins/Unity/Launcher/launchermodel.cpp' | |||
144 | --- plugins/Unity/Launcher/launchermodel.cpp 2015-07-25 13:57:22 +0000 | |||
145 | +++ plugins/Unity/Launcher/launchermodel.cpp 2015-07-25 13:57:22 +0000 | |||
146 | @@ -40,6 +40,7 @@ | |||
147 | 40 | { | 40 | { |
148 | 41 | connect(m_dbusIface, &DBusInterface::countChanged, this, &LauncherModel::countChanged); | 41 | connect(m_dbusIface, &DBusInterface::countChanged, this, &LauncherModel::countChanged); |
149 | 42 | connect(m_dbusIface, &DBusInterface::countVisibleChanged, this, &LauncherModel::countVisibleChanged); | 42 | connect(m_dbusIface, &DBusInterface::countVisibleChanged, this, &LauncherModel::countVisibleChanged); |
150 | 43 | connect(m_dbusIface, &DBusInterface::progressChanged, this, &LauncherModel::progressChanged); | ||
151 | 43 | connect(m_dbusIface, &DBusInterface::refreshCalled, this, &LauncherModel::refresh); | 44 | connect(m_dbusIface, &DBusInterface::refreshCalled, this, &LauncherModel::refresh); |
152 | 44 | connect(m_dbusIface, &DBusInterface::alertCalled, this, &LauncherModel::alert); | 45 | connect(m_dbusIface, &DBusInterface::alertCalled, this, &LauncherModel::alert); |
153 | 45 | 46 | ||
154 | 46 | 47 | ||
155 | === modified file 'qml/Launcher/LauncherDelegate.qml' | |||
156 | --- qml/Launcher/LauncherDelegate.qml 2015-07-25 13:57:22 +0000 | |||
157 | +++ qml/Launcher/LauncherDelegate.qml 2015-07-25 13:57:22 +0000 | |||
158 | @@ -153,7 +153,7 @@ | |||
159 | 153 | objectName: "countEmblem" | 153 | objectName: "countEmblem" |
160 | 154 | anchors { | 154 | anchors { |
161 | 155 | right: parent.right | 155 | right: parent.right |
163 | 156 | top: parent.top | 156 | bottom: parent.bottom |
164 | 157 | margins: units.dp(3) | 157 | margins: units.dp(3) |
165 | 158 | } | 158 | } |
166 | 159 | width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1))) | 159 | width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1))) |
167 | @@ -178,23 +178,21 @@ | |||
168 | 178 | } | 178 | } |
169 | 179 | } | 179 | } |
170 | 180 | 180 | ||
172 | 181 | BorderImage { | 181 | UbuntuShape { |
173 | 182 | id: progressOverlay | 182 | id: progressOverlay |
174 | 183 | objectName: "progressOverlay" | 183 | objectName: "progressOverlay" |
175 | 184 | |||
176 | 184 | anchors { | 185 | anchors { |
177 | 185 | left: iconItem.left | 186 | left: iconItem.left |
178 | 186 | right: iconItem.right | 187 | right: iconItem.right |
183 | 187 | bottom: iconItem.bottom | 188 | verticalCenter: parent.verticalCenter |
184 | 188 | leftMargin: units.gu(1) | 189 | leftMargin: units.gu(1.5) |
185 | 189 | rightMargin: units.gu(1) | 190 | rightMargin: units.gu(1.5) |
182 | 190 | bottomMargin: units.gu(1) | ||
186 | 191 | } | 191 | } |
188 | 192 | height: units.gu(1.5) | 192 | height: units.gu(1) |
189 | 193 | visible: root.progress > -1 | 193 | visible: root.progress > -1 |
194 | 194 | source: "graphics/progressbar-trough.sci" | 194 | color: UbuntuColors.darkGrey |
195 | 195 | 195 | borderSource: "none" | |
192 | 196 | // For fill calculation we need to remove the 2 units of border defined in .sci file | ||
193 | 197 | property int adjustedWidth: width - units.gu(2) | ||
196 | 198 | 196 | ||
197 | 199 | Item { | 197 | Item { |
198 | 200 | anchors { | 198 | anchors { |
199 | @@ -202,20 +200,22 @@ | |||
200 | 202 | top: parent.top | 200 | top: parent.top |
201 | 203 | bottom: parent.bottom | 201 | bottom: parent.bottom |
202 | 204 | } | 202 | } |
204 | 205 | width: Math.min(100, root.progress) / 100 * parent.adjustedWidth + units.gu(1) | 203 | width: Math.min(100, root.progress) / 100 * parent.width |
205 | 206 | clip: true | 204 | clip: true |
206 | 207 | 205 | ||
208 | 208 | BorderImage { | 206 | UbuntuShape { |
209 | 209 | anchors { | 207 | anchors { |
210 | 210 | left: parent.left | 208 | left: parent.left |
211 | 211 | top: parent.top | 209 | top: parent.top |
212 | 212 | bottom: parent.bottom | 210 | bottom: parent.bottom |
213 | 213 | } | 211 | } |
214 | 212 | color: "white" | ||
215 | 213 | borderSource: "none" | ||
216 | 214 | width: progressOverlay.width | 214 | width: progressOverlay.width |
217 | 215 | source: "graphics/progressbar-fill.sci" | ||
218 | 216 | } | 215 | } |
219 | 217 | } | 216 | } |
220 | 218 | } | 217 | } |
221 | 218 | |||
222 | 219 | Image { | 219 | Image { |
223 | 220 | objectName: "focusedHighlight" | 220 | objectName: "focusedHighlight" |
224 | 221 | anchors { | 221 | anchors { |
225 | 222 | 222 | ||
226 | === removed file 'qml/Launcher/graphics/progressbar-fill@30.png' | |||
227 | 223 | Binary files qml/Launcher/graphics/progressbar-fill@30.png 2013-08-19 19:34:03 +0000 and qml/Launcher/graphics/progressbar-fill@30.png 1970-01-01 00:00:00 +0000 differ | 223 | Binary files qml/Launcher/graphics/progressbar-fill@30.png 2013-08-19 19:34:03 +0000 and qml/Launcher/graphics/progressbar-fill@30.png 1970-01-01 00:00:00 +0000 differ |
228 | === removed file 'qml/Launcher/graphics/progressbar-fill@30.sci' | |||
229 | --- qml/Launcher/graphics/progressbar-fill@30.sci 2013-08-19 19:34:03 +0000 | |||
230 | +++ qml/Launcher/graphics/progressbar-fill@30.sci 1970-01-01 00:00:00 +0000 | |||
231 | @@ -1,5 +0,0 @@ | |||
232 | 1 | border.left: 36 | ||
233 | 2 | border.top: 16 | ||
234 | 3 | border.bottom: 28 | ||
235 | 4 | border.right: 36 | ||
236 | 5 | source: progressbar-fill@30.png | ||
237 | 6 | \ No newline at end of file | 0 | \ No newline at end of file |
238 | 7 | 1 | ||
239 | === removed file 'qml/Launcher/graphics/progressbar-trough@30.png' | |||
240 | 8 | Binary files qml/Launcher/graphics/progressbar-trough@30.png 2013-08-19 19:34:03 +0000 and qml/Launcher/graphics/progressbar-trough@30.png 1970-01-01 00:00:00 +0000 differ | 2 | Binary files qml/Launcher/graphics/progressbar-trough@30.png 2013-08-19 19:34:03 +0000 and qml/Launcher/graphics/progressbar-trough@30.png 1970-01-01 00:00:00 +0000 differ |
241 | === removed file 'qml/Launcher/graphics/progressbar-trough@30.sci' | |||
242 | --- qml/Launcher/graphics/progressbar-trough@30.sci 2013-08-19 19:34:03 +0000 | |||
243 | +++ qml/Launcher/graphics/progressbar-trough@30.sci 1970-01-01 00:00:00 +0000 | |||
244 | @@ -1,5 +0,0 @@ | |||
245 | 1 | border.left: 36 | ||
246 | 2 | border.top: 16 | ||
247 | 3 | border.bottom: 26 | ||
248 | 4 | border.right: 36 | ||
249 | 5 | source: progressbar-trough@30.png | ||
250 | 6 | \ No newline at end of file | 0 | \ No newline at end of file |
251 | 7 | 1 | ||
252 | === modified file 'tests/mocks/Unity/Launcher/MockLauncherModel.cpp' | |||
253 | --- tests/mocks/Unity/Launcher/MockLauncherModel.cpp 2015-07-25 13:57:22 +0000 | |||
254 | +++ tests/mocks/Unity/Launcher/MockLauncherModel.cpp 2015-07-25 13:57:22 +0000 | |||
255 | @@ -215,6 +215,16 @@ | |||
256 | 215 | return -1; | 215 | return -1; |
257 | 216 | } | 216 | } |
258 | 217 | 217 | ||
259 | 218 | void MockLauncherModel::setProgress(const QString &appId, int progress) | ||
260 | 219 | { | ||
261 | 220 | int index = findApp(appId); | ||
262 | 221 | if (index >= 0) { | ||
263 | 222 | m_list.at(index)->setProgress(progress); | ||
264 | 223 | QModelIndex modelIndex = this->index(index); | ||
265 | 224 | Q_EMIT dataChanged(modelIndex, modelIndex, QVector<int>() << RoleProgress); | ||
266 | 225 | } | ||
267 | 226 | } | ||
268 | 227 | |||
269 | 218 | void MockLauncherModel::setUser(const QString &username) | 228 | void MockLauncherModel::setUser(const QString &username) |
270 | 219 | { | 229 | { |
271 | 220 | Q_UNUSED(username) | 230 | Q_UNUSED(username) |
272 | 221 | 231 | ||
273 | === modified file 'tests/mocks/Unity/Launcher/MockLauncherModel.h' | |||
274 | --- tests/mocks/Unity/Launcher/MockLauncherModel.h 2015-07-25 13:57:22 +0000 | |||
275 | +++ tests/mocks/Unity/Launcher/MockLauncherModel.h 2015-07-25 13:57:22 +0000 | |||
276 | @@ -55,6 +55,7 @@ | |||
277 | 55 | 55 | ||
278 | 56 | // For testing | 56 | // For testing |
279 | 57 | Q_INVOKABLE void emitHint(); | 57 | Q_INVOKABLE void emitHint(); |
280 | 58 | Q_INVOKABLE void setProgress(const QString &appId, int progress); | ||
281 | 58 | Q_INVOKABLE void setCount(const QString &appId, int count); | 59 | Q_INVOKABLE void setCount(const QString &appId, int count); |
282 | 59 | Q_INVOKABLE void setCountVisible(const QString &appId, bool countVisible); | 60 | Q_INVOKABLE void setCountVisible(const QString &appId, bool countVisible); |
283 | 60 | 61 | ||
284 | 61 | 62 | ||
285 | === modified file 'tests/plugins/Greeter/Unity/Launcher/launchermodelastest.cpp' | |||
286 | --- tests/plugins/Greeter/Unity/Launcher/launchermodelastest.cpp 2015-02-11 14:11:26 +0000 | |||
287 | +++ tests/plugins/Greeter/Unity/Launcher/launchermodelastest.cpp 2015-07-25 13:57:22 +0000 | |||
288 | @@ -43,6 +43,7 @@ | |||
289 | 43 | item.insert("name", "Item 1"); | 43 | item.insert("name", "Item 1"); |
290 | 44 | item.insert("icon", "fake.svg"); | 44 | item.insert("icon", "fake.svg"); |
291 | 45 | item.insert("count", 0); | 45 | item.insert("count", 0); |
292 | 46 | item.insert("progress", 0); | ||
293 | 46 | item.insert("countVisible", false); | 47 | item.insert("countVisible", false); |
294 | 47 | item.insert("pinned", true); | 48 | item.insert("pinned", true); |
295 | 48 | list.append(item); | 49 | list.append(item); |
296 | @@ -67,6 +68,7 @@ | |||
297 | 67 | inSync &= model->get(i)->name() == list.at(i).value("name").toString(); | 68 | inSync &= model->get(i)->name() == list.at(i).value("name").toString(); |
298 | 68 | inSync &= model->get(i)->icon() == list.at(i).value("icon").toString(); | 69 | inSync &= model->get(i)->icon() == list.at(i).value("icon").toString(); |
299 | 69 | inSync &= model->get(i)->count() == list.at(i).value("count").toInt(); | 70 | inSync &= model->get(i)->count() == list.at(i).value("count").toInt(); |
300 | 71 | inSync &= model->get(i)->progress() == list.at(i).value("progress").toInt(); | ||
301 | 70 | inSync &= model->get(i)->countVisible() == list.at(i).value("countVisible").toBool(); | 72 | inSync &= model->get(i)->countVisible() == list.at(i).value("countVisible").toBool(); |
302 | 71 | } | 73 | } |
303 | 72 | return inSync; | 74 | return inSync; |
304 | @@ -111,6 +113,7 @@ | |||
305 | 111 | newEntry.insert("name", "New app"); | 113 | newEntry.insert("name", "New app"); |
306 | 112 | newEntry.insert("icon", "some-icon.svg"); | 114 | newEntry.insert("icon", "some-icon.svg"); |
307 | 113 | newEntry.insert("count", 0); | 115 | newEntry.insert("count", 0); |
308 | 116 | newEntry.insert("progress", 42); | ||
309 | 114 | newEntry.insert("countVisible", false); | 117 | newEntry.insert("countVisible", false); |
310 | 115 | newEntry.insert("pinned", true); | 118 | newEntry.insert("pinned", true); |
311 | 116 | newList.append(newEntry); | 119 | newList.append(newEntry); |
312 | 117 | 120 | ||
313 | === modified file 'tests/qmltests/Launcher/tst_Launcher.qml' | |||
314 | --- tests/qmltests/Launcher/tst_Launcher.qml 2015-07-25 13:57:22 +0000 | |||
315 | +++ tests/qmltests/Launcher/tst_Launcher.qml 2015-07-25 13:57:22 +0000 | |||
316 | @@ -98,12 +98,38 @@ | |||
317 | 98 | spacing: units.gu(1) | 98 | spacing: units.gu(1) |
318 | 99 | 99 | ||
319 | 100 | Button { | 100 | Button { |
320 | 101 | text: "35% bar" | ||
321 | 102 | onClicked: LauncherModel.setProgress(LauncherModel.get(parseInt(appIdEntryBar.displayText)).appId, 35) | ||
322 | 103 | Layout.fillWidth: true | ||
323 | 104 | } | ||
324 | 105 | |||
325 | 106 | TextArea { | ||
326 | 107 | id: appIdEntryBar | ||
327 | 108 | anchors.verticalCenter: parent.verticalCenter | ||
328 | 109 | width: units.gu(4) | ||
329 | 110 | height: units.gu(4) | ||
330 | 111 | autoSize: true | ||
331 | 112 | text: "2" | ||
332 | 113 | maximumLineCount: 1 | ||
333 | 114 | } | ||
334 | 115 | |||
335 | 116 | Button { | ||
336 | 117 | text: "no bar" | ||
337 | 118 | onClicked: LauncherModel.setProgress(LauncherModel.get(parseInt(appIdEntryBar.displayText)).appId, -1) | ||
338 | 119 | Layout.fillWidth: true | ||
339 | 120 | } | ||
340 | 121 | } | ||
341 | 122 | |||
342 | 123 | Row { | ||
343 | 124 | spacing: units.gu(1) | ||
344 | 125 | |||
345 | 126 | Button { | ||
346 | 101 | text: "set alert" | 127 | text: "set alert" |
348 | 102 | onClicked: LauncherModel.setAlerting(LauncherModel.get(parseInt(appIdEntry.displayText)).appId, true) | 128 | onClicked: LauncherModel.setAlerting(LauncherModel.get(parseInt(appIdEntryAlert.displayText)).appId, true) |
349 | 103 | } | 129 | } |
350 | 104 | 130 | ||
351 | 105 | TextArea { | 131 | TextArea { |
353 | 106 | id: appIdEntry | 132 | id: appIdEntryAlert |
354 | 107 | anchors.verticalCenter: parent.verticalCenter | 133 | anchors.verticalCenter: parent.verticalCenter |
355 | 108 | width: units.gu(5) | 134 | width: units.gu(5) |
356 | 109 | height: units.gu(4) | 135 | height: units.gu(4) |
357 | @@ -115,7 +141,7 @@ | |||
358 | 115 | 141 | ||
359 | 116 | Button { | 142 | Button { |
360 | 117 | text: "unset alert" | 143 | text: "unset alert" |
362 | 118 | onClicked: LauncherModel.setAlerting(LauncherModel.get(parseInt(appIdEntry.displayText)).appId, false) | 144 | onClicked: LauncherModel.setAlerting(LauncherModel.get(parseInt(appIdEntryAlert.displayText)).appId, false) |
363 | 119 | } | 145 | } |
364 | 120 | } | 146 | } |
365 | 121 | } | 147 | } |
366 | @@ -672,6 +698,17 @@ | |||
367 | 672 | waitUntilLauncherDisappears(); | 698 | waitUntilLauncherDisappears(); |
368 | 673 | } | 699 | } |
369 | 674 | 700 | ||
370 | 701 | function test_progressChangeViaModel() { | ||
371 | 702 | dragLauncherIntoView(); | ||
372 | 703 | var item = findChild(launcher, "launcherDelegate0") | ||
373 | 704 | verify(item != undefined) | ||
374 | 705 | LauncherModel.setProgress(LauncherModel.get(0).appId, -1) | ||
375 | 706 | compare(findChild(item, "progressOverlay").visible, false) | ||
376 | 707 | LauncherModel.setProgress(LauncherModel.get(0).appId, 20) | ||
377 | 708 | compare(findChild(item, "progressOverlay").visible, true) | ||
378 | 709 | LauncherModel.setProgress(LauncherModel.get(0).appId, 0) | ||
379 | 710 | } | ||
380 | 711 | |||
381 | 675 | function test_alertPeekingIcon() { | 712 | function test_alertPeekingIcon() { |
382 | 676 | var listView = findChild(launcher, "launcherListView") | 713 | var listView = findChild(launcher, "launcherListView") |
383 | 677 | verify(listView != undefined) | 714 | verify(listView != undefined) |
384 | 678 | 715 | ||
385 | === modified file 'tests/scripts/README' | |||
386 | --- tests/scripts/README 2015-07-25 13:57:22 +0000 | |||
387 | +++ tests/scripts/README 2015-07-25 13:57:22 +0000 | |||
388 | @@ -3,3 +3,7 @@ | |||
389 | 3 | launcher-icon related: | 3 | launcher-icon related: |
390 | 4 | * list-launcher-icons.sh - get all icons of unity8-launcher | 4 | * list-launcher-icons.sh - get all icons of unity8-launcher |
391 | 5 | * alert-launcher-icon.sh - trigger alert/wiggle of unfocused launcher-icon | 5 | * alert-launcher-icon.sh - trigger alert/wiggle of unfocused launcher-icon |
392 | 6 | * get-progress.sh - get progress-value of a launcher-icon | ||
393 | 7 | * set-progress.sh - set progress-value of a launcher-icon | ||
394 | 8 | * set-count.sh - set the count of a launcher-icon | ||
395 | 9 | * set-count-visible.sh - set the count-visible flag of a launcher-icon | ||
396 | 6 | 10 | ||
397 | === added file 'tests/scripts/get-progress.sh' | |||
398 | --- tests/scripts/get-progress.sh 1970-01-01 00:00:00 +0000 | |||
399 | +++ tests/scripts/get-progress.sh 2015-07-25 13:57:22 +0000 | |||
400 | @@ -0,0 +1,3 @@ | |||
401 | 1 | #!/bin/sh | ||
402 | 2 | |||
403 | 3 | qdbus com.canonical.Unity.Launcher /com/canonical/Unity/Launcher/$1 org.freedesktop.DBus.Properties.Get com.canonical.Unity.Launcher.Item progress | ||
404 | 0 | 4 | ||
405 | === added file 'tests/scripts/set-count-visible.sh' | |||
406 | --- tests/scripts/set-count-visible.sh 1970-01-01 00:00:00 +0000 | |||
407 | +++ tests/scripts/set-count-visible.sh 2015-07-25 13:57:22 +0000 | |||
408 | @@ -0,0 +1,3 @@ | |||
409 | 1 | #!/bin/sh | ||
410 | 2 | |||
411 | 3 | qdbus com.canonical.Unity.Launcher /com/canonical/Unity/Launcher/$1 org.freedesktop.DBus.Properties.Set com.canonical.Unity.Launcher.Item countVisible $2 | ||
412 | 0 | 4 | ||
413 | === added file 'tests/scripts/set-count.sh' | |||
414 | --- tests/scripts/set-count.sh 1970-01-01 00:00:00 +0000 | |||
415 | +++ tests/scripts/set-count.sh 2015-07-25 13:57:22 +0000 | |||
416 | @@ -0,0 +1,3 @@ | |||
417 | 1 | #!/bin/sh | ||
418 | 2 | |||
419 | 3 | qdbus com.canonical.Unity.Launcher /com/canonical/Unity/Launcher/$1 org.freedesktop.DBus.Properties.Set com.canonical.Unity.Launcher.Item count $2 | ||
420 | 0 | 4 | ||
421 | === added file 'tests/scripts/set-progress.sh' | |||
422 | --- tests/scripts/set-progress.sh 1970-01-01 00:00:00 +0000 | |||
423 | +++ tests/scripts/set-progress.sh 2015-07-25 13:57:22 +0000 | |||
424 | @@ -0,0 +1,3 @@ | |||
425 | 1 | #!/bin/sh | ||
426 | 2 | |||
427 | 3 | qdbus com.canonical.Unity.Launcher /com/canonical/Unity/Launcher/$1 org.freedesktop.DBus.Properties.Set com.canonical.Unity.Launcher.Item progress $2 |
FAILED: Continuous integration, rev:1823 jenkins. qa.ubuntu. com/job/ unity8- ci/5836/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- wily-touch/ 130/console jenkins. qa.ubuntu. com/job/ unity8- wily-amd64- ci/116/ console jenkins. qa.ubuntu. com/job/ unity8- wily-i386- ci/117/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- wily-armhf/ 130/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/5836/ rebuild
http://