Merge lp:~unity-team/unity/unity.fix-723877 into lp:unity

Proposed by Mirco Müller
Status: Merged
Approved by: Mirco Müller
Approved revision: no longer in the source branch.
Merged at revision: 1009
Proposed branch: lp:~unity-team/unity/unity.fix-723877
Merge into: lp:unity
Diff against target: 100 lines (+48/-3)
2 files modified
src/BamfLauncherIcon.cpp (+46/-2)
src/BamfLauncherIcon.h (+2/-1)
To merge this branch: bzr merge lp:~unity-team/unity/unity.fix-723877
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+54581@code.launchpad.net

Description of the change

Adds separators and application-name label to the quicklist again. The application-name label also allows to start/focus the app... just like the launcher-icon itself. Fixes LP: #723877

To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) wrote :

Sweet!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/BamfLauncherIcon.cpp'
--- src/BamfLauncherIcon.cpp 2011-03-14 20:48:50 +0000
+++ src/BamfLauncherIcon.cpp 2011-03-23 18:29:10 +0000
@@ -719,11 +719,27 @@
719 }719 }
720}720}
721721
722static void
723OnAppLabelActivated (DbusmenuMenuitem* sender,
724 guint timestamp,
725 gpointer data)
726{
727 BamfLauncherIcon* self = NULL;
728
729 if (!data)
730 return;
731
732 self = (BamfLauncherIcon*) data;
733 self->ActivateLauncherIcon ();
734}
735
722std::list<DbusmenuMenuitem *>736std::list<DbusmenuMenuitem *>
723BamfLauncherIcon::GetMenus ()737BamfLauncherIcon::GetMenus ()
724{738{
725 std::map<std::string, DbusmenuClient *>::iterator it;739 std::map<std::string, DbusmenuClient *>::iterator it;
726 std::list<DbusmenuMenuitem *> result;740 std::list<DbusmenuMenuitem *> result;
741 bool first_separator_needed = false;
742 DbusmenuMenuitem* item = NULL;
727743
728 for (it = _menu_clients.begin (); it != _menu_clients.end (); it++)744 for (it = _menu_clients.begin (); it != _menu_clients.end (); it++)
729 {745 {
@@ -738,6 +754,8 @@
738 if (!item)754 if (!item)
739 continue;755 continue;
740756
757 first_separator_needed = true;
758
741 result.push_back (item);759 result.push_back (item);
742 }760 }
743 }761 }
@@ -754,10 +772,36 @@
754 if (!item)772 if (!item)
755 continue;773 continue;
756774
775 first_separator_needed = true;
776
757 result.push_back (item);777 result.push_back (item);
758 }778 }
759779 }
760 }780
781 if (first_separator_needed)
782 {
783 item = dbusmenu_menuitem_new ();
784 dbusmenu_menuitem_property_set (item,
785 DBUSMENU_MENUITEM_PROP_TYPE,
786 DBUSMENU_CLIENT_TYPES_SEPARATOR);
787 result.push_back (item);
788 }
789
790 item = dbusmenu_menuitem_new ();
791 dbusmenu_menuitem_property_set (item,
792 DBUSMENU_MENUITEM_PROP_LABEL,
793 bamf_view_get_name (BAMF_VIEW (m_App)));
794 dbusmenu_menuitem_property_set_bool (item,
795 DBUSMENU_MENUITEM_PROP_ENABLED,
796 true);
797 g_signal_connect (item, "item-activated", (GCallback) OnAppLabelActivated, this);
798 result.push_back (item);
799
800 item = dbusmenu_menuitem_new ();
801 dbusmenu_menuitem_property_set (item,
802 DBUSMENU_MENUITEM_PROP_TYPE,
803 DBUSMENU_CLIENT_TYPES_SEPARATOR);
804 result.push_back (item);
761805
762 EnsureMenuItemsReady ();806 EnsureMenuItemsReady ();
763807
764808
=== modified file 'src/BamfLauncherIcon.h'
--- src/BamfLauncherIcon.h 2011-02-11 17:03:24 +0000
+++ src/BamfLauncherIcon.h 2011-03-23 18:29:10 +0000
@@ -42,6 +42,8 @@
42 const char* DesktopFile ();42 const char* DesktopFile ();
43 bool IsSticky ();43 bool IsSticky ();
4444
45 void ActivateLauncherIcon ();
46
45protected:47protected:
46 void OnMouseClick (int button);48 void OnMouseClick (int button);
47 std::list<DbusmenuMenuitem *> GetMenus ();49 std::list<DbusmenuMenuitem *> GetMenus ();
@@ -58,7 +60,6 @@
58 void OnDndEnter ();60 void OnDndEnter ();
59 void OnDndLeave ();61 void OnDndLeave ();
60 62
61 void ActivateLauncherIcon ();
62 void OpenInstanceLauncherIcon ();63 void OpenInstanceLauncherIcon ();
63 64
64 std::list<char *> ValidateUrisForLaunch (std::list<char *> uris);65 std::list<char *> ValidateUrisForLaunch (std::list<char *> uris);