diff options
author | Ted Gould <ted@gould.cx> | 2013-08-20 16:16:34 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2013-08-20 16:16:34 -0500 |
commit | 3f6abe759b6976d606f97b894c02b68e1c0d9254 (patch) | |
tree | 50139ded098a6ebed36833c8f3069dbbb36c7faa /src/im-desktop-menu.c | |
parent | 0bd953b0ca74c8ae50b8eb907b081d61cc8bad10 (diff) | |
download | ayatana-indicator-messages-3f6abe759b6976d606f97b894c02b68e1c0d9254.tar.gz ayatana-indicator-messages-3f6abe759b6976d606f97b894c02b68e1c0d9254.tar.bz2 ayatana-indicator-messages-3f6abe759b6976d606f97b894c02b68e1c0d9254.zip |
Putting shortcuts into the menu
Diffstat (limited to 'src/im-desktop-menu.c')
-rw-r--r-- | src/im-desktop-menu.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/im-desktop-menu.c b/src/im-desktop-menu.c index e68d086..3309dad 100644 --- a/src/im-desktop-menu.c +++ b/src/im-desktop-menu.c @@ -18,6 +18,7 @@ */ #include "im-desktop-menu.h" +#include "indicator-desktop-shortcuts.h" #include <glib/gi18n.h> typedef ImMenuClass ImDesktopMenuClass; @@ -66,21 +67,28 @@ im_desktop_menu_app_added (ImApplicationList *applist, } /* application actions */ -#if 0 { - const gchar *const *actions; + const gchar * filename = NULL; + IndicatorDesktopShortcuts * shortcuts = NULL; + const gchar ** nicks = {NULL}; - for (actions = g_desktop_app_info_list_actions (app_info); *actions; actions++) - { - gchar *label; + filename = g_desktop_app_info_get_filename(app_info); + if (filename != NULL) + shortcuts = indicator_desktop_shortcuts_new(filename, "Messaging Menu"); - label = g_desktop_app_info_get_action_name (app_info, *actions); - g_menu_append (app_section, label, *actions); + if (shortcuts != NULL) + for (nicks = indicator_desktop_shortcuts_get_nicks(shortcuts); *nicks; nicks++) + { + gchar *label; - g_free (label); - } + label = indicator_desktop_shortcuts_nick_get_name (shortcuts, *nicks); + g_menu_append (app_section, label, *nicks); + + g_free (label); + } + + g_clear_object(&shortcuts); } -#endif source_section = g_menu_new (); |