aboutsummaryrefslogtreecommitdiff
path: root/src/messages-service.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/messages-service.c')
-rw-r--r--src/messages-service.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/messages-service.c b/src/messages-service.c
index 31d2a5b..15c5123 100644
--- a/src/messages-service.c
+++ b/src/messages-service.c
@@ -406,14 +406,33 @@ static GMenuModel *
create_status_section (void)
{
GMenu *menu;
+ GMenuItem *item;
+ struct status_item {
+ gchar *label;
+ gchar *action;
+ gchar *icon_name;
+ } status_items[] = {
+ { _("Available"), "status::available", "user-available" },
+ { _("Away"), "status::away", "user-away" },
+ { _("Busy"), "status::busy", "user-busy" },
+ { _("Invisible"), "status::invisible", "user-invisible" },
+ { _("Offline"), "status::offline", "user-offline" }
+ };
+ int i;
menu = g_menu_new ();
- g_menu_append_with_icon_name (menu, _("Available"), "user-available", "status::available");
- g_menu_append_with_icon_name (menu, _("Away"), "user-away", "status::away");
- g_menu_append_with_icon_name (menu, _("Busy"), "user-busy", "status::busy");
- g_menu_append_with_icon_name (menu, _("Invisible"), "user-invisible", "status::invisible");
- g_menu_append_with_icon_name (menu, _("Offline"), "user-offline", "status::offline");
+ item = g_menu_item_new (NULL, NULL);
+ g_menu_item_set_attribute (item, "x-canonical-type", "s", "IdoMenuItem");
+
+ for (i = 0; i < G_N_ELEMENTS (status_items); i++) {
+ g_menu_item_set_label (item, status_items[i].label);
+ g_menu_item_set_detailed_action (item, status_items[i].action);
+ g_menu_item_set_attribute (item, "x-canonical-icon", "s", status_items[i].icon_name);
+ g_menu_append_item (menu, item);
+ }
+
+ g_object_unref (item);
return G_MENU_MODEL (menu);
}