diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-11-28 13:29:15 +0100 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-11-28 13:29:15 +0100 |
commit | 83598a9e4fe059703faa806e7a9cdab1e6cb293c (patch) | |
tree | 3200ae6cb46507b060fde2cdf552cc7d8de1423f /src/im-application-list.c | |
parent | c9ddfbead428ec96459cd80b57aba6ad6ed0492a (diff) | |
download | ayatana-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.c | 15 |
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); } |