Merge lp:~3v1n0/unity/add-launcher-icon-to-dash into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 4035
Proposed branch: lp:~3v1n0/unity/add-launcher-icon-to-dash
Merge into: lp:unity
Diff against target: 25 lines (+16/-0)
1 file modified
launcher/ApplicationLauncherIcon.cpp (+16/-0)
To merge this branch: bzr merge lp:~3v1n0/unity/add-launcher-icon-to-dash
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+275968@code.launchpad.net

Commit message

ApplicationLauncherIcon: if an app is not running and has no desktop file, add QL item to add to dash

This allows to generate a desktop file without sticking the icon

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Azzarone (azzar1) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/ApplicationLauncherIcon.cpp'
2--- launcher/ApplicationLauncherIcon.cpp 2015-09-21 17:02:08 +0000
3+++ launcher/ApplicationLauncherIcon.cpp 2015-10-28 09:28:38 +0000
4@@ -1092,6 +1092,22 @@
5
6 if (IsRunning())
7 {
8+ if (DesktopFile().empty() && !IsSticky())
9+ {
10+ /* Add to Dash */
11+ glib::Object<DbusmenuMenuitem> menu_item(dbusmenu_menuitem_new());
12+ dbusmenu_menuitem_property_set(menu_item, DBUSMENU_MENUITEM_PROP_LABEL, _("Add to Dash"));
13+ dbusmenu_menuitem_property_set_bool(menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
14+ dbusmenu_menuitem_property_set_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
15+
16+ _gsignals.Add<void, DbusmenuMenuitem*, unsigned>(menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
17+ [this] (DbusmenuMenuitem*, unsigned) {
18+ app_->CreateLocalDesktopFile();
19+ });
20+
21+ result.push_back(menu_item);
22+ }
23+
24 if (!quit_item)
25 quit_item = _menu_items[MenuItemType::QUIT];
26