annotate console/gntconn.c @ 13952:841a5ffbfee4

[gaim-migrate @ 16500] uiops for GaimConnections. This only shows an error message for a disconnect. uiops for GaimNotify. I have not done the notifications for searchresults yet. That will require multi-column GntTree's, which will also allow for improved email-notifications. I hope to complete it by next week. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 17 Jul 2006 03:45:24 +0000
parents
children 81650a27f253
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13952
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
1 #include "notify.h"
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
2
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
3 #include "gntconn.h"
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
4 #include "gntgaim.h"
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
5
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
6 static void
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
7 gg_connection_report_disconnect(GaimConnection *gc, const char *text)
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
8 {
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
9 char *act, *primary, *secondary;
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
10 GaimAccount *account = gaim_connection_get_account(gc);
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
11
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
12 act = g_strdup_printf(_("%s (%s)"), gaim_account_get_username(account),
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
13 gaim_account_get_protocol_name(account));
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
14
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
15 primary = g_strdup_printf(_("%s disconnected."), act);
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
16 secondary = g_strdup_printf(_("%s was disconnected due to the following error:\n%s"),
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
17 act, text);
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
18
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
19 gaim_notify_error(account, _("Connection Error"), primary, secondary);
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
20
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
21 g_free(act);
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
22 g_free(primary);
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
23 g_free(secondary);
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
24 }
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
25
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
26 static GaimConnectionUiOps ops =
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
27 {
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
28 .connect_progress = NULL,
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
29 .connected = NULL,
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
30 .disconnected = NULL,
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
31 .notice = NULL,
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
32 .report_disconnect = gg_connection_report_disconnect
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
33 };
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
34
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
35 GaimConnectionUiOps *gg_connections_get_ui_ops()
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
36 {
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
37 return &ops;
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
38 }
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
39
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
40 void gg_connections_init()
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
41 {}
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
42
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
43 void gg_connections_uninit()
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
44 {}
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
45