aboutsummaryrefslogtreecommitdiff
path: root/src/launcher-menu-item.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-18 11:23:29 -0600
committerTed Gould <ted@gould.cx>2010-02-18 11:23:29 -0600
commit5a6010fdb4e2c1528c4033f78d8bc2abf5fe9e63 (patch)
treec0f3881eae20a681d16b5d21d7622aea1daa5694 /src/launcher-menu-item.c
parent0bae7a38701b3493e2e4053e18ff68b791ba5f01 (diff)
parent256417a46e8798eb32d025081aa205efce8cbebe (diff)
downloadayatana-indicator-messages-5a6010fdb4e2c1528c4033f78d8bc2abf5fe9e63.tar.gz
ayatana-indicator-messages-5a6010fdb4e2c1528c4033f78d8bc2abf5fe9e63.tar.bz2
ayatana-indicator-messages-5a6010fdb4e2c1528c4033f78d8bc2abf5fe9e63.zip
Changing the applications to have icons.
Diffstat (limited to 'src/launcher-menu-item.c')
-rw-r--r--src/launcher-menu-item.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/launcher-menu-item.c b/src/launcher-menu-item.c
index d6386a3..07b0546 100644
--- a/src/launcher-menu-item.c
+++ b/src/launcher-menu-item.c
@@ -161,9 +161,10 @@ launcher_menu_item_new (const gchar * desktop_file)
/* Set the appropriate values on this menu item based on the
app info that we've parsed */
g_debug("\tName: %s", launcher_menu_item_get_name(self));
- dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_TYPE, LAUNCHER_MENUITEM_TYPE);
- dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), LAUNCHER_MENUITEM_PROP_APP_NAME, launcher_menu_item_get_name(self));
- dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), LAUNCHER_MENUITEM_PROP_APP_DESC, launcher_menu_item_get_description(self));
+ dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_LABEL, launcher_menu_item_get_name(self));
+ gchar * iconstr = launcher_menu_item_get_icon(self);
+ dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_ICON_NAME, iconstr);
+ g_free(iconstr);
dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
g_signal_connect(G_OBJECT(self), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), NULL);
@@ -223,6 +224,20 @@ nick_activate_cb (LauncherMenuItem * self, guint timestamp, gpointer data)
return;
}
+gchar *
+launcher_menu_item_get_icon (LauncherMenuItem * appitem)
+{
+ LauncherMenuItemPrivate * priv = LAUNCHER_MENU_ITEM_GET_PRIVATE(appitem);
+
+ if (priv->appinfo == NULL) {
+ return NULL;
+ } else {
+ GIcon * icon = g_app_info_get_icon(priv->appinfo);
+ gchar * iconstr = g_icon_to_string(icon);
+ return iconstr;
+ }
+}
+
/* When the menu item is clicked on it tries to launch
the application that is represented by the desktop file */
static void