| |
1 /** |
| |
2 * @file gntconn.c GNT Connection API |
| |
3 * @ingroup gntui |
| |
4 * |
| |
5 * gaim |
| |
6 * |
| |
7 * Gaim is the legal property of its developers, whose names are too numerous |
| |
8 * to list here. Please refer to the COPYRIGHT file distributed with this |
| |
9 * source distribution. |
| |
10 * |
| |
11 * This program is free software; you can redistribute it and/or modify |
| |
12 * it under the terms of the GNU General Public License as published by |
| |
13 * the Free Software Foundation; either version 2 of the License, or |
| |
14 * (at your option) any later version. |
| |
15 * |
| |
16 * This program is distributed in the hope that it will be useful, |
| |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| |
19 * GNU General Public License for more details. |
| |
20 * |
| |
21 * You should have received a copy of the GNU General Public License |
| |
22 * along with this program; if not, write to the Free Software |
| |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| |
24 */ |
| |
25 #include "account.h" |
| |
26 #include "core.h" |
| |
27 #include "request.h" |
| |
28 |
| |
29 #include "gntconn.h" |
| |
30 #include "gntgaim.h" |
| |
31 |
| |
32 static void |
| |
33 finch_connection_report_disconnect(GaimConnection *gc, const char *text) |
| |
34 { |
| |
35 char *act, *primary, *secondary; |
| |
36 GaimAccount *account = gaim_connection_get_account(gc); |
| |
37 |
| |
38 act = g_strdup_printf(_("%s (%s)"), gaim_account_get_username(account), |
| |
39 gaim_account_get_protocol_name(account)); |
| |
40 |
| |
41 primary = g_strdup_printf(_("%s disconnected."), act); |
| |
42 secondary = g_strdup_printf(_("%s was disconnected due to the following error:\n%s"), |
| |
43 act, text); |
| |
44 |
| |
45 gaim_request_action(account, _("Connection Error"), primary, secondary, 1, |
| |
46 account, 2, |
| |
47 _("OK"), NULL, |
| |
48 _("Connect"), |
| |
49 GAIM_CALLBACK(gaim_account_connect)); |
| |
50 |
| |
51 g_free(act); |
| |
52 g_free(primary); |
| |
53 g_free(secondary); |
| |
54 } |
| |
55 |
| |
56 static GaimConnectionUiOps ops = |
| |
57 { |
| |
58 .connect_progress = NULL, |
| |
59 .connected = NULL, |
| |
60 .disconnected = NULL, |
| |
61 .notice = NULL, |
| |
62 .report_disconnect = finch_connection_report_disconnect |
| |
63 }; |
| |
64 |
| |
65 GaimConnectionUiOps *finch_connections_get_ui_ops() |
| |
66 { |
| |
67 return &ops; |
| |
68 } |
| |
69 |
| |
70 void finch_connections_init() |
| |
71 {} |
| |
72 |
| |
73 void finch_connections_uninit() |
| |
74 {} |
| |
75 |