Mercurial > pidgin.yaz
diff src/gtkutils.c @ 8134:ea3eb461efc0
[gaim-migrate @ 8839]
this makes the nifty account dropdowns reflect changes when an account is added or removed
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sat, 17 Jan 2004 19:21:39 +0000 |
parents | ea073d234191 |
children | 4971193f761d |
line wrap: on
line diff
--- a/src/gtkutils.c Sat Jan 17 17:43:32 2004 +0000 +++ b/src/gtkutils.c Sat Jan 17 19:21:39 2004 +0000 @@ -873,7 +873,7 @@ } static void -account_menu_sign_on_off_cb(GaimConnection *gc, GtkWidget *optmenu) +regenerate_account_menu(GtkWidget *optmenu) { GtkWidget *menu; GtkWidget *item; @@ -896,6 +896,18 @@ create_account_menu(optmenu, account, check_account_func, show_all); } +static void +account_menu_sign_on_off_cb(GaimConnection *gc, GtkWidget *optmenu) +{ + regenerate_account_menu(optmenu); +} + +static void +account_menu_added_removed_cb(GaimAccount *account, GtkWidget *optmenu) +{ + regenerate_account_menu(optmenu); +} + static gboolean account_menu_destroyed_cb(GtkWidget *optmenu, GdkEvent *event, void *user_data) @@ -927,6 +939,12 @@ gaim_signal_connect(gaim_connections_get_handle(), "signed-off", optmenu, GAIM_CALLBACK(account_menu_sign_on_off_cb), optmenu); + gaim_signal_connect(gaim_accounts_get_handle(), "account-added", + optmenu, GAIM_CALLBACK(account_menu_added_removed_cb), + optmenu); + gaim_signal_connect(gaim_accounts_get_handle(), "account-removed", + optmenu, GAIM_CALLBACK(account_menu_added_removed_cb), + optmenu); /* Set some data. */ g_object_set_data(G_OBJECT(optmenu), "user_data", user_data);