Mercurial > pidgin
comparison src/gtkblist.c @ 12070:e4666705944b
[gaim-migrate @ 14365]
patches [ 1353462 ] account-disabled/enabled signals, use them in account dialog
and [ 1355690 ] Add/remove statusbox when accounts are enabled/disabled
some parts of the first one didn't apply, but they were doc changes, so
i figured charkins could diff them.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Sun, 13 Nov 2005 03:45:16 +0000 |
parents | ac18b43b0495 |
children | 3b52d94437f3 |
comparison
equal
deleted
inserted
replaced
12069:1019f1d510d6 | 12070:e4666705944b |
---|---|
3245 g_free(normalized); | 3245 g_free(normalized); |
3246 | 3246 |
3247 return result; | 3247 return result; |
3248 } | 3248 } |
3249 | 3249 |
3250 static void account_enabled(GaimAccount *account, GaimGtkBuddyList *gtkblist) | |
3251 { | |
3252 GtkWidget *box; | |
3253 | |
3254 if (!gtkblist) | |
3255 return; | |
3256 | |
3257 box = gtk_gaim_status_box_new_with_account(account); | |
3258 gtkblist->statusboxes = g_list_append(gtkblist->statusboxes, box); | |
3259 gtk_box_pack_start(GTK_BOX(gtkblist->statusboxbox), box, FALSE, TRUE, 0); | |
3260 gtk_widget_show(box); | |
3261 } | |
3262 | |
3263 static void account_disabled(GaimAccount *account, GaimGtkBuddyList *gtkblist) | |
3264 { | |
3265 GList *iter; | |
3266 | |
3267 if (!gtkblist) | |
3268 return; | |
3269 | |
3270 for (iter = gtkblist->statusboxes; iter; iter = iter->next) | |
3271 { | |
3272 GtkWidget *box = iter->data; | |
3273 GaimAccount *ac = NULL; | |
3274 | |
3275 g_object_get(G_OBJECT(box), "account", &ac, NULL); | |
3276 if (ac == account) | |
3277 { | |
3278 gtkblist->statusboxes = g_list_remove_link(gtkblist->statusboxes, iter); | |
3279 gtk_widget_destroy(box); | |
3280 break; | |
3281 } | |
3282 } | |
3283 } | |
3284 | |
3250 static void gaim_gtk_blist_show(GaimBuddyList *list) | 3285 static void gaim_gtk_blist_show(GaimBuddyList *list) |
3251 { | 3286 { |
3252 void *handle; | 3287 void *handle; |
3253 GtkCellRenderer *rend; | 3288 GtkCellRenderer *rend; |
3254 GtkTreeViewColumn *column; | 3289 GtkTreeViewColumn *column; |
3478 gaim_gtk_blist_mute_pref_cb, NULL); | 3513 gaim_gtk_blist_mute_pref_cb, NULL); |
3479 gaim_prefs_connect_callback(handle, "/gaim/gtk/sound/method", | 3514 gaim_prefs_connect_callback(handle, "/gaim/gtk/sound/method", |
3480 gaim_gtk_blist_sound_method_pref_cb, NULL); | 3515 gaim_gtk_blist_sound_method_pref_cb, NULL); |
3481 | 3516 |
3482 /* Setup some gaim signal handlers. */ | 3517 /* Setup some gaim signal handlers. */ |
3518 gaim_signal_connect(gaim_accounts_get_handle(), "account-disabled", | |
3519 gtkblist, GAIM_CALLBACK(account_disabled), gtkblist); | |
3520 gaim_signal_connect(gaim_accounts_get_handle(), "account-enabled", | |
3521 gtkblist, GAIM_CALLBACK(account_enabled), gtkblist); | |
3522 | |
3483 gaim_signal_connect(gaim_connections_get_handle(), "signed-on", | 3523 gaim_signal_connect(gaim_connections_get_handle(), "signed-on", |
3484 gtkblist, GAIM_CALLBACK(sign_on_off_cb), list); | 3524 gtkblist, GAIM_CALLBACK(sign_on_off_cb), list); |
3485 gaim_signal_connect(gaim_connections_get_handle(), "signed-off", | 3525 gaim_signal_connect(gaim_connections_get_handle(), "signed-off", |
3486 gtkblist, GAIM_CALLBACK(sign_on_off_cb), list); | 3526 gtkblist, GAIM_CALLBACK(sign_on_off_cb), list); |
3487 | 3527 |