# HG changeset patch # User Richard Laager # Date 1140575063 0 # Node ID d65250edebe0344293fe47fd6d02938ac747ca64 # Parent b12427d2994e366e43f411433f89cf5b1350d8cb [gaim-migrate @ 15681] SF Patch #1435616 from Sadrul "If an account is disconnected/disabled, then the connection-error dialog that pops up when you click on the error-notifier button in the buddy-list will have the options to `Modify Account' and `Enable Account' (if the account is disabled) or `Connect' (if just disconnected)." I like this, as I can do something from that dialog now. committer: Tailor Script diff -r b12427d2994e -r d65250edebe0 src/gtkblist.c --- a/src/gtkblist.c Wed Feb 22 02:11:02 2006 +0000 +++ b/src/gtkblist.c Wed Feb 22 02:24:23 2006 +0000 @@ -3471,6 +3471,18 @@ /***********************************/ static void +ce_modify_account_cb(GaimAccount *account) +{ + gaim_gtk_account_dialog_show(GAIM_GTK_MODIFY_ACCOUNT_DIALOG, account); +} + +static void +ce_enable_account_cb(GaimAccount *account) +{ + gaim_account_set_enabled(account, gaim_core_get_ui(), TRUE); +} + +static void connection_error_button_clicked_cb(GtkButton *widget, gpointer user_data) { GaimAccount *account; @@ -3481,8 +3493,23 @@ primary = g_strdup_printf(_("%s disconnected"), gaim_account_get_username(account)); text = g_hash_table_lookup(gtkblist->connection_errors, account); - gaim_notify_formatted(NULL, _("Connection Error"), - primary, NULL, text, NULL, NULL); + + 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(NULL, _("Connection Error"), primary, text, 2, + account, 3, + _("OK"), NULL, + _("Modify Account"), GAIM_CALLBACK(ce_modify_account_cb), + enabled ? _("Connect") : _("Enable Account"), + enabled ? GAIM_CALLBACK(gaim_account_connect) : + GAIM_CALLBACK(ce_enable_account_cb)); + } gtk_widget_destroy(GTK_WIDGET(widget)); g_hash_table_remove(gtkblist->connection_errors, account); }