changeset 14850:2405b9e6f05f

[gaim-migrate @ 17619] Add submenus in the context-menu when necessary. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 29 Oct 2006 15:59:05 +0000
parents 7cf437793f16
children 036927fddcba
files console/gntblist.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/console/gntblist.c	Sun Oct 29 14:51:20 2006 +0000
+++ b/console/gntblist.c	Sun Oct 29 15:59:05 2006 +0000
@@ -643,11 +643,16 @@
 		return;
 
 	item = gnt_menuitem_new(action->label);
-	gnt_menuitem_set_callback(GNT_MENUITEM(item), context_menu_callback, action);
+	if (action->callback)
+		gnt_menuitem_set_callback(GNT_MENUITEM(item), context_menu_callback, action);
 	gnt_menu_add_item(menu, GNT_MENUITEM(item));
 
-	for (list = action->children; list; list = list->next)
-		gnt_append_menu_action(menu, list->data, action);
+	if (action->children) {
+		GntWidget *sub = gnt_menu_new(GNT_MENU_POPUP);
+		gnt_menuitem_set_submenu(item, GNT_MENU(sub));
+		for (list = action->children; list; list = list->next)
+			gnt_append_menu_action(GNT_MENU(sub), list->data, action);
+	}
 }
 
 static void