# HG changeset patch # User Sadrul Habib Chowdhury # Date 1162137545 0 # Node ID 2405b9e6f05f25f0dbb60f1b28804f0b40c3b534 # Parent 7cf437793f160df42be428612601ce7eaa910946 [gaim-migrate @ 17619] Add submenus in the context-menu when necessary. committer: Tailor Script diff -r 7cf437793f16 -r 2405b9e6f05f console/gntblist.c --- 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