~shnatsel/unity/old-school-dash

« back to all changes in this revision

Viewing changes to src/PlaceLauncherIcon.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2011-04-14 22:03:42 UTC
  • mfrom: (1.1.41 upstream)
  • Revision ID: james.westby@ubuntu.com-20110414220342-4kp036kzlljxxx23
Tags: 3.8.8-0ubuntu1
* New upstream release.
  - Empty desktop after login (LP: #687660)
  - compiz crashed with SIGSEGV in nux::Area::InitiateResizeLayout()
    (LP: #757709)
  - compiz crashed on initial load of Java Citrix Client/Inkscape in
    PrivateWindow::processMap() (LP: #758307)
  - Sometimes dragging down from the panel just stops working (LP: #750155)
  - Ensure Unity prioritises icon loading from Unity-icon-theme
    (LP: #750471)
  - text truncated in Dash. Empty search from Applications or Files lense
    returns “Your search did not” due to cut off label (LP: #757362)
  - should list PlacesGroup.cpp in POTFILES.in (LP: #757663)
  - Launcher intellhide stuck after edge reveal (LP: #757810)
  - unity-preferences doesn't load translations (LP: #759682)
  - dynamic quicklists are not working (LP: #729074)
  - with second monitor, first monitor does not show nautilus
    application/global menu when displaying desktop (LP: #743149)
  - Launcher - The Workspace, File Lens, App Lens and Trash Launcher icons
    need to be rendered correctly (LP: #745555)
  - the launcher background gets dimmed after icons dnd (LP: #747304)
  - Numpad 'Enter' does not work on unity launcher when navigating through
    keyboard (LP: #760003)
  - Launcher shouldn't hover when being in the dash (LP: #760770)
  - Launcher displays key shortcuts while holding Super while the dash is
    open but the shortcuts are unfunctional (LP: #760728)
  - Running/active indicators point to space between launcher icons for
    folded icons (LP: #703067)
  - user-trash.svg and user-trash-full.svg not lens grayscale versions
    (LP: #741804)
  - code-cleanup: unregistered any established ubus-interests (LP: #757588)
  - dropdown box in places search bar does not resize when font size changes
    (LP: #759763)
  - [FFE] Centered layout for expo plugin (LP: #754689)
  - Unity launcher icons tooltips do not disappear when swiching workspaces
    (LP: #744795)
  - Dash - Update Dash scroll bar (LP: #750374)
  - Letters cut off at the end in the applications window  (LP: #753083)
* debian/control:
  - build-dep on grail/geis with version bumped
* 01_dont_dep_on_latest_geis_grail.patch:
  - not needed anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include "PlaceLauncherIcon.h"
23
23
 
 
24
#include "Place.h"
24
25
#include "ubus-server.h"
25
26
#include "UBusMessages.h"
26
27
 
30
31
 
31
32
PlaceLauncherIcon::PlaceLauncherIcon (Launcher *launcher, PlaceEntry *entry)
32
33
: SimpleLauncherIcon(launcher),
33
 
  _entry (entry)
 
34
  _entry (entry),
 
35
  _n_sections (0)
34
36
{
35
37
  SetTooltipText (entry->GetName ());
36
38
  SetShortcut (entry->GetShortcut());
41
43
  SetIconType (TYPE_PLACE); 
42
44
 
43
45
  _on_active_changed_connection = (sigc::connection) entry->active_changed.connect (sigc::mem_fun (this, &PlaceLauncherIcon::OnActiveChanged));
 
46
  
 
47
  // We're interested in this as it's a great time to Connect () our PlaceEntry. The goal being
 
48
  // to have the PlaceEntry ready-and-connected by the time the user clicks on the icon
 
49
  MouseEnter.connect (sigc::mem_fun (this, &PlaceLauncherIcon::RecvMouseEnter));
44
50
}
45
51
 
46
52
PlaceLauncherIcon::~PlaceLauncherIcon()
74
80
}
75
81
 
76
82
void
 
83
PlaceLauncherIcon::RecvMouseEnter ()
 
84
{
 
85
  // Connect the parent Place. This is fine to call multiple times.
 
86
  if (_entry->GetParent ())
 
87
    _entry->GetParent ()->Connect ();
 
88
}
 
89
 
 
90
void
77
91
PlaceLauncherIcon::ForeachSectionCallback (PlaceEntry *entry, PlaceEntrySection& section)
78
92
{
79
93
  DbusmenuMenuitem              *menu_item;
92
106
                    G_CALLBACK (&PlaceLauncherIcon::OnOpen),
93
107
                    this);
94
108
 
 
109
  _n_sections++;
 
110
 
95
111
  g_free (temp);
96
112
}
97
113
 
100
116
{
101
117
  DbusmenuMenuitem              *menu_item;
102
118
  char * temp;
103
 
  
 
119
 
104
120
  _current_menu.erase (_current_menu.begin (), _current_menu.end ());
105
121
 
 
122
  _n_sections = 0;
106
123
  _entry->ForeachSection (sigc::mem_fun (this, &PlaceLauncherIcon::ForeachSectionCallback));
107
 
  
108
 
  menu_item = dbusmenu_menuitem_new ();
109
 
  dbusmenu_menuitem_property_set (menu_item, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR);
110
 
  dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
111
 
  dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
112
 
  _current_menu.push_back (menu_item);
 
124
 
 
125
  // In the worst case that the PlaceEntry wasn't connected and ready by the time we need to
 
126
  // show the menu
 
127
  // FIXME: In Oneric, it would be great to make the quicklists more dynamic so we could fill in
 
128
  // items as they show up in the PlaceEntry even once the QL is open
 
129
  if (_n_sections)
 
130
  {
 
131
    menu_item = dbusmenu_menuitem_new ();
 
132
    dbusmenu_menuitem_property_set (menu_item, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR);
 
133
    dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
 
134
    dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
 
135
    _current_menu.push_back (menu_item);
 
136
  }
113
137
 
114
138
  temp = g_markup_escape_text (_entry->GetName (), -1);
115
139
  menu_item = dbusmenu_menuitem_new ();
128
152
void
129
153
PlaceLauncherIcon::ActivatePlace (guint section_id, const char *search_string)
130
154
{
 
155
  if (_entry->GetParent ())
 
156
    _entry->GetParent ()->Connect ();
 
157
 
131
158
  ubus_server_send_message (ubus_server_get_default (),
132
159
                            UBUS_PLACE_ENTRY_ACTIVATE_REQUEST,
133
160
                            g_variant_new ("(sus)",