Mercurial > pidgin
changeset 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 | 74033e0831bc |
children | e27f42866854 |
files | src/gtkblist.c src/gtkconn.c |
diffstat | 2 files changed, 12 insertions(+), 39 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gtkblist.c Sun May 07 17:40:42 2006 +0000 +++ b/src/gtkblist.c Sun May 07 18:04:24 2006 +0000 @@ -3527,28 +3527,21 @@ GaimAccount *account; char *primary; const char *text; + gboolean enabled; account = user_data; primary = g_strdup_printf(_("%s disconnected"), gaim_account_get_username(account)); text = g_hash_table_lookup(gtkblist->connection_errors, account); - if (gaim_account_is_connected(account)) - { - gaim_notify_formatted(NULL, _("Connection Error"), - primary, NULL, text, NULL, NULL); - } - else - { - gboolean enabled = gaim_account_get_enabled(account, gaim_core_get_ui()); - gaim_request_action(account, _("Connection Error"), primary, text, 2, - account, 3, - _("OK"), NULL, - _("Modify Account"), GAIM_CALLBACK(ce_modify_account_cb), - enabled ? _("Connect") : _("Re-enable Account"), - enabled ? GAIM_CALLBACK(gaim_account_connect) : - GAIM_CALLBACK(ce_enable_account_cb)); - } + enabled = gaim_account_get_enabled(account, gaim_core_get_ui()); + gaim_request_action(account, _("Connection Error"), primary, text, 2, + account, 3, + _("OK"), NULL, + _("Modify Account"), GAIM_CALLBACK(ce_modify_account_cb), + enabled ? _("Connect") : _("Re-enable Account"), + enabled ? GAIM_CALLBACK(gaim_account_connect) : + GAIM_CALLBACK(ce_enable_account_cb)); g_free(primary); gtk_widget_destroy(GTK_WIDGET(widget)); g_hash_table_remove(gtkblist->connection_errors, account);
--- a/src/gtkconn.c Sun May 07 17:40:42 2006 +0000 +++ b/src/gtkconn.c Sun May 07 18:04:24 2006 +0000 @@ -51,7 +51,6 @@ * value is a pointer to a GaimAutoRecon. */ static GHashTable *hash = NULL; -static GHashTable *errored_accounts = NULL; static void gaim_gtk_connection_connect_progress(GaimConnection *gc, @@ -64,7 +63,7 @@ (gaim_connections_get_connecting() != NULL)); gtk_gaim_status_box_pulse_connecting(GTK_GAIM_STATUS_BOX(gtkblist->statusbox)); } - +\ static void gaim_gtk_connection_connected(GaimConnection *gc) { @@ -81,11 +80,7 @@ if (hash != NULL) g_hash_table_remove(hash, account); - if (g_hash_table_size(errored_accounts) > 0) - { - g_hash_table_remove(errored_accounts, account); - gaim_gtk_blist_update_account_error_state(account, NULL); - } + gaim_gtk_blist_update_account_error_state(account, NULL); } static void @@ -151,11 +146,9 @@ { GaimAccount *account = NULL; GaimAutoRecon *info; - GSList* errored_account; account = gaim_connection_get_account(gc); info = g_hash_table_lookup(hash, account); - errored_account = g_hash_table_lookup(errored_accounts, account); gaim_gtk_blist_update_account_error_state(account, text); if (!gc->wants_to_die) { @@ -169,16 +162,11 @@ g_source_remove(info->timeout); } info->timeout = g_timeout_add(info->delay, do_signon, account); - - g_hash_table_insert(errored_accounts, account, NULL); } else { char *p, *s, *n=NULL ; if (info != NULL) g_hash_table_remove(hash, account); - if (errored_account != NULL) - g_hash_table_remove(errored_accounts, errored_account); - if (gaim_account_get_alias(account)) { n = g_strdup_printf("%s (%s) (%s)", @@ -231,11 +219,7 @@ { g_hash_table_remove(hash, account); - if (g_hash_table_size(errored_accounts) > 0) - { - g_hash_table_remove(errored_accounts, account); - gaim_gtk_blist_update_account_error_state(account, NULL); - } + gaim_gtk_blist_update_account_error_state(account, NULL); } @@ -257,9 +241,6 @@ hash = g_hash_table_new_full( g_direct_hash, g_direct_equal, NULL, free_auto_recon); - errored_accounts = g_hash_table_new_full( - g_direct_hash, g_direct_equal, - NULL, NULL); gaim_signal_connect(gaim_accounts_get_handle(), "account-removed", gaim_gtk_connection_get_handle(), @@ -272,5 +253,4 @@ gaim_signals_disconnect_by_handle(gaim_gtk_connection_get_handle()); g_hash_table_destroy(hash); - g_hash_table_destroy(errored_accounts); }