# HG changeset patch # User Sadrul Habib Chowdhury # Date 1189603452 0 # Node ID 41cad24fd6df29836ce8be4732c5c4c54860c13f # Parent 6060bc0a8ccaf310a2cbc5b70d8a9fdceb32ce9f Instead of just notifying the user about a connection error, give him options to re-enable the account, or change account settings. (This does not introduce any new strings) diff -r 6060bc0a8cca -r 41cad24fd6df ChangeLog.API --- a/ChangeLog.API Wed Sep 12 12:20:49 2007 +0000 +++ b/ChangeLog.API Wed Sep 12 13:24:12 2007 +0000 @@ -43,6 +43,7 @@ * finch_sound_is_enabled * The reserved field in the FinchConv is now used to store information about the conversation (using FinchConversationFlag) + * finch_account_dialog_show libgnt: * gnt_slider_set_small_step, gnt_slider_set_large_step to allow more diff -r 6060bc0a8cca -r 41cad24fd6df finch/gntaccount.c --- a/finch/gntaccount.c Wed Sep 12 12:20:49 2007 +0000 +++ b/finch/gntaccount.c Wed Sep 12 13:24:12 2007 +0000 @@ -715,6 +715,11 @@ gnt_widget_show(accounts.window); } +void finch_account_dialog_show(PurpleAccount *account) +{ + edit_account(account); +} + static gpointer finch_accounts_get_handle() { diff -r 6060bc0a8cca -r 41cad24fd6df finch/gntaccount.h --- a/finch/gntaccount.h Wed Sep 12 12:20:49 2007 +0000 +++ b/finch/gntaccount.h Wed Sep 12 13:24:12 2007 +0000 @@ -54,6 +54,13 @@ */ void finch_accounts_show_all(void); +/** + * Show the edit dialog for an account. + * + * @param account The account to edit, or @c NULL to create a new account. + */ +void finch_account_dialog_show(PurpleAccount *account); + /*@}*/ #endif diff -r 6060bc0a8cca -r 41cad24fd6df finch/gntconn.c --- a/finch/gntconn.c Wed Sep 12 12:20:49 2007 +0000 +++ b/finch/gntconn.c Wed Sep 12 13:24:12 2007 +0000 @@ -30,6 +30,7 @@ #include "debug.h" #include "request.h" +#include "gntaccount.h" #include "gntconn.h" #define INITIAL_RECON_DELAY_MIN 8000 @@ -87,6 +88,18 @@ } static void +ce_modify_account_cb(PurpleAccount *account) +{ + finch_account_dialog_show(account); +} + +static void +ce_enable_account_cb(PurpleAccount *account) +{ + purple_account_set_enabled(account, FINCH_UI, TRUE); +} + +static void finch_connection_report_disconnect(PurpleConnection *gc, const char *text) { FinchAutoRecon *info; @@ -114,7 +127,13 @@ secondary = g_strdup_printf(_("%s\n\n" "Finch will not attempt to reconnect the account until you " "correct the error and re-enable the account."), text); - purple_notify_error(NULL, NULL, primary, secondary); + + purple_request_action(account, NULL, primary, secondary, 2, + account, NULL, NULL, + account, 3, + _("OK"), NULL, + _("Modify Account"), PURPLE_CALLBACK(ce_modify_account_cb), + _("Re-enable Account"), PURPLE_CALLBACK(ce_enable_account_cb)); g_free(act); g_free(primary);