Merge lp://qastaging/~uriboni/unity-2d/launcher-overlays into lp://qastaging/unity-2d/3.0

Proposed by Ugo Riboni
Status: Merged
Approved by: Florian Boucault
Approved revision: 402
Merged at revision: 396
Proposed branch: lp://qastaging/~uriboni/unity-2d/launcher-overlays
Merge into: lp://qastaging/unity-2d/3.0
Diff against target: 387 lines (+230/-2)
6 files modified
launcher/LauncherItem.qml (+80/-0)
launcher/LauncherList.qml (+7/-0)
launcher/UnityApplications/launcherapplication.cpp (+76/-0)
launcher/UnityApplications/launcherapplication.h (+28/-0)
launcher/UnityApplications/launcherapplicationslist.cpp (+37/-2)
launcher/UnityApplications/launcherapplicationslist.h (+2/-0)
To merge this branch: bzr merge lp://qastaging/~uriboni/unity-2d/launcher-overlays
Reviewer Review Type Date Requested Status
Florian Boucault (community) Approve
Review via email: mp+50310@code.qastaging.launchpad.net

Commit message

[launcher] Implement the following overlay features on launcher icons: counter, progress bar and emblem.
These overlays can be made visible and configured by external applications via libunity (which in turn uses the com.canonical.Unity.LauncherEntry.Update DBUS signal)

Description of the change

Implement the following overlay features on launcher icons: counter, progress bar and emblem.
Will add more info on how to test in a comment.

To post a comment you must log in.
Revision history for this message
Ugo Riboni (uriboni) wrote :

To test you need to have installed libunity-dev and valac-0.12 and then compile the vala application that you can find here: https://pastebin.canonical.com/43585/
with this cmdline: valac --pkg unity launcherexample.vala

Run it once without parameters to get some instructions, it should fairly self explanatory.

Here's also some notes on the feature:
- Emblem and counter are mutually exclusive, with counter taking priority. That's by design it seems, but I still need to ask Jason. We can change it later.
- In the constructor of LauncherApplicationsList there's some DBUS code to "pretend" to be Unity. You may want to review that carefully as I'm not sure it's the right place to put it or if we have any way around doing that or if it should be done more globally somewhere else in unity-2d

399. By Ugo Riboni

Merge changes from trunk

Revision history for this message
Florian Boucault (fboucault) wrote :

I get many warnings at startup:

Unity 2D Launcher: [WARNING] file:///home/kaleo/Projects/upicek/unity-2d//launcher/LauncherList.qml:26: Unable to assign [undefined] to int counter
Unity 2D Launcher: [WARNING] file:///home/kaleo/Projects/upicek/unity-2d//launcher/LauncherList.qml:31: Unable to assign [undefined] to bool emblemVisible
Unity 2D Launcher: [WARNING] file:///home/kaleo/Projects/upicek/unity-2d//launcher/LauncherList.qml:28: Unable to assign [undefined] to double progress
Unity 2D Launcher: [WARNING] file:///home/kaleo/Projects/upicek/unity-2d//launcher/LauncherList.qml:29: Unable to assign [undefined] to bool progressBarVisible
Unity 2D Launcher: [WARNING] file:///home/kaleo/Projects/upicek/unity-2d//launcher/LauncherList.qml:27: Unable to assign [undefined] to bool counterVisible
[...]

review: Needs Fixing
Revision history for this message
Florian Boucault (fboucault) wrote :

Usual nitpick:

Do not use abbreviations in LauncherApplicationsList::onRemoteEntryUpdated. See 'app_uri' and 'app'.

review: Needs Fixing
Revision history for this message
Florian Boucault (fboucault) wrote :

Everything else looks great!

One question:

Does the 'entry' animation for the progress bar exist in Unity 3D?
In any case I don't think you need the anchor changes at all to achieve it. In fact I think the whole state management should not be used in this case and replaced with a simpler:

width: launcherItem.progressBarVisible ? tile.width : 0

Revision history for this message
Ugo Riboni (uriboni) wrote :

> Everything else looks great!
>
> One question:
>
> Does the 'entry' animation for the progress bar exist in Unity 3D?
> In any case I don't think you need the anchor changes at all to achieve it. In
> fact I think the whole state management should not be used in this case and
> replaced with a simpler:
>
> width: launcherItem.progressBarVisible ? tile.width : 0

Well, I did it that way since I tried to replicate the unity animation. Essentially in unity when the bar appears it seems to come in from the left, and with it disappears it seems to go away to the right.
So if i just change the width to zero, it will go away in the direction of whatever side of the tile it is anchored, so AFAIK the anchor change is needed.

Revision history for this message
Ugo Riboni (uriboni) wrote :

> Usual nitpick:
>
> Do not use abbreviations in LauncherApplicationsList::onRemoteEntryUpdated.
> See 'app_uri' and 'app'.

Right. I did that since it's named app_uri in the DBUS interface, but it's not a good excuse. I'll change it.

Revision history for this message
Ugo Riboni (uriboni) wrote :

> I get many warnings at startup:

Didn't get them here last I tried. Will check again.

Revision history for this message
Florian Boucault (fboucault) wrote :

> > Everything else looks great!
> >
> > One question:
> >
> > Does the 'entry' animation for the progress bar exist in Unity 3D?
> > In any case I don't think you need the anchor changes at all to achieve it.
> In
> > fact I think the whole state management should not be used in this case and
> > replaced with a simpler:
> >
> > width: launcherItem.progressBarVisible ? tile.width : 0
>
> Well, I did it that way since I tried to replicate the unity animation.
> Essentially in unity when the bar appears it seems to come in from the left,
> and with it disappears it seems to go away to the right.
> So if i just change the width to zero, it will go away in the direction of
> whatever side of the tile it is anchored, so AFAIK the anchor change is
> needed.

Fine.

400. By Ugo Riboni

Merge changes from trunk

401. By Ugo Riboni

Bind overlay properties only if they exist

402. By Ugo Riboni

Rename abbreviated variables

Revision history for this message
Ugo Riboni (uriboni) wrote :

Fixed all issues mentioned

Revision history for this message
Florian Boucault (fboucault) wrote :

Good to go!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: