annotate src/gtkplugin.c @ 11968:53d8536c82f6

[gaim-migrate @ 14260] This fixes untoggling the background color, foreground color and font face. Love me tender. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 04 Nov 2005 05:30:51 +0000
parents 7d2d926704aa
children ee8312c764b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
6927
ee51189dfe76 [gaim-migrate @ 7474]
Christian Hammond <chipx86@chipx86.com>
parents: 5982
diff changeset
2 * @file gtkplugin.c GTK+ Plugins support
ee51189dfe76 [gaim-migrate @ 7474]
Christian Hammond <chipx86@chipx86.com>
parents: 5982
diff changeset
3 * @ingroup gtkui
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 *
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 * gaim
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 6927
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 6927
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 6927
diff changeset
9 * source distribution.
6927
ee51189dfe76 [gaim-migrate @ 7474]
Christian Hammond <chipx86@chipx86.com>
parents: 5982
diff changeset
10 *
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * (at your option) any later version.
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 *
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * GNU General Public License for more details.
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 *
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 */
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
25 #include "internal.h"
9791
4a15962c344a [gaim-migrate @ 10659]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
26 #include "gtkgaim.h"
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 #include "gtkplugin.h"
11817
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
28 #include "gtkpluginpref.h"
5981
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
29 #include "debug.h"
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
30 #include "prefs.h"
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
31
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 #include <string.h>
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
34 static GtkWidget *plugin_dialog = NULL;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
35 static GtkWidget *plugin_details = NULL;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
36 static GtkWidget *pref_button = NULL;
11781
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
37 static GHashTable *plugin_pref_dialogs = NULL;
11747
b8bf638cc4aa [gaim-migrate @ 14038]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11744
diff changeset
38
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 GtkWidget *
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 gaim_gtk_plugin_get_config_frame(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41 {
11817
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
42 GtkWidget *config = NULL;
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 g_return_val_if_fail(plugin != NULL, NULL);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45
11817
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
46 if (GAIM_IS_GTK_PLUGIN(plugin) && plugin->info->ui_info
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
47 && GAIM_GTK_PLUGIN_UI_INFO(plugin)->get_config_frame)
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
48 {
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
49 GaimGtkPluginUiInfo *ui_info;
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
50
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
51 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plugin);
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
52
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
53 config = ui_info->get_config_frame(plugin);
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54
11817
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
55 if (plugin->info->prefs_info
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
56 && plugin->info->prefs_info->get_plugin_pref_frame)
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
57 {
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
58 gaim_debug_warning("gtkplugin",
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
59 "Plugin %s contains both, ui_info and "
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
60 "prefs_info preferences; prefs_info will be "
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
61 "ignored.", plugin->info->name);
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
62 }
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
63 }
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64
11817
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
65 if (config == NULL && plugin->info->prefs_info
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
66 && plugin->info->prefs_info->get_plugin_pref_frame)
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
67 {
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
68 GaimPluginPrefFrame *frame;
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69
11817
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
70 frame = plugin->info->prefs_info->get_plugin_pref_frame(plugin);
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
71
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
72 config = gaim_gtk_plugin_pref_create_frame(frame);
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
73 }
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
74
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
75 return config;
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 }
5981
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
77
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
78 void
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
79 gaim_gtk_plugins_save(void)
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
80 {
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
81 GList *pl;
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
82 GList *files = NULL;
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
83 GaimPlugin *p;
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
84
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
85 for (pl = gaim_plugins_get_loaded(); pl != NULL; pl = pl->next) {
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
86 p = pl->data;
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
87
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
88 if (p->info->type != GAIM_PLUGIN_PROTOCOL &&
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
89 p->info->type != GAIM_PLUGIN_LOADER) {
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
90
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
91 files = g_list_append(files, p->path);
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
92 }
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
93 }
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
94
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
95 gaim_prefs_set_string_list("/gaim/gtk/plugins/loaded", files);
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
96 g_list_free(files);
81564bb4db68 [gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
97 }
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
98
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
99 static void
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
100 update_plugin_list(void *data)
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
101 {
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
102 GtkListStore *ls = GTK_LIST_STORE(data);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
103 GtkTreeIter iter;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
104 GList *probes;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
105 GaimPlugin *plug;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
106
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
107 gtk_list_store_clear(ls);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
108 gaim_plugins_probe(GAIM_PLUGIN_EXT);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
109
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
110 for (probes = gaim_plugins_get_all();
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
111 probes != NULL;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
112 probes = probes->next)
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
113 {
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
114 char *desc;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
115 plug = probes->data;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
116
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
117 if (plug->info->type != GAIM_PLUGIN_STANDARD ||
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
118 (plug->info->flags & GAIM_PLUGIN_FLAG_INVISIBLE))
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
119 {
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
120 continue;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
121 }
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
122
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
123 gtk_list_store_append (ls, &iter);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
124 desc = g_strdup_printf("<b>%s</b> %s\n%s", plug->info->name ? _(plug->info->name) : g_basename(plug->path),
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
125 plug->info->version,
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
126 plug->info->summary);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
127 gtk_list_store_set(ls, &iter,
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
128 0, gaim_plugin_is_loaded(plug),
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
129 1, desc,
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
130 2, plug, -1);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
131 g_free(desc);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
132 }
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
133 }
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
134
11781
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
135 static void pref_dialog_response_cb(GtkWidget *d, int response, GaimPlugin *plug)
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
136 {
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
137 switch (response) {
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
138 case GTK_RESPONSE_CLOSE:
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
139 case GTK_RESPONSE_DELETE_EVENT:
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
140 g_hash_table_remove(plugin_pref_dialogs, plug);
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
141 if (g_hash_table_size(plugin_pref_dialogs) == 0) {
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
142 g_hash_table_destroy(plugin_pref_dialogs);
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
143 plugin_pref_dialogs = NULL;
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
144 }
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
145 gtk_widget_destroy(d);
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
146 break;
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
147 }
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
148 }
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
149
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
150 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data)
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
151 {
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
152 GtkTreeModel *model = (GtkTreeModel *)data;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
153 GtkTreeIter iter;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
154 GtkTreePath *path = gtk_tree_path_new_from_string(pth);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
155 GaimPlugin *plug;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
156 gchar buf[1024];
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
157 gchar *name = NULL, *description = NULL;
11781
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
158 GtkWidget *dialog = NULL;
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
159
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
160 GdkCursor *wait = gdk_cursor_new (GDK_WATCH);
11742
dfb66f3f9e87 [gaim-migrate @ 14033]
Sean Egan <seanegan@gmail.com>
parents: 11741
diff changeset
161 gdk_window_set_cursor(plugin_dialog->window, wait);
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
162 gdk_cursor_unref(wait);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
163
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
164 gtk_tree_model_get_iter (model, &iter, path);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
165 gtk_tree_model_get (model, &iter, 2, &plug, -1);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
166
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
167 if (!gaim_plugin_is_loaded(plug))
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
168 gaim_plugin_load(plug);
11781
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
169 else {
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
170 if (plugin_pref_dialogs != NULL &&
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
171 (dialog = g_hash_table_lookup(plugin_pref_dialogs, plug)))
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
172 pref_dialog_response_cb(dialog, GTK_RESPONSE_DELETE_EVENT, plug);
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
173 gaim_plugin_unload(plug);
11781
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
174 }
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
175
11781
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
176 gtk_widget_set_sensitive(pref_button,
11817
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
177 gaim_plugin_is_loaded(plug)
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
178 && ((GAIM_IS_GTK_PLUGIN(plug) && plug->info->ui_info
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
179 && GAIM_GTK_PLUGIN_UI_INFO(plug)->get_config_frame)
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
180 || (plug->info->prefs_info
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
181 && plug->info->prefs_info->get_plugin_pref_frame)));
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
182
11742
dfb66f3f9e87 [gaim-migrate @ 14033]
Sean Egan <seanegan@gmail.com>
parents: 11741
diff changeset
183 gdk_window_set_cursor(plugin_dialog->window, NULL);
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
184
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
185 name = g_markup_escape_text(_(plug->info->name), -1);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
186 description = g_markup_escape_text(_(plug->info->description), -1);
11781
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
187
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
188 if (plug->error != NULL) {
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
189 gchar *error = g_markup_escape_text(plug->error, -1);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
190 gchar *desc;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
191 g_snprintf(buf, sizeof(buf),
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
192 "<span size=\"larger\">%s %s</span>\n\n"
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
193 "<span weight=\"bold\" color=\"red\">%s</span>\n\n"
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
194 "%s",
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
195 name, plug->info->version, error, description);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
196 desc = g_strdup_printf("<b>%s</b> %s\n<span weight=\"bold\" color=\"red\"%s</span>",
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
197 plug->info->name, plug->info->version, error);
11781
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
198 gtk_list_store_set (GTK_LIST_STORE (model), &iter,
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
199 1, desc,
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
200 -1);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
201 g_free(desc);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
202 g_free(error);
11843
6539e6aa8ae6 [gaim-migrate @ 14134]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11833
diff changeset
203 gtk_label_set_markup(GTK_LABEL(plugin_details), buf);
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
204 }
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
205 g_free(name);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
206 g_free(description);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
207
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
208
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
209 gtk_list_store_set (GTK_LIST_STORE (model), &iter,
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
210 0, gaim_plugin_is_loaded(plug),
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
211 -1);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
212
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
213 gtk_tree_path_free(path);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
214 gaim_gtk_plugins_save();
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
215 }
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
216
11877
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
217 static gboolean ensure_plugin_visible(void *data)
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
218 {
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
219 GtkTreeSelection *sel = GTK_TREE_SELECTION(data);
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
220 GtkTreeView *tv = gtk_tree_selection_get_tree_view(sel);
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
221 GtkTreeModel *model = gtk_tree_view_get_model(tv);
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
222 GtkTreePath *path;
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
223 GtkTreeIter iter;
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
224 if (!gtk_tree_selection_get_selected (sel, &model, &iter))
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
225 return FALSE;
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
226 path = gtk_tree_model_get_path(model, &iter);
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
227 gtk_tree_view_scroll_to_cell(gtk_tree_selection_get_tree_view(sel), path, NULL, FALSE, 0, 0);
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
228 gtk_tree_path_free(path);
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
229 return FALSE;
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
230 }
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
231
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
232 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model)
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
233 {
11741
8034f752feae [gaim-migrate @ 14032]
Sean Egan <seanegan@gmail.com>
parents: 11740
diff changeset
234 gchar *buf, *pname, *pdesc, *pauth, *pweb;
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
235 GtkTreeIter iter;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
236 GValue val = { 0, };
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
237 GaimPlugin *plug;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
238
11833
9d3ab7919ee0 [gaim-migrate @ 14124]
Mark Doliner <mark@kingant.net>
parents: 11817
diff changeset
239 if (!gtk_tree_selection_get_selected (sel, &model, &iter))
9d3ab7919ee0 [gaim-migrate @ 14124]
Mark Doliner <mark@kingant.net>
parents: 11817
diff changeset
240 {
9d3ab7919ee0 [gaim-migrate @ 14124]
Mark Doliner <mark@kingant.net>
parents: 11817
diff changeset
241 /* Clear the old plugin details */
9d3ab7919ee0 [gaim-migrate @ 14124]
Mark Doliner <mark@kingant.net>
parents: 11817
diff changeset
242 gtk_label_set_markup(GTK_LABEL(plugin_details), "");
9d3ab7919ee0 [gaim-migrate @ 14124]
Mark Doliner <mark@kingant.net>
parents: 11817
diff changeset
243 gtk_widget_set_sensitive(pref_button, FALSE);
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
244 return;
11833
9d3ab7919ee0 [gaim-migrate @ 14124]
Mark Doliner <mark@kingant.net>
parents: 11817
diff changeset
245 }
9d3ab7919ee0 [gaim-migrate @ 14124]
Mark Doliner <mark@kingant.net>
parents: 11817
diff changeset
246
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
247 gtk_tree_model_get_value (model, &iter, 2, &val);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
248 plug = g_value_get_pointer(&val);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
249
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
250 pname = g_markup_escape_text(_(plug->info->name), -1);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
251 pdesc = (plug->info->description) ?
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
252 g_markup_escape_text(_(plug->info->description), -1) : NULL;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
253 pauth = (plug->info->author) ?
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
254 g_markup_escape_text(_(plug->info->author), -1) : NULL;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
255 pweb = (plug->info->homepage) ?
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
256 g_markup_escape_text(_(plug->info->homepage), -1) : NULL;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
257 buf = g_strdup_printf(
11771
08b1dd8aa11c [gaim-migrate @ 14062]
Richard Laager <rlaager@wiktel.com>
parents: 11770
diff changeset
258 _("%s%s"
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
259 "<span weight=\"bold\">Written by:</span>\t%s\n"
11777
1253620ea5f2 [gaim-migrate @ 14068]
Richard Laager <rlaager@wiktel.com>
parents: 11775
diff changeset
260 "<span weight=\"bold\">Web site:</span>\t\t%s\n"
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
261 "<span weight=\"bold\">File name:</span>\t%s"),
11771
08b1dd8aa11c [gaim-migrate @ 14062]
Richard Laager <rlaager@wiktel.com>
parents: 11770
diff changeset
262 pdesc ? pdesc : "", pdesc ? "\n\n" : "",
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
263 pauth ? pauth : "", pweb ? pweb : "", plug->path);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
264
11817
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
265 gtk_widget_set_sensitive(pref_button,
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
266 gaim_plugin_is_loaded(plug)
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
267 && ((GAIM_IS_GTK_PLUGIN(plug) && plug->info->ui_info
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
268 && GAIM_GTK_PLUGIN_UI_INFO(plug)->get_config_frame)
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
269 || (plug->info->prefs_info
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
270 && plug->info->prefs_info->get_plugin_pref_frame)));
1bb0efbd4394 [gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11813
diff changeset
271
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
272 gtk_label_set_markup(GTK_LABEL(plugin_details), buf);
11877
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
273
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
274 /* Make sure the selected plugin is still visible */
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
275 g_idle_add(ensure_plugin_visible, sel);
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
276
f1f7c83d7b6c [gaim-migrate @ 14168]
Sean Egan <seanegan@gmail.com>
parents: 11843
diff changeset
277
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
278 g_value_unset(&val);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
279 g_free(buf);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
280 g_free(pname);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
281 g_free(pdesc);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
282 g_free(pauth);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
283 g_free(pweb);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
284 }
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
285
11741
8034f752feae [gaim-migrate @ 14032]
Sean Egan <seanegan@gmail.com>
parents: 11740
diff changeset
286 static void plugin_dialog_response_cb(GtkWidget *d, int response, GtkTreeSelection *sel)
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
287 {
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
288 GaimPlugin *plug;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
289 GtkWidget *dialog, *box;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
290 GtkTreeModel *model;
11743
935278abb386 [gaim-migrate @ 14034]
Sean Egan <seanegan@gmail.com>
parents: 11742
diff changeset
291 GValue val = { 0, };
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
292 GtkTreeIter iter;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
293
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
294 switch (response) {
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
295 case GTK_RESPONSE_CLOSE:
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
296 case GTK_RESPONSE_DELETE_EVENT:
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
297 gtk_widget_destroy(d);
11888
7d2d926704aa [gaim-migrate @ 14179]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11886
diff changeset
298 if (plugin_pref_dialogs != NULL) {
7d2d926704aa [gaim-migrate @ 14179]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11886
diff changeset
299 g_hash_table_destroy(plugin_pref_dialogs);
7d2d926704aa [gaim-migrate @ 14179]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11886
diff changeset
300 plugin_pref_dialogs = NULL;
7d2d926704aa [gaim-migrate @ 14179]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11886
diff changeset
301 }
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
302 plugin_dialog = NULL;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
303 break;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
304 case 98121:
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
305 if (! gtk_tree_selection_get_selected (sel, &model, &iter))
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
306 return;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
307 gtk_tree_model_get_value (model, &iter, 2, &val);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
308 plug = g_value_get_pointer(&val);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
309 if (plug == NULL)
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
310 break;
11781
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
311 if (plugin_pref_dialogs != NULL &&
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
312 g_hash_table_lookup(plugin_pref_dialogs, plug))
11770
d353f31d17a9 [gaim-migrate @ 14061]
Sean Egan <seanegan@gmail.com>
parents: 11751
diff changeset
313 break;
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
314 box = gaim_gtk_plugin_get_config_frame(plug);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
315 if (box == NULL)
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
316 break;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
317
11741
8034f752feae [gaim-migrate @ 14032]
Sean Egan <seanegan@gmail.com>
parents: 11740
diff changeset
318 dialog = gtk_dialog_new_with_buttons(GAIM_ALERT_TITLE, GTK_WINDOW(d),
11744
628dd7aa6509 [gaim-migrate @ 14035]
Sean Egan <seanegan@gmail.com>
parents: 11743
diff changeset
319 GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_DESTROY_WITH_PARENT,
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
320 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
321 NULL);
11781
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
322 if (plugin_pref_dialogs == NULL)
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
323 plugin_pref_dialogs = g_hash_table_new(NULL, NULL);
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
324
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
325 g_hash_table_insert(plugin_pref_dialogs, plug, dialog);
10317f1a2de2 [gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11777
diff changeset
326
11770
d353f31d17a9 [gaim-migrate @ 14061]
Sean Egan <seanegan@gmail.com>
parents: 11751
diff changeset
327 g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(pref_dialog_response_cb), plug);
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
328 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), box);
11747
b8bf638cc4aa [gaim-migrate @ 14038]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11744
diff changeset
329 gtk_window_set_role(GTK_WINDOW(dialog), "plugin_config");
11775
400b802cd62b [gaim-migrate @ 14066]
Gary Kramlich <grim@reaperworld.com>
parents: 11771
diff changeset
330 gtk_window_set_title(GTK_WINDOW(dialog), gaim_plugin_get_name(plug));
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
331 gtk_widget_show_all(dialog);
11770
d353f31d17a9 [gaim-migrate @ 14061]
Sean Egan <seanegan@gmail.com>
parents: 11751
diff changeset
332 g_value_unset(&val);
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
333 break;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
334 }
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
335 }
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
336
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
337 void gaim_gtk_plugin_dialog_show()
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
338 {
11741
8034f752feae [gaim-migrate @ 14032]
Sean Egan <seanegan@gmail.com>
parents: 11740
diff changeset
339 GtkWidget *sw;
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
340 GtkWidget *event_view;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
341 GtkListStore *ls;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
342 GtkCellRenderer *rend, *rendt;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
343 GtkTreeViewColumn *col;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
344 GtkTreeSelection *sel;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
345 GtkWidget *expander;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
346
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
347 if (plugin_dialog != NULL) {
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
348 gtk_window_present(GTK_WINDOW(plugin_dialog));
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
349 return;
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
350 }
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
351
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
352 plugin_dialog = gtk_dialog_new_with_buttons(_("Plugins"),
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
353 NULL,
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
354 GTK_DIALOG_NO_SEPARATOR,
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
355 NULL);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
356 pref_button = gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), GTK_STOCK_PREFERENCES, 98121);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
357 gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
11813
1f7f4f850db5 [gaim-migrate @ 14104]
Gary Kramlich <grim@reaperworld.com>
parents: 11794
diff changeset
358 gtk_widget_set_sensitive(pref_button, FALSE);
11747
b8bf638cc4aa [gaim-migrate @ 14038]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11744
diff changeset
359 gtk_window_set_role(GTK_WINDOW(plugin_dialog), "plugins");
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
360
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
361 sw = gtk_scrolled_window_new(NULL,NULL);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
362 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
363 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
364
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
365 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(plugin_dialog)->vbox), sw, TRUE, TRUE, 0);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
366
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
367 ls = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
368 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls),
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
369 1, GTK_SORT_ASCENDING);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
370
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
371 update_plugin_list(ls);
11813
1f7f4f850db5 [gaim-migrate @ 14104]
Gary Kramlich <grim@reaperworld.com>
parents: 11794
diff changeset
372
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
373 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls));
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
374
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
375 rend = gtk_cell_renderer_toggle_new();
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
376 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view));
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
377
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
378 col = gtk_tree_view_column_new_with_attributes (_("Enabled"),
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
379 rend,
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
380 "active", 0,
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
381 NULL);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
382 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col);
11794
f5105a2b8bf6 [gaim-migrate @ 14085]
Gary Kramlich <grim@reaperworld.com>
parents: 11783
diff changeset
383 gtk_tree_view_column_set_sort_column_id(col, 0);
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
384 g_signal_connect (G_OBJECT(rend), "toggled",
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
385 G_CALLBACK(plugin_load), ls);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
386
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
387 rendt = gtk_cell_renderer_text_new();
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
388 col = gtk_tree_view_column_new_with_attributes (_("Name"),
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
389 rendt,
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
390 "markup", 1,
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
391 NULL);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
392 #if GTK_CHECK_VERSION(2,6,0)
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
393 gtk_tree_view_column_set_expand (col, TRUE);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
394 g_object_set(rendt, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
395 #endif
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
396 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col);
11794
f5105a2b8bf6 [gaim-migrate @ 14085]
Gary Kramlich <grim@reaperworld.com>
parents: 11783
diff changeset
397 gtk_tree_view_column_set_sort_column_id(col, 1);
11740
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
398 g_object_unref(G_OBJECT(ls));
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
399 gtk_container_add(GTK_CONTAINER(sw), event_view);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
400
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
401 expander = gtk_expander_new(_("<b>Plugin Details</b>"));
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
402 gtk_expander_set_use_markup(GTK_EXPANDER(expander), TRUE);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
403 plugin_details = gtk_label_new(NULL);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
404 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
405 gtk_container_add(GTK_CONTAINER(expander), plugin_details);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
406 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(plugin_dialog)->vbox), expander, FALSE, FALSE, 0);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
407
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
408 g_signal_connect (G_OBJECT (sel), "changed", G_CALLBACK (prefs_plugin_sel), NULL);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
409 g_signal_connect(G_OBJECT(plugin_dialog), "response", G_CALLBACK(plugin_dialog_response_cb), sel);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
410 gtk_window_set_default_size(GTK_WINDOW(plugin_dialog), 430, 430);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
411 gtk_widget_show_all(plugin_dialog);
7e0ad3b6882a [gaim-migrate @ 14031]
Sean Egan <seanegan@gmail.com>
parents: 9791
diff changeset
412 }