From 3f6abe759b6976d606f97b894c02b68e1c0d9254 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 20 Aug 2013 16:16:34 -0500 Subject: Putting shortcuts into the menu --- src/im-desktop-menu.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'src/im-desktop-menu.c') 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 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 (); -- cgit v1.2.3