aboutsummaryrefslogtreecommitdiff
path: root/src/messages-service.c
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2012-08-21 11:40:47 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2012-08-21 11:40:47 +0200
commit7d036b65aac90b646eb7845cfc8e229464f372f0 (patch)
tree0f35744b42ad90681db927832228d0002f0f41f9 /src/messages-service.c
parent699c7421e9591326e1629e2fce586e0336623936 (diff)
downloadayatana-indicator-messages-7d036b65aac90b646eb7845cfc8e229464f372f0.tar.gz
ayatana-indicator-messages-7d036b65aac90b646eb7845cfc8e229464f372f0.tar.bz2
ayatana-indicator-messages-7d036b65aac90b646eb7845cfc8e229464f372f0.zip
Show icons in application and source menu items
Everthing goes through GIcon now, using g_icon_{to,new_for}_string to set a string attribute on the menu item. The attribute is prefixed x-canonical- for now.
Diffstat (limited to 'src/messages-service.c')
-rw-r--r--src/messages-service.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/messages-service.c b/src/messages-service.c
index aade829..7654e1f 100644
--- a/src/messages-service.c
+++ b/src/messages-service.c
@@ -464,6 +464,8 @@ main (int argc, char ** argv)
GMainLoop * mainloop = NULL;
IndicatorService * service = NULL;
GMenuItem *header;
+ GIcon *icon;
+ gchar *iconstr;
/* Glib init */
g_type_init();
@@ -501,11 +503,14 @@ main (int argc, char ** argv)
chat_section = create_status_section ();
g_menu_append (menu, _("Clear"), "clear");
+ icon = g_themed_icon_new ("indicator-messages");
+ iconstr = g_icon_to_string (icon);
+
toplevel_menu = g_menu_new ();
header = g_menu_item_new (NULL, "messages");
g_menu_item_set_submenu (header, G_MENU_MODEL (menu));
- g_menu_item_set_attribute (header, INDICATOR_MENU_ATTRIBUTE_ICON_NAME, "s", "indicator-messages");
- g_menu_item_set_attribute (header, INDICATOR_MENU_ATTRIBUTE_ACCESSIBLE_DESCRIPTION, "s", _("Messages"));
+ g_menu_item_set_attribute (header, "x-canonical-icon", "s", iconstr);
+ g_menu_item_set_attribute (header, "x-canonical-accessible-description", "s", _("Messages"));
g_menu_append_item (toplevel_menu, header);
g_object_unref (header);
@@ -518,6 +523,8 @@ main (int argc, char ** argv)
g_main_loop_run(mainloop);
/* Clean up */
+ g_free (iconstr);
+ g_object_unref (icon);
g_object_unref (messages_service);
g_object_unref (chat_section);
g_object_unref (settings);