finch/gntplugin.c

Wed, 09 May 2007 19:05:19 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Wed, 09 May 2007 19:05:19 +0000
changeset 17033
27d9faa34ad1
parent 16999
2d66b5256b1b
child 17207
c8d7db607033
permissions
-rw-r--r--

Patch from ticket #819 from vampire

Here's a quick fix for the disappearing buddy icons bug. Looks like this happens in purple_buddy_icons_find() when caching is disabled, and purple_buddy_icon_update() then removes the settings from the blist.

Fixes #491

14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
1 /**
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
2 * @file gntplugin.c GNT Plugins API
16255
fa61ee19f526 Rename the Doxygen group from gntui to finch and define the finch group
Richard Laager <rlaager@pidgin.im>
parents: 15931
diff changeset
3 * @ingroup finch
14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
4 *
15931
716b5fac1895 Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents: 15906
diff changeset
5 * finch
14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
6 *
15931
716b5fac1895 Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents: 15906
diff changeset
7 * Finch is the legal property of its developers, whose names are too numerous
14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
9 * source distribution.
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
10 *
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
11 * This program is free software; you can redistribute it and/or modify
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
12 * it under the terms of the GNU General Public License as published by
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
14 * (at your option) any later version.
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
15 *
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
16 * This program is distributed in the hope that it will be useful,
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
19 * GNU General Public License for more details.
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
20 *
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
21 * You should have received a copy of the GNU General Public License
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
22 * along with this program; if not, write to the Free Software
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14210
diff changeset
24 */
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
25 #include <gnt.h>
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
26 #include <gntbox.h>
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
27 #include <gntbutton.h>
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
28 #include <gntlabel.h>
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
29 #include <gntline.h>
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
30 #include <gnttree.h>
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
31
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
32 #include "notify.h"
16383
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
33 #include "request.h"
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
34
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
35 #include "finch.h"
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
36 #include "gntplugin.h"
16383
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
37 #include "gntrequest.h"
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
38
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
39 static struct
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
40 {
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
41 GntWidget *tree;
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
42 GntWidget *window;
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
43 GntWidget *aboot;
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
44 GntWidget *conf;
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
45 } plugins;
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
46
14210
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
47 static GHashTable *confwins;
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
48
16383
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
49 static void process_pref_frame(PurplePluginPrefFrame *frame);
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
50
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
51 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
52 decide_conf_button(PurplePlugin *plugin)
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
53 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
54 if (purple_plugin_is_loaded(plugin) &&
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
55 ((PURPLE_IS_GNT_PLUGIN(plugin) &&
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
56 FINCH_PLUGIN_UI_INFO(plugin) != NULL) ||
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
57 (plugin->info->prefs_info &&
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
58 plugin->info->prefs_info->get_plugin_pref_frame)))
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
59 gnt_widget_set_visible(plugins.conf, TRUE);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
60 else
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
61 gnt_widget_set_visible(plugins.conf, FALSE);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
62
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
63 gnt_box_readjust(GNT_BOX(plugins.window));
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
64 gnt_widget_draw(plugins.window);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
65 }
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
66
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
67 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
68 plugin_toggled_cb(GntWidget *tree, PurplePlugin *plugin, gpointer null)
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
69 {
16313
ae9787338382 If a plugin failed to load/unload, don't pretend that it worked
Richard Nelson <wabz@pidgin.im>
parents: 16255
diff changeset
70 /* TODO: Mark these strings for translation after the freeze */
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
71 if (gnt_tree_get_choice(GNT_TREE(tree), plugin))
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
72 {
16313
ae9787338382 If a plugin failed to load/unload, don't pretend that it worked
Richard Nelson <wabz@pidgin.im>
parents: 16255
diff changeset
73 if (!purple_plugin_load(plugin)) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
74 purple_notify_error(NULL, "ERROR", "loading plugin failed", NULL);
16313
ae9787338382 If a plugin failed to load/unload, don't pretend that it worked
Richard Nelson <wabz@pidgin.im>
parents: 16255
diff changeset
75 gnt_tree_set_choice(GNT_TREE(tree), plugin, FALSE);
ae9787338382 If a plugin failed to load/unload, don't pretend that it worked
Richard Nelson <wabz@pidgin.im>
parents: 16255
diff changeset
76 }
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
77 }
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
78 else
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
79 {
14210
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
80 GntWidget *win;
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
81
16313
ae9787338382 If a plugin failed to load/unload, don't pretend that it worked
Richard Nelson <wabz@pidgin.im>
parents: 16255
diff changeset
82 if (!purple_plugin_unload(plugin)) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
83 purple_notify_error(NULL, "ERROR", "unloading plugin failed", NULL);
16313
ae9787338382 If a plugin failed to load/unload, don't pretend that it worked
Richard Nelson <wabz@pidgin.im>
parents: 16255
diff changeset
84 gnt_tree_set_choice(GNT_TREE(tree), plugin, TRUE);
ae9787338382 If a plugin failed to load/unload, don't pretend that it worked
Richard Nelson <wabz@pidgin.im>
parents: 16255
diff changeset
85 }
14210
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
86
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
87 if ((win = g_hash_table_lookup(confwins, plugin)) != NULL)
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
88 {
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
89 gnt_widget_destroy(win);
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
90 }
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
91 }
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
92 decide_conf_button(plugin);
15878
f52832b611fe renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents: 15357
diff changeset
93 finch_plugins_save_loaded();
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
94 }
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
95
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
96 /* Xerox */
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
97 void
15878
f52832b611fe renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents: 15357
diff changeset
98 finch_plugins_save_loaded(void)
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
99 {
16478
19107605c565 Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents: 16383
diff changeset
100 purple_plugins_save_loaded("/finch/plugins/loaded");
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
101 }
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
102
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
103 static void
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
104 selection_changed(GntWidget *widget, gpointer old, gpointer current, gpointer null)
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
105 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
106 PurplePlugin *plugin = current;
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
107 char *text;
16999
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
108 GList *list = NULL, *iter = NULL;
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
109
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
110 /* If the selected plugin was unseen before, mark it as seen. But save the list
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
111 * only when the plugin list is closed. So if the user enables a plugin, and it
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
112 * crashes, it won't get marked as seen so the user can fix the bug and still
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
113 * quickly find the plugin in the list.
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
114 * I probably mean 'plugin developers' by 'users' here. */
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
115 list = g_object_get_data(G_OBJECT(widget), "seen-list");
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
116 if (list)
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
117 iter = g_list_find_custom(list, plugin->path, (GCompareFunc)strcmp);
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
118 if (!iter) {
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
119 list = g_list_prepend(list, g_strdup(plugin->path));
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
120 g_object_set_data(G_OBJECT(widget), "seen-list", list);
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
121 }
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
122
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
123 /* XXX: Use formatting and stuff */
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
124 gnt_text_view_clear(GNT_TEXT_VIEW(plugins.aboot));
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
125 text = g_strdup_printf(_("Name: %s\nVersion: %s\nDescription: %s\nAuthor: %s\nWebsite: %s\nFilename: %s\n"),
15103
f7ead2783393 [gaim-migrate @ 17824]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14620
diff changeset
126 SAFE(plugin->info->name), SAFE(plugin->info->version), SAFE(plugin->info->description),
f7ead2783393 [gaim-migrate @ 17824]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14620
diff changeset
127 SAFE(plugin->info->author), SAFE(plugin->info->homepage), SAFE(plugin->path));
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
128 gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(plugins.aboot),
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
129 text, GNT_TEXT_FLAG_NORMAL);
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
130 gnt_text_view_scroll(GNT_TEXT_VIEW(plugins.aboot), 0);
14167
ca6027c33d2c [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14121
diff changeset
131 g_free(text);
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
132 decide_conf_button(plugin);
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
133 }
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
134
14086
732c14687955 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14072
diff changeset
135 static void
732c14687955 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14072
diff changeset
136 reset_plugin_window(GntWidget *window, gpointer null)
732c14687955 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14072
diff changeset
137 {
16999
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
138 GList *list = g_object_get_data(G_OBJECT(plugins.tree), "seen-list");
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
139 purple_prefs_set_path_list("/finch/plugins/seen", list);
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
140 g_list_foreach(list, (GFunc)g_free, NULL);
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
141 g_list_free(list);
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
142
14086
732c14687955 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14072
diff changeset
143 plugins.window = NULL;
732c14687955 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14072
diff changeset
144 plugins.tree = NULL;
732c14687955 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14072
diff changeset
145 plugins.aboot = NULL;
732c14687955 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14072
diff changeset
146 }
732c14687955 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14072
diff changeset
147
14167
ca6027c33d2c [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14121
diff changeset
148 static int
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
149 plugin_compare(PurplePlugin *p1, PurplePlugin *p2)
14167
ca6027c33d2c [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14121
diff changeset
150 {
ca6027c33d2c [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14121
diff changeset
151 char *s1 = g_utf8_strup(p1->info->name, -1);
ca6027c33d2c [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14121
diff changeset
152 char *s2 = g_utf8_strup(p2->info->name, -1);
ca6027c33d2c [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14121
diff changeset
153 int ret = g_utf8_collate(s1, s2);
ca6027c33d2c [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14121
diff changeset
154 g_free(s1);
ca6027c33d2c [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14121
diff changeset
155 g_free(s2);
ca6027c33d2c [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14121
diff changeset
156 return ret;
ca6027c33d2c [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14121
diff changeset
157 }
ca6027c33d2c [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14121
diff changeset
158
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
159 static void
14210
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
160 confwin_init()
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
161 {
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
162 confwins = g_hash_table_new(g_direct_hash, g_direct_equal);
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
163 }
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
164
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
165 static void
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
166 remove_confwin(GntWidget *window, gpointer plugin)
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
167 {
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
168 g_hash_table_remove(confwins, plugin);
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
169 }
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
170
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
171 static void
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
172 configure_plugin_cb(GntWidget *button, gpointer null)
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
173 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
174 PurplePlugin *plugin;
15878
f52832b611fe renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents: 15357
diff changeset
175 FinchPluginFrame callback;
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
176
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
177 g_return_if_fail(plugins.tree != NULL);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
178
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
179 plugin = gnt_tree_get_selection_data(GNT_TREE(plugins.tree));
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
180 if (!purple_plugin_is_loaded(plugin))
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
181 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
182 purple_notify_error(plugin, _("Error"),
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
183 _("Plugin need to be loaded before you can configure it."), NULL);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
184 return;
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
185 }
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
186
14210
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
187 if (confwins && g_hash_table_lookup(confwins, plugin))
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
188 return;
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
189
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
190 if (PURPLE_IS_GNT_PLUGIN(plugin) &&
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
191 (callback = FINCH_PLUGIN_UI_INFO(plugin)) != NULL)
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
192 {
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
193 GntWidget *window = gnt_vbox_new(FALSE);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
194 GntWidget *box, *button;
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
195
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
196 gnt_box_set_toplevel(GNT_BOX(window), TRUE);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
197 gnt_box_set_title(GNT_BOX(window), plugin->info->name);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
198 gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
199
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
200 box = callback();
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
201 gnt_box_add_widget(GNT_BOX(window), box);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
202
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
203 box = gnt_hbox_new(FALSE);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
204 gnt_box_add_widget(GNT_BOX(window), box);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
205
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
206 button = gnt_button_new(_("Close"));
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
207 gnt_box_add_widget(GNT_BOX(box), button);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
208 g_signal_connect_swapped(G_OBJECT(button), "activate",
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
209 G_CALLBACK(gnt_widget_destroy), window);
14210
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
210 g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(remove_confwin), plugin);
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
211
14210
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
212 gnt_widget_show(window);
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
213
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
214 if (confwins == NULL)
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
215 confwin_init();
4823798a92a0 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14201
diff changeset
216 g_hash_table_insert(confwins, plugin, window);
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
217 }
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
218 else if (plugin->info->prefs_info &&
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
219 plugin->info->prefs_info->get_plugin_pref_frame)
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
220 {
16383
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
221 process_pref_frame(plugin->info->prefs_info->get_plugin_pref_frame(plugin));
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
222 return;
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
223 }
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
224 else
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
225 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
226 purple_notify_info(plugin, _("Error"),
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
227 _("No configuration options for this plugin."), NULL);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
228 return;
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
229 }
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
230 }
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
231
15878
f52832b611fe renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents: 15357
diff changeset
232 void finch_plugins_show_all()
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
233 {
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
234 GntWidget *window, *tree, *box, *aboot, *button;
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
235 GList *iter;
16999
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
236 GList *seen;
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
237
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
238 if (plugins.window)
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
239 return;
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
240
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
241 purple_plugins_probe(G_MODULE_SUFFIX);
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
242
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
243 plugins.window = window = gnt_vbox_new(FALSE);
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
244 gnt_box_set_toplevel(GNT_BOX(window), TRUE);
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
245 gnt_box_set_title(GNT_BOX(window), _("Plugins"));
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
246 gnt_box_set_pad(GNT_BOX(window), 0);
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
247 gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID);
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
248
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
249 gnt_box_add_widget(GNT_BOX(window),
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
250 gnt_label_new(_("You can (un)load plugins from the following list.")));
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
251 gnt_box_add_widget(GNT_BOX(window), gnt_hline_new());
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
252
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
253 box = gnt_hbox_new(FALSE);
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
254 gnt_box_add_widget(GNT_BOX(window), box);
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
255 gnt_box_add_widget(GNT_BOX(window), gnt_hline_new());
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
256
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
257 gnt_box_set_pad(GNT_BOX(box), 0);
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
258 plugins.tree = tree = gnt_tree_new();
14167
ca6027c33d2c [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14121
diff changeset
259 gnt_tree_set_compare_func(GNT_TREE(tree), (GCompareFunc)plugin_compare);
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
260 GNT_WIDGET_SET_FLAGS(tree, GNT_WIDGET_NO_BORDER);
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
261 gnt_box_add_widget(GNT_BOX(box), tree);
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
262 gnt_box_add_widget(GNT_BOX(box), gnt_vline_new());
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
263
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
264 plugins.aboot = aboot = gnt_text_view_new();
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
265 gnt_widget_set_size(aboot, 40, 20);
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
266 gnt_box_add_widget(GNT_BOX(box), aboot);
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
267
16999
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
268 seen = purple_prefs_get_path_list("/finch/plugins/seen");
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
269 for (iter = purple_plugins_get_all(); iter; iter = iter->next)
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
270 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
271 PurplePlugin *plug = iter->data;
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
272
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
273 if (plug->info->type != PURPLE_PLUGIN_STANDARD ||
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
274 (plug->info->flags & PURPLE_PLUGIN_FLAG_INVISIBLE) ||
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
275 plug->error)
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
276 continue;
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
277
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
278 gnt_tree_add_choice(GNT_TREE(tree), plug,
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
279 gnt_tree_create_row(GNT_TREE(tree), plug->info->name), NULL, NULL);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
280 gnt_tree_set_choice(GNT_TREE(tree), plug, purple_plugin_is_loaded(plug));
16999
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
281 if (!g_list_find_custom(seen, plug->path, (GCompareFunc)strcmp))
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
282 gnt_tree_set_row_flags(GNT_TREE(tree), plug, GNT_TEXT_FLAG_BOLD);
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
283 }
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
284 gnt_tree_set_col_width(GNT_TREE(tree), 0, 30);
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
285 g_signal_connect(G_OBJECT(tree), "toggled", G_CALLBACK(plugin_toggled_cb), NULL);
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
286 g_signal_connect(G_OBJECT(tree), "selection_changed", G_CALLBACK(selection_changed), NULL);
16999
2d66b5256b1b I liked Etan's suggestion in devel. Now, Finch will bold unseen plugins in the plugin dialog. A plugin is considered 'seen' only after the details of the plugin is viewed by the user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16490
diff changeset
287 g_object_set_data(G_OBJECT(tree), "seen-list", seen);
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
288
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
289 box = gnt_hbox_new(FALSE);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
290 gnt_box_add_widget(GNT_BOX(window), box);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
291
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
292 button = gnt_button_new(_("Close"));
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
293 gnt_box_add_widget(GNT_BOX(box), button);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
294 g_signal_connect_swapped(G_OBJECT(button), "activate",
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
295 G_CALLBACK(gnt_widget_destroy), window);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
296
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
297 plugins.conf = button = gnt_button_new(_("Configure Plugin"));
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
298 gnt_box_add_widget(GNT_BOX(box), button);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
299 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(configure_plugin_cb), NULL);
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
300
14086
732c14687955 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14072
diff changeset
301 g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(reset_plugin_window), NULL);
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
302
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
303 gnt_widget_show(window);
14201
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
304
d54dc208efe2 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14167
diff changeset
305 decide_conf_button(gnt_tree_get_selection_data(GNT_TREE(tree)));
14072
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
306 }
4e64a4f18686 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
307
16383
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
308 static void
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
309 process_pref_frame(PurplePluginPrefFrame *frame)
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
310 {
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
311 PurpleRequestField *field;
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
312 PurpleRequestFields *fields;
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
313 PurpleRequestFieldGroup *group = NULL;
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
314 GList *prefs;
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
315
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
316 fields = purple_request_fields_new();
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
317
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
318 for (prefs = purple_plugin_pref_frame_get_prefs(frame); prefs; prefs = prefs->next) {
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
319 PurplePluginPref *pref = prefs->data;
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
320 const char *name = purple_plugin_pref_get_name(pref);
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
321 const char *label = purple_plugin_pref_get_label(pref);
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
322 if(name == NULL) {
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
323 if(label == NULL)
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
324 continue;
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
325
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
326 if(purple_plugin_pref_get_type(pref) == PURPLE_PLUGIN_PREF_INFO) {
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
327 field = purple_request_field_label_new("*", purple_plugin_pref_get_label(pref));
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
328 purple_request_field_group_add_field(group, field);
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
329 } else {
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
330 group = purple_request_field_group_new(label);
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
331 purple_request_fields_add_group(fields, group);
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
332 }
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
333 continue;
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
334 }
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
335
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
336 field = NULL;
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
337 switch(purple_prefs_get_type(name)) {
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
338 case PURPLE_PREF_BOOLEAN:
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
339 field = purple_request_field_bool_new(name, label, purple_prefs_get_bool(name));
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
340 break;
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
341 case PURPLE_PREF_INT:
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
342 field = purple_request_field_int_new(name, label, purple_prefs_get_int(name));
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
343 break;
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
344 case PURPLE_PREF_STRING:
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
345 field = purple_request_field_string_new(name, label, purple_prefs_get_string(name),
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
346 purple_plugin_pref_get_format_type(pref) & PURPLE_STRING_FORMAT_TYPE_MULTILINE);
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
347 break;
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
348 default:
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
349 break;
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
350 }
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
351 if (field) {
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
352 if (group == NULL) {
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
353 group = purple_request_field_group_new(_("Preferences"));
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
354 purple_request_fields_add_group(fields, group);
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
355 }
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
356 purple_request_field_group_add_field(group, field);
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
357 }
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
358 }
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
359
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
360 purple_request_fields(NULL, _("Preferences"), NULL, NULL, fields,
16490
68c22924d66b Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents: 16478
diff changeset
361 _("Save"), G_CALLBACK(finch_request_save_in_prefs), _("Cancel"), NULL,
68c22924d66b Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents: 16478
diff changeset
362 NULL, NULL, NULL,
68c22924d66b Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents: 16478
diff changeset
363 NULL);
16383
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
364 }
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16313
diff changeset
365

mercurial