Mercurial > pidgin.yaz
annotate finch/plugins/grouping.c @ 30304:13832b451708
Catalan translation updated.
author | Josep Puigdemont <josep.puigdemont@gmail.com> |
---|---|
date | Sat, 08 May 2010 14:14:21 +0000 |
parents | 7921a53b94b3 |
children | d288f5215a9a |
rev | line source |
---|---|
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
1 /** |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
2 * @file grouping.c Provides different grouping options. |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
3 * |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
4 * Copyright (C) 2008 Sadrul Habib Chowdhury <sadrul@users.sourceforge.net> |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
5 * |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
6 * This program is free software; you can redistribute it and/or modify |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
7 * it under the terms of the GNU General Public License as published by |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
8 * the Free Software Foundation; either version 2 of the License, or |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
9 * (at your option) any later version. |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
10 * |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
11 * This program is distributed in the hope that it will be useful, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
14 * GNU General Public License for more details. |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
15 * |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
16 * You should have received a copy of the GNU General Public License |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
17 * along with this program; if not, write to the Free Software |
28420
7921a53b94b3
Oops, Elliott correctly pointed out this was wrong...
Paul Aurich <paul@darkrain42.org>
parents:
28399
diff
changeset
|
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
19 */ |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
20 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
21 #define PURPLE_PLUGIN |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
22 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
23 #include "internal.h" |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
24 #include "purple.h" |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
25 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
26 #include "gntblist.h" |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
27 #include "gntplugin.h" |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
28 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
29 #include "gnttree.h" |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
30 |
23959
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
31 static FinchBlistManager *default_manager; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
32 |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
33 /** |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
34 * Online/Offline |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
35 */ |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
36 static PurpleBlistNode online = {.type = PURPLE_BLIST_OTHER_NODE}, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
37 offline = {.type = PURPLE_BLIST_OTHER_NODE}; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
38 |
22190
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
39 static gboolean on_offline_init() |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
40 { |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
41 GntTree *tree = finch_blist_get_tree(); |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
42 |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
43 gnt_tree_add_row_after(tree, &online, |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
44 gnt_tree_create_row(tree, _("Online")), NULL, NULL); |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
45 gnt_tree_add_row_after(tree, &offline, |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
46 gnt_tree_create_row(tree, _("Offline")), NULL, &online); |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
47 |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
48 return TRUE; |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
49 } |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
50 |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
51 static gboolean on_offline_can_add_node(PurpleBlistNode *node) |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
52 { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
53 switch (purple_blist_node_get_type(node)) { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
54 case PURPLE_BLIST_CONTACT_NODE: |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
55 { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
56 PurpleContact *contact = (PurpleContact*)node; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
57 if (contact->currentsize > 0) |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
58 return TRUE; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
59 return FALSE; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
60 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
61 break; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
62 case PURPLE_BLIST_BUDDY_NODE: |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
63 { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
64 PurpleBuddy *buddy = (PurpleBuddy*)node; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
65 if (PURPLE_BUDDY_IS_ONLINE(buddy)) |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
66 return TRUE; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
67 if (purple_prefs_get_bool("/finch/blist/showoffline") && |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
68 purple_account_is_connected(purple_buddy_get_account(buddy))) |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
69 return TRUE; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
70 return FALSE; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
71 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
72 break; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
73 case PURPLE_BLIST_CHAT_NODE: |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
74 { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
75 PurpleChat *chat = (PurpleChat*)node; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
76 return purple_account_is_connected(purple_chat_get_account(chat)); |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
77 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
78 break; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
79 default: |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
80 return FALSE; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
81 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
82 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
83 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
84 static gpointer on_offline_find_parent(PurpleBlistNode *node) |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
85 { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
86 gpointer ret = NULL; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
87 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
88 switch (purple_blist_node_get_type(node)) { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
89 case PURPLE_BLIST_CONTACT_NODE: |
25318
0e08c847517d
Update some casts (that the script didn't fix correctly) to GObject macros.
Richard Laager <rlaager@wiktel.com>
parents:
23959
diff
changeset
|
90 node = PURPLE_BLIST_NODE(purple_contact_get_priority_buddy(PURPLE_CONTACT(node))); |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
91 ret = PURPLE_BUDDY_IS_ONLINE((PurpleBuddy*)node) ? &online : &offline; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
92 break; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
93 case PURPLE_BLIST_BUDDY_NODE: |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
94 ret = purple_blist_node_get_parent(node); |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
95 finch_blist_manager_add_node(ret); |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
96 break; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
97 case PURPLE_BLIST_CHAT_NODE: |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
98 ret = &online; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
99 break; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
100 default: |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
101 break; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
102 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
103 return ret; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
104 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
105 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
106 static gboolean on_offline_create_tooltip(gpointer selected_row, GString **body, char **tool_title) |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
107 { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
108 PurpleBlistNode *node = selected_row; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
109 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
110 if (purple_blist_node_get_type(node) == PURPLE_BLIST_OTHER_NODE) { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
111 /* There should be some easy way of getting the total online count, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
112 * or total number of chats. Doing a loop here will probably be pretty |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
113 * expensive. */ |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
114 if (body) |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
115 *body = g_string_new(node == &online ? _("Online Buddies") : _("Offline Buddies")); |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
116 return TRUE; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
117 } else { |
23959
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
118 return default_manager ? default_manager->create_tooltip(selected_row, body, tool_title) : FALSE; |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
119 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
120 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
121 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
122 static FinchBlistManager on_offline = |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
123 { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
124 "on-offline", |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
125 N_("Online/Offline"), |
22190
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
126 on_offline_init, |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
127 NULL, |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
128 on_offline_can_add_node, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
129 on_offline_find_parent, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
130 on_offline_create_tooltip, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
131 {NULL, NULL, NULL, NULL} |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
132 }; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
133 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
134 /** |
22186
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
135 * Meebo-like Grouping. |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
136 */ |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
137 static PurpleBlistNode meebo = {.type = PURPLE_BLIST_OTHER_NODE}; |
22190
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
138 static gboolean meebo_init() |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
139 { |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
140 GntTree *tree = finch_blist_get_tree(); |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
141 if (!g_list_find(gnt_tree_get_rows(tree), &meebo)) { |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
142 gnt_tree_add_row_last(tree, &meebo, |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
143 gnt_tree_create_row(tree, _("Offline")), NULL); |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
144 } |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
145 return TRUE; |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
146 } |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
147 |
22186
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
148 static gpointer meebo_find_parent(PurpleBlistNode *node) |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
149 { |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
150 if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
151 PurpleBuddy *buddy = purple_contact_get_priority_buddy((PurpleContact*)node); |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
152 if (buddy && !PURPLE_BUDDY_IS_ONLINE(buddy)) { |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
153 return &meebo; |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
154 } |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
155 } |
23959
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
156 return default_manager->find_parent(node); |
22186
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
157 } |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
158 |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
159 static FinchBlistManager meebo_group = |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
160 { |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
161 "meebo", |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
162 N_("Meebo"), |
22190
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
163 meebo_init, |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
164 NULL, |
22186
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
165 NULL, |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
166 meebo_find_parent, |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
167 NULL, |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
168 {NULL, NULL, NULL, NULL} |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
169 }; |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
170 |
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
171 /** |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
172 * No Grouping. |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
173 */ |
22190
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
174 static gboolean no_group_init() |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
175 { |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
176 GntTree *tree = finch_blist_get_tree(); |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
177 g_object_set(G_OBJECT(tree), "expander-level", 0, NULL); |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
178 return TRUE; |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
179 } |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
180 |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
181 static gboolean no_group_uninit() |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
182 { |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
183 GntTree *tree = finch_blist_get_tree(); |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
184 g_object_set(G_OBJECT(tree), "expander-level", 1, NULL); |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
185 return TRUE; |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
186 } |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
187 |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
188 static gboolean no_group_can_add_node(PurpleBlistNode *node) |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
189 { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
190 return on_offline_can_add_node(node); /* These happen to be the same */ |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
191 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
192 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
193 static gpointer no_group_find_parent(PurpleBlistNode *node) |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
194 { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
195 gpointer ret = NULL; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
196 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
197 switch (purple_blist_node_get_type(node)) { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
198 case PURPLE_BLIST_BUDDY_NODE: |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
199 ret = purple_blist_node_get_parent(node); |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
200 finch_blist_manager_add_node(ret); |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
201 break; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
202 default: |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
203 break; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
204 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
205 return ret; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
206 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
207 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
208 static FinchBlistManager no_group = |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
209 { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
210 "no-group", |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
211 N_("No Grouping"), |
22190
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
212 no_group_init, |
bcaf4a037704
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22186
diff
changeset
|
213 no_group_uninit, |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
214 no_group_can_add_node, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
215 no_group_find_parent, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
216 NULL, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
217 {NULL, NULL, NULL, NULL} |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
218 }; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
219 |
23959
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
220 /** |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
221 * Nested Grouping |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
222 */ |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
223 static GHashTable *groups; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
224 |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
225 static gboolean |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
226 nested_group_init(void) |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
227 { |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
228 groups = g_hash_table_new_full(g_str_hash, g_str_equal, |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
229 g_free, g_free); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
230 return TRUE; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
231 } |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
232 |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
233 static gboolean |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
234 nested_group_uninit(void) |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
235 { |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
236 g_hash_table_destroy(groups); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
237 groups = NULL; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
238 return TRUE; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
239 } |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
240 |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
241 static gpointer |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
242 nested_group_find_parent(PurpleBlistNode *node) |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
243 { |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
244 char *name; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
245 PurpleGroup *group; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
246 char *sep; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
247 PurpleBlistNode *ret, *parent; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
248 GntTree *tree; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
249 |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
250 if (!PURPLE_BLIST_NODE_IS_GROUP(node)) |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
251 return default_manager->find_parent(node); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
252 |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
253 group = (PurpleGroup *)node; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
254 name = g_strdup(purple_group_get_name(group)); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
255 if (!(sep = strchr(name, '/'))) { |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
256 g_free(name); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
257 return default_manager->find_parent(node); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
258 } |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
259 |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
260 tree = finch_blist_get_tree(); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
261 parent = NULL; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
262 |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
263 while (sep) { |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
264 *sep = 0; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
265 if (*(sep + 1) && (ret = (PurpleBlistNode *)purple_find_group(name))) { |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
266 finch_blist_manager_add_node(ret); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
267 parent = ret; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
268 } else if (!(ret = g_hash_table_lookup(groups, name))) { |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
269 ret = g_new0(PurpleBlistNode, 1); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
270 g_hash_table_insert(groups, g_strdup(name), ret); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
271 ret->type = PURPLE_BLIST_OTHER_NODE; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
272 gnt_tree_add_row_last(tree, ret, |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
273 gnt_tree_create_row(tree, name), parent); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
274 parent = ret; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
275 } |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
276 *sep = '/'; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
277 sep = strchr(sep + 1, '/'); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
278 } |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
279 |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
280 g_free(name); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
281 return ret; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
282 } |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
283 |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
284 static gboolean |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
285 nested_group_create_tooltip(gpointer selected_row, GString **body, char **title) |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
286 { |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
287 PurpleBlistNode *node = selected_row; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
288 if (!node || |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
289 purple_blist_node_get_type(node) != PURPLE_BLIST_OTHER_NODE) |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
290 return default_manager->create_tooltip(selected_row, body, title); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
291 if (body) |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
292 *body = g_string_new(_("Nested Subgroup")); /* Perhaps list the child groups/subgroups? */ |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
293 return TRUE; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
294 } |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
295 |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
296 static gboolean |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
297 nested_group_can_add_node(PurpleBlistNode *node) |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
298 { |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
299 PurpleBlistNode *group; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
300 int len; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
301 |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
302 if (!PURPLE_BLIST_NODE_IS_GROUP(node)) |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
303 return default_manager->can_add_node(node); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
304 |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
305 if (default_manager->can_add_node(node)) |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
306 return TRUE; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
307 |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
308 len = strlen(purple_group_get_name((PurpleGroup*)node)); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
309 group = purple_blist_get_root(); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
310 for (; group; group = purple_blist_node_get_sibling_next(group)) { |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
311 if (group == node) |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
312 continue; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
313 if (strncmp(purple_group_get_name((PurpleGroup *)node), |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
314 purple_group_get_name((PurpleGroup *)group), len) == 0 && |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
315 default_manager->can_add_node(group)) |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
316 return TRUE; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
317 } |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
318 return FALSE; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
319 } |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
320 |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
321 static FinchBlistManager nested_group = |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
322 { |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
323 "nested", |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
324 N_("Nested Grouping (experimental)"), |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
325 .init = nested_group_init, |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
326 .uninit = nested_group_uninit, |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
327 .find_parent = nested_group_find_parent, |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
328 .create_tooltip = nested_group_create_tooltip, |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
329 .can_add_node = nested_group_can_add_node, |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
330 }; |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
331 |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
332 static gboolean |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
333 plugin_load(PurplePlugin *plugin) |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
334 { |
23959
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
335 default_manager = finch_blist_manager_find("default"); |
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
336 |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
337 finch_blist_install_manager(&on_offline); |
22186
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
338 finch_blist_install_manager(&meebo_group); |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
339 finch_blist_install_manager(&no_group); |
23959
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
340 finch_blist_install_manager(&nested_group); |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
341 return TRUE; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
342 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
343 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
344 static gboolean |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
345 plugin_unload(PurplePlugin *plugin) |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
346 { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
347 finch_blist_uninstall_manager(&on_offline); |
22186
d1b8c8bef05b
Add a meebo-like grouping, where online contacts show up under the default
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22173
diff
changeset
|
348 finch_blist_uninstall_manager(&meebo_group); |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
349 finch_blist_uninstall_manager(&no_group); |
23959
8a488151e07a
Add 'Nested Grouping' option in the grouping plugin
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22190
diff
changeset
|
350 finch_blist_uninstall_manager(&nested_group); |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
351 return TRUE; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
352 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
353 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
354 static PurplePluginInfo info = |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
355 { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
356 PURPLE_PLUGIN_MAGIC, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
357 PURPLE_MAJOR_VERSION, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
358 PURPLE_MINOR_VERSION, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
359 PURPLE_PLUGIN_STANDARD, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
360 FINCH_PLUGIN_TYPE, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
361 0, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
362 NULL, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
363 PURPLE_PRIORITY_DEFAULT, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
364 "grouping", |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
365 N_("Grouping"), |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
366 VERSION, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
367 N_("Provides alternate buddylist grouping options."), |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
368 N_("Provides alternate buddylist grouping options."), |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
369 "Sadrul H Chowdhury <sadrul@users.sourceforge.net>", |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
370 PURPLE_WEBSITE, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
371 plugin_load, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
372 plugin_unload, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
373 NULL, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
374 NULL, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
375 NULL, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
376 NULL, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
377 NULL, |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
378 NULL,NULL,NULL,NULL |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
379 }; |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
380 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
381 static void |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
382 init_plugin(PurplePlugin *plugin) |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
383 { |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
384 } |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
385 |
25124
ea62e934c80b
Fix some more mis-identified plugins, like 3b3526a0...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23959
diff
changeset
|
386 PURPLE_INIT_PLUGIN(grouping, init_plugin, info) |
22173
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
387 |
85c365822504
Add a plugin to provide 'Online/Offline' grouping and no grouping.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
388 |