15817
|
1 /**
|
|
2 * @file gntconn.c GNT Connection API
|
|
3 * @ingroup gntui
|
|
4 *
|
15822
|
5 * purple
|
15817
|
6 *
|
15822
|
7 * Purple is the legal property of its developers, whose names are too numerous
|
15817
|
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"
|
15822
|
30 #include "finch.h"
|
15817
|
31
|
|
32 static void
|
15822
|
33 finch_connection_report_disconnect(PurpleConnection *gc, const char *text)
|
15817
|
34 {
|
|
35 char *act, *primary, *secondary;
|
15822
|
36 PurpleAccount *account = purple_connection_get_account(gc);
|
15817
|
37
|
15822
|
38 act = g_strdup_printf(_("%s (%s)"), purple_account_get_username(account),
|
|
39 purple_account_get_protocol_name(account));
|
15817
|
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
|
15822
|
45 purple_request_action(account, _("Connection Error"), primary, secondary, 1,
|
15817
|
46 account, 2,
|
|
47 _("OK"), NULL,
|
|
48 _("Connect"),
|
15822
|
49 PURPLE_CALLBACK(purple_account_connect));
|
15817
|
50
|
|
51 g_free(act);
|
|
52 g_free(primary);
|
|
53 g_free(secondary);
|
|
54 }
|
|
55
|
15822
|
56 static PurpleConnectionUiOps ops =
|
15817
|
57 {
|
|
58 .connect_progress = NULL,
|
|
59 .connected = NULL,
|
|
60 .disconnected = NULL,
|
|
61 .notice = NULL,
|
|
62 .report_disconnect = finch_connection_report_disconnect
|
|
63 };
|
|
64
|
15822
|
65 PurpleConnectionUiOps *finch_connections_get_ui_ops()
|
15817
|
66 {
|
|
67 return &ops;
|
|
68 }
|
|
69
|
|
70 void finch_connections_init()
|
|
71 {}
|
|
72
|
|
73 void finch_connections_uninit()
|
|
74 {}
|
|
75
|