31
32
PlaceLauncherIcon::PlaceLauncherIcon (Launcher *launcher, PlaceEntry *entry)
32
33
: SimpleLauncherIcon(launcher),
35
37
SetTooltipText (entry->GetName ());
36
38
SetShortcut (entry->GetShortcut());
41
43
SetIconType (TYPE_PLACE);
43
45
_on_active_changed_connection = (sigc::connection) entry->active_changed.connect (sigc::mem_fun (this, &PlaceLauncherIcon::OnActiveChanged));
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));
46
52
PlaceLauncherIcon::~PlaceLauncherIcon()
83
PlaceLauncherIcon::RecvMouseEnter ()
85
// Connect the parent Place. This is fine to call multiple times.
86
if (_entry->GetParent ())
87
_entry->GetParent ()->Connect ();
77
91
PlaceLauncherIcon::ForeachSectionCallback (PlaceEntry *entry, PlaceEntrySection& section)
79
93
DbusmenuMenuitem *menu_item;
101
117
DbusmenuMenuitem *menu_item;
104
120
_current_menu.erase (_current_menu.begin (), _current_menu.end ());
106
123
_entry->ForeachSection (sigc::mem_fun (this, &PlaceLauncherIcon::ForeachSectionCallback));
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);
125
// In the worst case that the PlaceEntry wasn't connected and ready by the time we need to
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
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);
114
138
temp = g_markup_escape_text (_entry->GetName (), -1);
115
139
menu_item = dbusmenu_menuitem_new ();
129
153
PlaceLauncherIcon::ActivatePlace (guint section_id, const char *search_string)
155
if (_entry->GetParent ())
156
_entry->GetParent ()->Connect ();
131
158
ubus_server_send_message (ubus_server_get_default (),
132
159
UBUS_PLACE_ENTRY_ACTIVATE_REQUEST,
133
160
g_variant_new ("(sus)",