pidgin/plugins/extplacement.c

Wed, 27 Nov 2019 00:08:11 +0300

author
qarkai <qarkai@gmail.com>
date
Wed, 27 Nov 2019 00:08:11 +0300
changeset 40329
b5e0f65a5d9c
parent 37133
832cd077145e
child 40222
40f2888f85c1
permissions
-rw-r--r--

Replace PurpleNamedValue with PurpleKeyValuePair

9179
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
1 /*
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
2 * Extra conversation placement options for Purple
9179
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
3 *
15931
716b5fac1895 Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents: 15884
diff changeset
4 * Pidgin is the legal property of its developers, whose names are too numerous
9179
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
6 * source distribution.
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
7 *
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
8 * This program is free software; you can redistribute it and/or
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
9 * modify it under the terms of the GNU General Public License
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
10 * as published by the Free Software Foundation; either version 2
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
11 * of the License, or (at your option) any later version.
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
12 *
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
13 * This program is distributed in the hope that it will be useful,
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
16 * GNU General Public License for more details.
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
17 *
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
18 * You should have received a copy of the GNU General Public License
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
19 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 17022
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA.
9179
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
21 */
36946139d4bc [gaim-migrate @ 9974]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9157
diff changeset
22
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
23 #include "internal.h"
15577
b8129373f65e More pidgin changes
Sean Egan <seanegan@pidgin.im>
parents: 15563
diff changeset
24 #include "pidgin.h"
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
25 #include "conversation.h"
9943
b54a762f60fa [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9791
diff changeset
26 #include "version.h"
9215
0d07b7d5a8d6 [gaim-migrate @ 10011]
Nathan Walp <nwalp@pidgin.im>
parents: 9179
diff changeset
27 #include "gtkplugin.h"
11581
5c7f44be5dfe [gaim-migrate @ 13851]
Tim Ringenbach <marv@pidgin.im>
parents: 9943
diff changeset
28 #include "gtkconv.h"
5c7f44be5dfe [gaim-migrate @ 13851]
Tim Ringenbach <marv@pidgin.im>
parents: 9943
diff changeset
29 #include "gtkconvwin.h"
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
30
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
31 static void
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
32 conv_placement_by_number(PidginConversation *conv)
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
33 {
35610
24b06c5e7760 Renamed PidginWindow to PidginConvWindow so that introspection associates it with pidgin_conv_window_* API
Ankit Vani <a@nevitus.org>
parents: 35378
diff changeset
34 PidginConvWindow *win = NULL;
12168
f1cb35825de9 [gaim-migrate @ 14469]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11581
diff changeset
35 GList *wins = NULL;
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
36
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
37 if (purple_prefs_get_bool("/plugins/gtk/extplacement/placement_number_separate"))
34659
4fc616843cb2 Removed conversation type argument from pidgin conversation functions.
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
38 win = PURPLE_IS_IM_CONVERSATION(conv->active_conv) ?
4fc616843cb2 Removed conversation type argument from pidgin conversation functions.
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
39 pidgin_conv_window_last_im() : pidgin_conv_window_last_chat();
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
40 else if ((wins = pidgin_conv_windows_get_list()) != NULL)
12168
f1cb35825de9 [gaim-migrate @ 14469]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11581
diff changeset
41 win = g_list_last(wins)->data;
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
42
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
43 if (win == NULL) {
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
44 win = pidgin_conv_window_new();
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
45
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
46 pidgin_conv_window_add_gtkconv(win, conv);
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
47 pidgin_conv_window_show(win);
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
48 } else {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
49 int max_count = purple_prefs_get_int("/plugins/gtk/extplacement/placement_number");
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
50 int count = pidgin_conv_window_get_gtkconv_count(win);
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
51
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
52 if (count < max_count)
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
53 pidgin_conv_window_add_gtkconv(win, conv);
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
54 else {
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
55 GList *l = NULL;
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
56
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
57 for (l = pidgin_conv_windows_get_list(); l != NULL; l = l->next) {
11581
5c7f44be5dfe [gaim-migrate @ 13851]
Tim Ringenbach <marv@pidgin.im>
parents: 9943
diff changeset
58 win = l->data;
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
59
35689
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35610
diff changeset
60 if (!conv || !conv->active_conv ||
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35610
diff changeset
61 !G_TYPE_FROM_INSTANCE(conv->active_conv))
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35610
diff changeset
62 {
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35610
diff changeset
63 g_warn_if_reached();
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35610
diff changeset
64 continue;
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35610
diff changeset
65 }
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35610
diff changeset
66
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
67 if (purple_prefs_get_bool("/plugins/gtk/extplacement/placement_number_separate") &&
35069
bdc5207ad4b7 pidgin: Don't assume a conversation is always an IM or a chat
Ankit Vani <a@nevitus.org>
parents: 35045
diff changeset
68 G_TYPE_FROM_INSTANCE(pidgin_conv_window_get_active_conversation(win)) != G_TYPE_FROM_INSTANCE(conv->active_conv))
9425
c9dc8ba467f4 [gaim-migrate @ 10243]
Luke Schierer <lschiere@pidgin.im>
parents: 9251
diff changeset
69 continue;
c9dc8ba467f4 [gaim-migrate @ 10243]
Luke Schierer <lschiere@pidgin.im>
parents: 9251
diff changeset
70
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
71 count = pidgin_conv_window_get_gtkconv_count(win);
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
72 if (count < max_count) {
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
73 pidgin_conv_window_add_gtkconv(win, conv);
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
74 return;
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
75 }
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
76 }
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
77 win = pidgin_conv_window_new();
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
78
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
79 pidgin_conv_window_add_gtkconv(win, conv);
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
80 pidgin_conv_window_show(win);
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
81 }
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
82 }
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
83 }
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
84
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
85 static PurplePluginPrefFrame *
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
86 get_plugin_pref_frame(PurplePlugin *plugin) {
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
87 PurplePluginPrefFrame *frame;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
88 PurplePluginPref *ppref;
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
89
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
90 frame = purple_plugin_pref_frame_new();
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
91
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
92 ppref = purple_plugin_pref_new_with_label(_("Conversation Placement"));
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
93 purple_plugin_pref_frame_add(frame, ppref);
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
94
17022
d0ca12792153 Add note about using "By conversation count" for the "New conversations" preference to the extplacement plugin. Hopefully this reduces confusion (including for me).
Daniel Atallah <datallah@pidgin.im>
parents: 16749
diff changeset
95 /* Translators: "New conversations" should match the text in the preferences dialog and "By conversation count" should be the same text used above */
d0ca12792153 Add note about using "By conversation count" for the "New conversations" preference to the extplacement plugin. Hopefully this reduces confusion (including for me).
Daniel Atallah <datallah@pidgin.im>
parents: 16749
diff changeset
96 ppref = purple_plugin_pref_new_with_label(_("Note: The preference for \"New conversations\" must be set to \"By conversation count\"."));
35378
5d9e2581005b gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents: 35069
diff changeset
97 purple_plugin_pref_set_pref_type(ppref, PURPLE_PLUGIN_PREF_INFO);
17022
d0ca12792153 Add note about using "By conversation count" for the "New conversations" preference to the extplacement plugin. Hopefully this reduces confusion (including for me).
Daniel Atallah <datallah@pidgin.im>
parents: 16749
diff changeset
98 purple_plugin_pref_frame_add(frame, ppref);
d0ca12792153 Add note about using "By conversation count" for the "New conversations" preference to the extplacement plugin. Hopefully this reduces confusion (including for me).
Daniel Atallah <datallah@pidgin.im>
parents: 16749
diff changeset
99
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
100 ppref = purple_plugin_pref_new_with_name_and_label(
9425
c9dc8ba467f4 [gaim-migrate @ 10243]
Luke Schierer <lschiere@pidgin.im>
parents: 9251
diff changeset
101 "/plugins/gtk/extplacement/placement_number",
c9dc8ba467f4 [gaim-migrate @ 10243]
Luke Schierer <lschiere@pidgin.im>
parents: 9251
diff changeset
102 _("Number of conversations per window"));
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
103 purple_plugin_pref_set_bounds(ppref, 1, 50);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
104 purple_plugin_pref_frame_add(frame, ppref);
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
105
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
106 ppref = purple_plugin_pref_new_with_name_and_label(
9425
c9dc8ba467f4 [gaim-migrate @ 10243]
Luke Schierer <lschiere@pidgin.im>
parents: 9251
diff changeset
107 "/plugins/gtk/extplacement/placement_number_separate",
c9dc8ba467f4 [gaim-migrate @ 10243]
Luke Schierer <lschiere@pidgin.im>
parents: 9251
diff changeset
108 _("Separate IM and Chat windows when placing by number"));
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
109 purple_plugin_pref_frame_add(frame, ppref);
9425
c9dc8ba467f4 [gaim-migrate @ 10243]
Luke Schierer <lschiere@pidgin.im>
parents: 9251
diff changeset
110
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
111 return frame;
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
112 }
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
113
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
114 static PidginPluginInfo *
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
115 plugin_query(GError **error)
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
116 {
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
117 const gchar * const authors[] = {
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
118 "Stu Tomlinson <stu@nosnilmot.com>",
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
119 NULL
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
120 };
16749
14a3fdc0aed7 Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16133
diff changeset
121
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
122 return pidgin_plugin_info_new(
36934
e7268aeb3b89 Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents: 36929
diff changeset
123 "id", "gtk-extplacement",
e7268aeb3b89 Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents: 36929
diff changeset
124 "name", N_("ExtPlacement"),
e7268aeb3b89 Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents: 36929
diff changeset
125 "version", DISPLAY_VERSION,
e7268aeb3b89 Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents: 36929
diff changeset
126 "category", N_("User interface"),
e7268aeb3b89 Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents: 36929
diff changeset
127 "summary", N_("Extra conversation placement options."),
e7268aeb3b89 Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents: 36929
diff changeset
128 "description", N_("Restrict the number of conversations per "
e7268aeb3b89 Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents: 36929
diff changeset
129 "windows, optionally separating IMs and "
e7268aeb3b89 Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents: 36929
diff changeset
130 "Chats"),
e7268aeb3b89 Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents: 36929
diff changeset
131 "authors", authors,
e7268aeb3b89 Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents: 36929
diff changeset
132 "website", PURPLE_WEBSITE,
e7268aeb3b89 Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents: 36929
diff changeset
133 "abi-version", PURPLE_ABI_VERSION,
e7268aeb3b89 Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents: 36929
diff changeset
134 "pref-frame-cb", get_plugin_pref_frame,
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
135 NULL
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
136 );
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
137 }
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
138
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
139 static gboolean
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
140 plugin_load(PurplePlugin *plugin, GError **error)
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
141 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
142 purple_prefs_add_none("/plugins/gtk/extplacement");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
143 purple_prefs_add_int("/plugins/gtk/extplacement/placement_number", 4);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
144 purple_prefs_add_bool("/plugins/gtk/extplacement/placement_number_separate", FALSE);
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
145
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
146 pidgin_conv_placement_add_fnc("number", _("By conversation count"),
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
147 &conv_placement_by_number);
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
148 purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement");
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
149 return TRUE;
9157
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
150 }
3583ff23ea29 [gaim-migrate @ 9941]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
151
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
152 static gboolean
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
153 plugin_unload(PurplePlugin *plugin, GError **error)
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
154 {
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
155 pidgin_conv_placement_remove_fnc("number");
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
156 purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement");
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
157 return TRUE;
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
158 }
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
159
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
160 PURPLE_PLUGIN_INIT(extplacement, plugin_query, plugin_load, plugin_unload);

mercurial