From c271f6dbdc98ab96f10b4f1cbe82e3133c8254dc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 17 Feb 2010 13:09:06 -0600 Subject: Adding the shortcuts into the menuhandling code. --- src/messages-service.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/messages-service.c b/src/messages-service.c index 52e9a48..2893313 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -800,6 +800,15 @@ resort_menu (DbusmenuMenuitem * menushell) dbusmenu_menuitem_child_reorder(DBUSMENU_MENUITEM(menushell), DBUSMENU_MENUITEM(li->menuitem), position); position++; + /* Inserting the shortcuts from the launcher */ + GList * shortcuts = launcher_menu_item_get_items(li->menuitem); + while (shortcuts != NULL) { + g_debug("\t\tMoving shortcut to position %d", position); + dbusmenu_menuitem_child_reorder(DBUSMENU_MENUITEM(menushell), DBUSMENU_MENUITEM(shortcuts->data), position); + position++; + shortcuts = g_list_next(shortcuts); + } + /* Putting the launcher separator in */ g_debug("\tMoving launcher separator to position %d", position); dbusmenu_menuitem_child_reorder(DBUSMENU_MENUITEM(menushell), DBUSMENU_MENUITEM(li->separator), position); @@ -856,6 +865,15 @@ resort_menu (DbusmenuMenuitem * menushell) dbusmenu_menuitem_child_reorder(DBUSMENU_MENUITEM(menushell), DBUSMENU_MENUITEM(li->menuitem), position); position++; + /* Inserting the shortcuts from the launcher */ + GList * shortcuts = launcher_menu_item_get_items(li->menuitem); + while (shortcuts != NULL) { + g_debug("\t\tMoving shortcut to position %d", position); + dbusmenu_menuitem_child_reorder(DBUSMENU_MENUITEM(menushell), DBUSMENU_MENUITEM(shortcuts->data), position); + position++; + shortcuts = g_list_next(shortcuts); + } + /* Putting the launcher separator in */ g_debug("\tMoving launcher separator to position %d", position); dbusmenu_menuitem_child_reorder(DBUSMENU_MENUITEM(menushell), DBUSMENU_MENUITEM(li->separator), position); @@ -1247,6 +1265,11 @@ build_launcher_core (const gchar * desktop) /* Add it to the menu */ dbusmenu_menuitem_child_append(root_menuitem, DBUSMENU_MENUITEM(ll->menuitem)); + GList * shortcuts = launcher_menu_item_get_items(li->menuitem); + while (shortcuts != NULL) { + dbusmenu_menuitem_child_append(root_menuitem, DBUSMENU_MENUITEM(shortcuts->data)); + shortcuts = g_list_next(shortcuts); + } dbusmenu_menuitem_child_append(root_menuitem, DBUSMENU_MENUITEM(ll->separator)); /* If we're in the black list or we've gotten eclipsed -- cgit v1.2.3