finch/gntconn.c

changeset 19969
53aca1037b2c
parent 19859
71d37b57eff2
child 20004
1f294c8fa7bc
child 20147
66f05a854eee
child 20315
21fbfe31160a
equal deleted inserted replaced
19966:a9ae1df22872 19969:53aca1037b2c
28 #include "core.h" 28 #include "core.h"
29 #include "connection.h" 29 #include "connection.h"
30 #include "debug.h" 30 #include "debug.h"
31 #include "request.h" 31 #include "request.h"
32 32
33 #include "gntaccount.h"
33 #include "gntconn.h" 34 #include "gntconn.h"
34 35
35 #define INITIAL_RECON_DELAY_MIN 8000 36 #define INITIAL_RECON_DELAY_MIN 8000
36 #define INITIAL_RECON_DELAY_MAX 60000 37 #define INITIAL_RECON_DELAY_MAX 60000
37 38
85 86
86 return FALSE; 87 return FALSE;
87 } 88 }
88 89
89 static void 90 static void
91 ce_modify_account_cb(PurpleAccount *account)
92 {
93 finch_account_dialog_show(account);
94 }
95
96 static void
97 ce_enable_account_cb(PurpleAccount *account)
98 {
99 purple_account_set_enabled(account, FINCH_UI, TRUE);
100 }
101
102 static void
90 finch_connection_report_disconnect(PurpleConnection *gc, const char *text) 103 finch_connection_report_disconnect(PurpleConnection *gc, const char *text)
91 { 104 {
92 FinchAutoRecon *info; 105 FinchAutoRecon *info;
93 PurpleAccount *account = purple_connection_get_account(gc); 106 PurpleAccount *account = purple_connection_get_account(gc);
94 107
112 125
113 primary = g_strdup_printf(_("%s disconnected."), act); 126 primary = g_strdup_printf(_("%s disconnected."), act);
114 secondary = g_strdup_printf(_("%s\n\n" 127 secondary = g_strdup_printf(_("%s\n\n"
115 "Finch will not attempt to reconnect the account until you " 128 "Finch will not attempt to reconnect the account until you "
116 "correct the error and re-enable the account."), text); 129 "correct the error and re-enable the account."), text);
117 purple_notify_error(NULL, NULL, primary, secondary); 130
131 purple_request_action(account, NULL, primary, secondary, 2,
132 account, NULL, NULL,
133 account, 3,
134 _("OK"), NULL,
135 _("Modify Account"), PURPLE_CALLBACK(ce_modify_account_cb),
136 _("Re-enable Account"), PURPLE_CALLBACK(ce_enable_account_cb));
118 137
119 g_free(act); 138 g_free(act);
120 g_free(primary); 139 g_free(primary);
121 g_free(secondary); 140 g_free(secondary);
122 purple_account_set_enabled(account, FINCH_UI, FALSE); 141 purple_account_set_enabled(account, FINCH_UI, FALSE);

mercurial