aboutsummaryrefslogtreecommitdiff
path: root/src/im-application-list.c
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2012-11-28 13:29:15 +0100
committerLars Uebernickel <lars.uebernickel@canonical.com>2012-11-28 13:29:15 +0100
commit83598a9e4fe059703faa806e7a9cdab1e6cb293c (patch)
tree3200ae6cb46507b060fde2cdf552cc7d8de1423f /src/im-application-list.c
parentc9ddfbead428ec96459cd80b57aba6ad6ed0492a (diff)
downloadayatana-indicator-messages-83598a9e4fe059703faa806e7a9cdab1e6cb293c.tar.gz
ayatana-indicator-messages-83598a9e4fe059703faa806e7a9cdab1e6cb293c.tar.bz2
ayatana-indicator-messages-83598a9e4fe059703faa806e7a9cdab1e6cb293c.zip
Add root menu item
The action for that root item lives in ImApplicationList for now, because it owns the action group (which should probably factored into its own class at some point).
Diffstat (limited to 'src/im-application-list.c')
-rw-r--r--src/im-application-list.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/im-application-list.c b/src/im-application-list.c
index d766f24..c5e34b7 100644
--- a/src/im-application-list.c
+++ b/src/im-application-list.c
@@ -304,22 +304,21 @@ im_application_list_class_init (ImApplicationListClass *klass)
static void
im_application_list_init (ImApplicationList *list)
{
+ const GActionEntry action_entries[] = {
+ { "messages", NULL, NULL, "('', 'indicator-messages', 'Messages', true)", NULL },
+ { "remove-all", im_application_list_remove_all }
+ };
+
GSimpleActionGroup *actions;
- GSimpleAction *remove_all_action;
list->applications = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, application_free);
- list->muxer = g_action_muxer_new ();
actions = g_simple_action_group_new ();
+ g_simple_action_group_add_entries (actions, action_entries, G_N_ELEMENTS (action_entries), list);
- remove_all_action = g_simple_action_new ("remove-all", NULL);
- g_signal_connect (remove_all_action, "activate", G_CALLBACK (im_application_list_remove_all), list);
-
- g_simple_action_group_insert (actions, G_ACTION (remove_all_action));
-
+ list->muxer = g_action_muxer_new ();
g_action_muxer_insert (list->muxer, NULL, G_ACTION_GROUP (actions));
- g_object_unref (remove_all_action);
g_object_unref (actions);
}