diff options
author | Ted Gould <ted@gould.cx> | 2010-02-17 21:33:57 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-17 21:33:57 -0600 |
commit | cac9ec783a2fd4a15635ebf015eb5a775711ed78 (patch) | |
tree | f9e7593e64c4856c5a8d346b58b41aa900e8292b /src/launcher-menu-item.c | |
parent | 174f2c30a0bc29ac33a70b4bfeec164d55708065 (diff) | |
download | ayatana-indicator-messages-cac9ec783a2fd4a15635ebf015eb5a775711ed78.tar.gz ayatana-indicator-messages-cac9ec783a2fd4a15635ebf015eb5a775711ed78.tar.bz2 ayatana-indicator-messages-cac9ec783a2fd4a15635ebf015eb5a775711ed78.zip |
Switch to having a launcher be a standard item with an icon.
Diffstat (limited to 'src/launcher-menu-item.c')
-rw-r--r-- | src/launcher-menu-item.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/launcher-menu-item.c b/src/launcher-menu-item.c index 50e8ce6..1573367 100644 --- a/src/launcher-menu-item.c +++ b/src/launcher-menu-item.c @@ -131,9 +131,10 @@ launcher_menu_item_new (const gchar * desktop_file) priv->desktop = g_strdup(desktop_file); 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); g_signal_connect(G_OBJECT(self), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), NULL); @@ -156,6 +157,20 @@ launcher_menu_item_get_name (LauncherMenuItem * appitem) } } +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 |