comparison src/gtkblist.c @ 13730:2eea3265dbe6

[gaim-migrate @ 16141] Correctly remove the disconnected button when the account successfully connections. This might have only been a problem when the account wanted_to_die committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 07 May 2006 18:04:24 +0000
parents 5fb687f9965c
children 7925c5d81ecf
comparison
equal deleted inserted replaced
13729:74033e0831bc 13730:2eea3265dbe6
3525 connection_error_button_clicked_cb(GtkButton *widget, gpointer user_data) 3525 connection_error_button_clicked_cb(GtkButton *widget, gpointer user_data)
3526 { 3526 {
3527 GaimAccount *account; 3527 GaimAccount *account;
3528 char *primary; 3528 char *primary;
3529 const char *text; 3529 const char *text;
3530 gboolean enabled;
3530 3531
3531 account = user_data; 3532 account = user_data;
3532 primary = g_strdup_printf(_("%s disconnected"), 3533 primary = g_strdup_printf(_("%s disconnected"),
3533 gaim_account_get_username(account)); 3534 gaim_account_get_username(account));
3534 text = g_hash_table_lookup(gtkblist->connection_errors, account); 3535 text = g_hash_table_lookup(gtkblist->connection_errors, account);
3535 3536
3536 if (gaim_account_is_connected(account)) 3537 enabled = gaim_account_get_enabled(account, gaim_core_get_ui());
3537 { 3538 gaim_request_action(account, _("Connection Error"), primary, text, 2,
3538 gaim_notify_formatted(NULL, _("Connection Error"), 3539 account, 3,
3539 primary, NULL, text, NULL, NULL); 3540 _("OK"), NULL,
3540 } 3541 _("Modify Account"), GAIM_CALLBACK(ce_modify_account_cb),
3541 else 3542 enabled ? _("Connect") : _("Re-enable Account"),
3542 { 3543 enabled ? GAIM_CALLBACK(gaim_account_connect) :
3543 gboolean enabled = gaim_account_get_enabled(account, gaim_core_get_ui()); 3544 GAIM_CALLBACK(ce_enable_account_cb));
3544 gaim_request_action(account, _("Connection Error"), primary, text, 2,
3545 account, 3,
3546 _("OK"), NULL,
3547 _("Modify Account"), GAIM_CALLBACK(ce_modify_account_cb),
3548 enabled ? _("Connect") : _("Re-enable Account"),
3549 enabled ? GAIM_CALLBACK(gaim_account_connect) :
3550 GAIM_CALLBACK(ce_enable_account_cb));
3551 }
3552 g_free(primary); 3545 g_free(primary);
3553 gtk_widget_destroy(GTK_WIDGET(widget)); 3546 gtk_widget_destroy(GTK_WIDGET(widget));
3554 g_hash_table_remove(gtkblist->connection_errors, account); 3547 g_hash_table_remove(gtkblist->connection_errors, account);
3555 } 3548 }
3556 3549