annotate console/gntplugin.c @ 15370:6e08118f2cd6

[gaim-migrate @ 18163] Include oscarcommon.h in the tarball Include symlinks in the RPMs (liboscar.so and liboscar.so.1) committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 19 Jan 2007 04:13:59 +0000
parents 7d6bd7a4994f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14558
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
1 /**
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
2 * @file gntplugin.c GNT Plugins API
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
3 * @ingroup gntui
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
4 *
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
5 * gaim
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
6 *
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
9 * source distribution.
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
10 *
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
11 * This program is free software; you can redistribute it and/or modify
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
12 * it under the terms of the GNU General Public License as published by
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
14 * (at your option) any later version.
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
15 *
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
16 * This program is distributed in the hope that it will be useful,
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
19 * GNU General Public License for more details.
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
20 *
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
21 * You should have received a copy of the GNU General Public License
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
22 * along with this program; if not, write to the Free Software
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
81650a27f253 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14148
diff changeset
24 */
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
25 #include <gnt.h>
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
26 #include <gntbox.h>
14139
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
27 #include <gntbutton.h>
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
28 #include <gntlabel.h>
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
29 #include <gntline.h>
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
30 #include <gnttree.h>
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
31
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
32 #include "notify.h"
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
33
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
34 #include "gntgaim.h"
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
35 #include "gntplugin.h"
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
36
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
37 static struct
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
38 {
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
39 GntWidget *tree;
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
40 GntWidget *window;
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
41 GntWidget *aboot;
14139
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
42 GntWidget *conf;
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
43 } plugins;
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
44
14148
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
45 static GHashTable *confwins;
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
46
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
47 static void
14139
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
48 decide_conf_button(GaimPlugin *plugin)
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
49 {
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
50 if (gaim_plugin_is_loaded(plugin) &&
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
51 ((GAIM_IS_GNT_PLUGIN(plugin) &&
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
52 GAIM_GNT_PLUGIN_UI_INFO(plugin) != NULL) ||
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
53 (plugin->info->prefs_info &&
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
54 plugin->info->prefs_info->get_plugin_pref_frame)))
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
55 gnt_widget_set_visible(plugins.conf, TRUE);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
56 else
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
57 gnt_widget_set_visible(plugins.conf, FALSE);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
58
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
59 gnt_box_readjust(GNT_BOX(plugins.window));
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
60 gnt_widget_draw(plugins.window);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
61 }
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
62
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
63 static void
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
64 plugin_toggled_cb(GntWidget *tree, GaimPlugin *plugin, gpointer null)
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
65 {
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
66 if (gnt_tree_get_choice(GNT_TREE(tree), plugin))
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
67 {
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
68 if(!gaim_plugin_load(plugin))
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
69 gaim_notify_error(NULL, "ERROR", "loading plugin failed", NULL);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
70 }
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
71 else
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
72 {
14148
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
73 GntWidget *win;
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
74
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
75 if (!gaim_plugin_unload(plugin))
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
76 gaim_notify_error(NULL, "ERROR", "unloading plugin failed", NULL);
14148
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
77
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
78 if ((win = g_hash_table_lookup(confwins, plugin)) != NULL)
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
79 {
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
80 gnt_widget_destroy(win);
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
81 }
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
82 }
14139
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
83 decide_conf_button(plugin);
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
84 gg_plugins_save_loaded();
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
85 }
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
86
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
87 /* Xerox */
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
88 void
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
89 gg_plugins_save_loaded(void)
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
90 {
15295
7d6bd7a4994f [gaim-migrate @ 18086]
Nathan Walp <nwalp@pidgin.im>
parents: 15041
diff changeset
91 gaim_plugins_save_loaded("/gaim/gnt/plugins/loaded");
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
92 }
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
93
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
94 static void
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
95 selection_changed(GntWidget *widget, gpointer old, gpointer current, gpointer null)
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
96 {
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
97 GaimPlugin *plugin = current;
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
98 char *text;
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
99
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
100 /* XXX: Use formatting and stuff */
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
101 gnt_text_view_clear(GNT_TEXT_VIEW(plugins.aboot));
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
102 text = g_strdup_printf(_("Name: %s\nVersion: %s\nDescription: %s\nAuthor: %s\nWebsite: %s\nFilename: %s\n"),
15041
3d87d9b7491c [gaim-migrate @ 17824]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14558
diff changeset
103 SAFE(plugin->info->name), SAFE(plugin->info->version), SAFE(plugin->info->description),
3d87d9b7491c [gaim-migrate @ 17824]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14558
diff changeset
104 SAFE(plugin->info->author), SAFE(plugin->info->homepage), SAFE(plugin->path));
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
105 gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(plugins.aboot),
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
106 text, GNT_TEXT_FLAG_NORMAL);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
107 gnt_text_view_scroll(GNT_TEXT_VIEW(plugins.aboot), 0);
14105
eaf7f35635bc [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14059
diff changeset
108 g_free(text);
14139
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
109 decide_conf_button(plugin);
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
110 }
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
111
14024
7109e6397a31 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14010
diff changeset
112 static void
7109e6397a31 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14010
diff changeset
113 reset_plugin_window(GntWidget *window, gpointer null)
7109e6397a31 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14010
diff changeset
114 {
7109e6397a31 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14010
diff changeset
115 plugins.window = NULL;
7109e6397a31 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14010
diff changeset
116 plugins.tree = NULL;
7109e6397a31 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14010
diff changeset
117 plugins.aboot = NULL;
7109e6397a31 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14010
diff changeset
118 }
7109e6397a31 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14010
diff changeset
119
14105
eaf7f35635bc [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14059
diff changeset
120 static int
eaf7f35635bc [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14059
diff changeset
121 plugin_compare(GaimPlugin *p1, GaimPlugin *p2)
eaf7f35635bc [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14059
diff changeset
122 {
eaf7f35635bc [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14059
diff changeset
123 char *s1 = g_utf8_strup(p1->info->name, -1);
eaf7f35635bc [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14059
diff changeset
124 char *s2 = g_utf8_strup(p2->info->name, -1);
eaf7f35635bc [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14059
diff changeset
125 int ret = g_utf8_collate(s1, s2);
eaf7f35635bc [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14059
diff changeset
126 g_free(s1);
eaf7f35635bc [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14059
diff changeset
127 g_free(s2);
eaf7f35635bc [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14059
diff changeset
128 return ret;
eaf7f35635bc [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14059
diff changeset
129 }
eaf7f35635bc [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14059
diff changeset
130
14139
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
131 static void
14148
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
132 confwin_init()
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
133 {
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
134 confwins = g_hash_table_new(g_direct_hash, g_direct_equal);
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
135 }
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
136
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
137 static void
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
138 remove_confwin(GntWidget *window, gpointer plugin)
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
139 {
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
140 g_hash_table_remove(confwins, plugin);
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
141 }
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
142
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
143 static void
14139
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
144 configure_plugin_cb(GntWidget *button, gpointer null)
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
145 {
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
146 GaimPlugin *plugin;
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
147 GGPluginFrame callback;
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
148
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
149 g_return_if_fail(plugins.tree != NULL);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
150
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
151 plugin = gnt_tree_get_selection_data(GNT_TREE(plugins.tree));
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
152 if (!gaim_plugin_is_loaded(plugin))
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
153 {
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
154 gaim_notify_error(plugin, _("Error"),
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
155 _("Plugin need to be loaded before you can configure it."), NULL);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
156 return;
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
157 }
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
158
14148
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
159 if (confwins && g_hash_table_lookup(confwins, plugin))
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
160 return;
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
161
14139
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
162 if (GAIM_IS_GNT_PLUGIN(plugin) &&
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
163 (callback = GAIM_GNT_PLUGIN_UI_INFO(plugin)) != NULL)
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
164 {
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
165 GntWidget *window = gnt_vbox_new(FALSE);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
166 GntWidget *box, *button;
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
167
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
168 gnt_box_set_toplevel(GNT_BOX(window), TRUE);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
169 gnt_box_set_title(GNT_BOX(window), plugin->info->name);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
170 gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
171
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
172 box = callback();
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
173 gnt_box_add_widget(GNT_BOX(window), box);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
174
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
175 box = gnt_hbox_new(FALSE);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
176 gnt_box_add_widget(GNT_BOX(window), box);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
177
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
178 button = gnt_button_new(_("Close"));
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
179 gnt_box_add_widget(GNT_BOX(box), button);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
180 g_signal_connect_swapped(G_OBJECT(button), "activate",
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
181 G_CALLBACK(gnt_widget_destroy), window);
14148
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
182 g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(remove_confwin), plugin);
14139
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
183
14148
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
184 gnt_widget_show(window);
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
185
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
186 if (confwins == NULL)
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
187 confwin_init();
5b9daf111b42 [gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14139
diff changeset
188 g_hash_table_insert(confwins, plugin, window);
14139
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
189 }
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
190 else if (plugin->info->prefs_info &&
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
191 plugin->info->prefs_info->get_plugin_pref_frame)
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
192 {
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
193 gaim_notify_info(plugin, _("..."),
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
194 _("Still need to do something about this."), NULL);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
195 return;
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
196 }
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
197 else
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
198 {
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
199 gaim_notify_info(plugin, _("Error"),
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
200 _("No configuration options for this plugin."), NULL);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
201 return;
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
202 }
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
203 }
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
204
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
205 void gg_plugins_show_all()
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
206 {
14139
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
207 GntWidget *window, *tree, *box, *aboot, *button;
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
208 GList *iter;
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
209 if (plugins.window)
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
210 return;
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
211
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
212 gaim_plugins_probe(G_MODULE_SUFFIX);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
213
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
214 plugins.window = window = gnt_vbox_new(FALSE);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
215 gnt_box_set_toplevel(GNT_BOX(window), TRUE);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
216 gnt_box_set_title(GNT_BOX(window), _("Plugins"));
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
217 gnt_box_set_pad(GNT_BOX(window), 0);
14139
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
218 gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID);
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
219
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
220 gnt_box_add_widget(GNT_BOX(window),
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
221 gnt_label_new(_("You can (un)load plugins from the following list.")));
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
222 gnt_box_add_widget(GNT_BOX(window), gnt_hline_new());
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
223
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
224 box = gnt_hbox_new(FALSE);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
225 gnt_box_add_widget(GNT_BOX(window), box);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
226 gnt_box_add_widget(GNT_BOX(window), gnt_hline_new());
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
227
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
228 gnt_box_set_pad(GNT_BOX(box), 0);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
229 plugins.tree = tree = gnt_tree_new();
14105
eaf7f35635bc [gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14059
diff changeset
230 gnt_tree_set_compare_func(GNT_TREE(tree), (GCompareFunc)plugin_compare);
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
231 GNT_WIDGET_SET_FLAGS(tree, GNT_WIDGET_NO_BORDER);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
232 gnt_box_add_widget(GNT_BOX(box), tree);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
233 gnt_box_add_widget(GNT_BOX(box), gnt_vline_new());
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
234
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
235 plugins.aboot = aboot = gnt_text_view_new();
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
236 gnt_widget_set_size(aboot, 40, 20);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
237 gnt_box_add_widget(GNT_BOX(box), aboot);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
238
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
239 for (iter = gaim_plugins_get_all(); iter; iter = iter->next)
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
240 {
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
241 GaimPlugin *plug = iter->data;
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
242
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
243 if (plug->info->type != GAIM_PLUGIN_STANDARD ||
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
244 (plug->info->flags & GAIM_PLUGIN_FLAG_INVISIBLE) ||
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
245 plug->error)
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
246 continue;
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
247
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
248 gnt_tree_add_choice(GNT_TREE(tree), plug,
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
249 gnt_tree_create_row(GNT_TREE(tree), plug->info->name), NULL, NULL);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
250 gnt_tree_set_choice(GNT_TREE(tree), plug, gaim_plugin_is_loaded(plug));
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
251 }
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
252 gnt_tree_set_col_width(GNT_TREE(tree), 0, 30);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
253 g_signal_connect(G_OBJECT(tree), "toggled", G_CALLBACK(plugin_toggled_cb), NULL);
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
254 g_signal_connect(G_OBJECT(tree), "selection_changed", G_CALLBACK(selection_changed), NULL);
14139
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
255
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
256 box = gnt_hbox_new(FALSE);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
257 gnt_box_add_widget(GNT_BOX(window), box);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
258
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
259 button = gnt_button_new(_("Close"));
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
260 gnt_box_add_widget(GNT_BOX(box), button);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
261 g_signal_connect_swapped(G_OBJECT(button), "activate",
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
262 G_CALLBACK(gnt_widget_destroy), window);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
263
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
264 plugins.conf = button = gnt_button_new(_("Configure Plugin"));
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
265 gnt_box_add_widget(GNT_BOX(box), button);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
266 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(configure_plugin_cb), NULL);
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
267
14024
7109e6397a31 [gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14010
diff changeset
268 g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(reset_plugin_window), NULL);
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
269
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
270 gnt_widget_show(window);
14139
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
271
44ec6c7cbc76 [gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14105
diff changeset
272 decide_conf_button(gnt_tree_get_selection_data(GNT_TREE(tree)));
14010
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
273 }
7573bd40a190 [gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
274