Mercurial > pidgin
comparison src/blist.c @ 10662:54ac161a876e
[gaim-migrate @ 12199]
Plugins can now add submenus to the right-click menu of a blist node by passing a GList of actions to gaim_blist_node_action_new. I'm thinking about making GaimBlistNodeActions more like plugin prefs so that plugins can create radio and check menu items as well. We'll see if I can do that and not make it ugly/suck.
committer: Tailor Script <tailor@pidgin.im>
author | Etan Reisner <pidgin@unreliablesource.net> |
---|---|
date | Mon, 07 Mar 2005 02:19:09 +0000 |
parents | 54f7939df8e3 |
children | a4ae4fb7f939 |
comparison
equal
deleted
inserted
replaced
10661:f02873d475dc | 10662:54ac161a876e |
---|---|
2458 g_return_val_if_fail(gaim_value_get_type(value) == GAIM_TYPE_STRING, NULL); | 2458 g_return_val_if_fail(gaim_value_get_type(value) == GAIM_TYPE_STRING, NULL); |
2459 | 2459 |
2460 return gaim_value_get_string(value); | 2460 return gaim_value_get_string(value); |
2461 } | 2461 } |
2462 | 2462 |
2463 GList *gaim_blist_node_get_extended_menu(GaimBlistNode *n) | 2463 GList * |
2464 gaim_blist_node_get_extended_menu(GaimBlistNode *n) | |
2464 { | 2465 { |
2465 GList *menu = NULL; | 2466 GList *menu = NULL; |
2466 | 2467 |
2467 g_return_val_if_fail(n, NULL); | 2468 g_return_val_if_fail(n != NULL, NULL); |
2468 | 2469 |
2469 gaim_signal_emit(gaim_blist_get_handle(), | 2470 gaim_signal_emit(gaim_blist_get_handle(), |
2470 "blist-node-extended-menu", | 2471 "blist-node-extended-menu", |
2471 n, &menu); | 2472 n, &menu); |
2472 return menu; | 2473 return menu; |
2473 } | 2474 } |
2474 | 2475 |
2475 GaimBlistNodeAction * | 2476 GaimBlistNodeAction * |
2476 gaim_blist_node_action_new(char *label, | 2477 gaim_blist_node_action_new(char *label, |
2477 void (*callback)(GaimBlistNode *, gpointer), | 2478 void (*callback)(GaimBlistNode *, gpointer), |
2478 gpointer data) | 2479 gpointer data, GList *children) |
2479 { | 2480 { |
2480 GaimBlistNodeAction *act = g_new0(GaimBlistNodeAction, 1); | 2481 GaimBlistNodeAction *act = g_new0(GaimBlistNodeAction, 1); |
2481 act->label = label; | 2482 act->label = label; |
2482 act->callback = callback; | 2483 act->callback = callback; |
2483 act->data = data; | 2484 act->data = data; |
2485 act->children = children; | |
2484 return act; | 2486 return act; |
2485 } | 2487 } |
2486 | 2488 |
2487 int gaim_blist_get_group_size(GaimGroup *group, gboolean offline) | 2489 int gaim_blist_get_group_size(GaimGroup *group, gboolean offline) |
2488 { | 2490 { |