Mercurial > pidgin
annotate src/gtkplugin.c @ 12801:d24bc9737de8
[gaim-migrate @ 15148]
Avoid infinite loopage when we can't generate enough colors. Hopefully someone will come up with a better solution and this will get removed; until then...
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Tue, 10 Jan 2006 03:30:37 +0000 |
parents | 31b860fcf1aa |
children | a9cd674078b1 |
rev | line source |
---|---|
5205 | 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 | 4 * |
5 * gaim | |
6 * | |
8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
6927
ee51189dfe76
[gaim-migrate @ 7474]
Christian Hammond <chipx86@chipx86.com>
parents:
5982
diff
changeset
|
10 * |
5205 | 11 * This program is free software; you can redistribute it and/or modify |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
11740 | 25 #include "internal.h" |
9791 | 26 #include "gtkgaim.h" |
5205 | 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 | 32 #include <string.h> |
33 | |
12246 | 34 #define GAIM_RESPONSE_CONFIGURE 98121 |
35 | |
12343 | 36 static GtkWidget *expander = NULL; |
11740 | 37 static GtkWidget *plugin_dialog = NULL; |
38 static GtkWidget *plugin_details = NULL; | |
39 static GtkWidget *pref_button = NULL; | |
11781
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
40 static GHashTable *plugin_pref_dialogs = NULL; |
11747
b8bf638cc4aa
[gaim-migrate @ 14038]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11744
diff
changeset
|
41 |
5205 | 42 GtkWidget * |
43 gaim_gtk_plugin_get_config_frame(GaimPlugin *plugin) | |
44 { | |
11817
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
45 GtkWidget *config = NULL; |
5205 | 46 |
47 g_return_val_if_fail(plugin != NULL, NULL); | |
48 | |
11817
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
49 if (GAIM_IS_GTK_PLUGIN(plugin) && plugin->info->ui_info |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
50 && GAIM_GTK_PLUGIN_UI_INFO(plugin)->get_config_frame) |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
51 { |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
52 GaimGtkPluginUiInfo *ui_info; |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
53 |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
54 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plugin); |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
55 |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
56 config = ui_info->get_config_frame(plugin); |
5205 | 57 |
11817
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
58 if (plugin->info->prefs_info |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
59 && plugin->info->prefs_info->get_plugin_pref_frame) |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
60 { |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
61 gaim_debug_warning("gtkplugin", |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
62 "Plugin %s contains both, ui_info and " |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
63 "prefs_info preferences; prefs_info will be " |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
64 "ignored.", plugin->info->name); |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
65 } |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
66 } |
5205 | 67 |
11817
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
68 if (config == NULL && plugin->info->prefs_info |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
69 && plugin->info->prefs_info->get_plugin_pref_frame) |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
70 { |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
71 GaimPluginPrefFrame *frame; |
5205 | 72 |
11817
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
73 frame = plugin->info->prefs_info->get_plugin_pref_frame(plugin); |
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 config = gaim_gtk_plugin_pref_create_frame(frame); |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
76 } |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
77 |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
78 return config; |
5205 | 79 } |
5981
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 void |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
82 gaim_gtk_plugins_save(void) |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
83 { |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
84 GList *pl; |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
85 GList *files = NULL; |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
86 GaimPlugin *p; |
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 for (pl = gaim_plugins_get_loaded(); pl != NULL; pl = pl->next) { |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
89 p = pl->data; |
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 if (p->info->type != GAIM_PLUGIN_PROTOCOL && |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
92 p->info->type != GAIM_PLUGIN_LOADER) { |
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 files = g_list_append(files, p->path); |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
95 } |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
96 } |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
97 |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
98 gaim_prefs_set_string_list("/gaim/gtk/plugins/loaded", files); |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
99 g_list_free(files); |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
100 } |
11740 | 101 |
102 static void | |
103 update_plugin_list(void *data) | |
104 { | |
105 GtkListStore *ls = GTK_LIST_STORE(data); | |
106 GtkTreeIter iter; | |
107 GList *probes; | |
108 GaimPlugin *plug; | |
109 | |
110 gtk_list_store_clear(ls); | |
12066 | 111 gaim_plugins_probe(G_MODULE_SUFFIX); |
11740 | 112 |
113 for (probes = gaim_plugins_get_all(); | |
114 probes != NULL; | |
115 probes = probes->next) | |
116 { | |
12702
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
117 char *name; |
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
118 char *version; |
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
119 char *summary; |
11740 | 120 char *desc; |
121 plug = probes->data; | |
122 | |
123 if (plug->info->type != GAIM_PLUGIN_STANDARD || | |
124 (plug->info->flags & GAIM_PLUGIN_FLAG_INVISIBLE)) | |
125 { | |
126 continue; | |
127 } | |
128 | |
129 gtk_list_store_append (ls, &iter); | |
12702
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
130 |
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
131 name = g_markup_escape_text(plug->info->name ? _(plug->info->name) : g_basename(plug->path), -1); |
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
132 version = g_markup_escape_text(plug->info->version, -1); |
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
133 summary = g_markup_escape_text(_(plug->info->summary), -1); |
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
134 |
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
135 desc = g_strdup_printf("<b>%s</b> %s\n%s", name, |
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
136 version, |
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
137 summary); |
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
138 g_free(name); |
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
139 g_free(version); |
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
140 g_free(summary); |
ba7834d6e2c9
[gaim-migrate @ 15045]
Richard Laager <rlaager@wiktel.com>
parents:
12695
diff
changeset
|
141 |
11740 | 142 gtk_list_store_set(ls, &iter, |
143 0, gaim_plugin_is_loaded(plug), | |
144 1, desc, | |
12695
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
145 2, plug, |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
146 3, gaim_plugin_is_unloadable(plug), |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
147 -1); |
11740 | 148 g_free(desc); |
149 } | |
150 } | |
151 | |
11781
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
152 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
|
153 { |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
154 switch (response) { |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
155 case GTK_RESPONSE_CLOSE: |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
156 case GTK_RESPONSE_DELETE_EVENT: |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
157 g_hash_table_remove(plugin_pref_dialogs, plug); |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
158 if (g_hash_table_size(plugin_pref_dialogs) == 0) { |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
159 g_hash_table_destroy(plugin_pref_dialogs); |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
160 plugin_pref_dialogs = NULL; |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
161 } |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
162 gtk_widget_destroy(d); |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
163 break; |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
164 } |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
165 } |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
166 |
11740 | 167 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
168 { | |
169 GtkTreeModel *model = (GtkTreeModel *)data; | |
170 GtkTreeIter iter; | |
171 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
172 GaimPlugin *plug; | |
173 gchar buf[1024]; | |
174 gchar *name = NULL, *description = NULL; | |
11781
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
175 GtkWidget *dialog = NULL; |
12695
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
176 GdkCursor *wait; |
11740 | 177 |
178 gtk_tree_model_get_iter (model, &iter, path); | |
179 gtk_tree_model_get (model, &iter, 2, &plug, -1); | |
180 | |
12695
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
181 /* Apparently, GTK+ won't honor the sensitive flag on cell renderers for booleans. */ |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
182 if (gaim_plugin_is_unloadable(plug)) |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
183 return; |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
184 |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
185 wait = gdk_cursor_new (GDK_WATCH); |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
186 gdk_window_set_cursor(plugin_dialog->window, wait); |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
187 gdk_cursor_unref(wait); |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
188 |
11740 | 189 if (!gaim_plugin_is_loaded(plug)) |
190 gaim_plugin_load(plug); | |
11781
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
191 else { |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
192 if (plugin_pref_dialogs != NULL && |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
193 (dialog = g_hash_table_lookup(plugin_pref_dialogs, plug))) |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
194 pref_dialog_response_cb(dialog, GTK_RESPONSE_DELETE_EVENT, plug); |
11740 | 195 gaim_plugin_unload(plug); |
11781
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
196 } |
11740 | 197 |
11781
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
198 gtk_widget_set_sensitive(pref_button, |
11817
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
199 gaim_plugin_is_loaded(plug) |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
200 && ((GAIM_IS_GTK_PLUGIN(plug) && plug->info->ui_info |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
201 && GAIM_GTK_PLUGIN_UI_INFO(plug)->get_config_frame) |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
202 || (plug->info->prefs_info |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
203 && plug->info->prefs_info->get_plugin_pref_frame))); |
11740 | 204 |
11742 | 205 gdk_window_set_cursor(plugin_dialog->window, NULL); |
11740 | 206 |
207 name = g_markup_escape_text(_(plug->info->name), -1); | |
208 description = g_markup_escape_text(_(plug->info->description), -1); | |
11781
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
209 |
11740 | 210 if (plug->error != NULL) { |
211 gchar *error = g_markup_escape_text(plug->error, -1); | |
212 gchar *desc; | |
213 g_snprintf(buf, sizeof(buf), | |
214 "<span size=\"larger\">%s %s</span>\n\n" | |
215 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
216 "%s", | |
217 name, plug->info->version, error, description); | |
218 desc = g_strdup_printf("<b>%s</b> %s\n<span weight=\"bold\" color=\"red\"%s</span>", | |
219 plug->info->name, plug->info->version, error); | |
11781
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
220 gtk_list_store_set (GTK_LIST_STORE (model), &iter, |
11740 | 221 1, desc, |
222 -1); | |
223 g_free(desc); | |
224 g_free(error); | |
11843 | 225 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); |
11740 | 226 } |
227 g_free(name); | |
228 g_free(description); | |
229 | |
230 | |
12246 | 231 gtk_list_store_set (GTK_LIST_STORE (model), &iter, |
232 0, gaim_plugin_is_loaded(plug), | |
11740 | 233 -1); |
234 | |
235 gtk_tree_path_free(path); | |
236 gaim_gtk_plugins_save(); | |
237 } | |
238 | |
11877 | 239 static gboolean ensure_plugin_visible(void *data) |
240 { | |
241 GtkTreeSelection *sel = GTK_TREE_SELECTION(data); | |
12246 | 242 GtkTreeView *tv = gtk_tree_selection_get_tree_view(sel); |
11877 | 243 GtkTreeModel *model = gtk_tree_view_get_model(tv); |
244 GtkTreePath *path; | |
245 GtkTreeIter iter; | |
246 if (!gtk_tree_selection_get_selected (sel, &model, &iter)) | |
247 return FALSE; | |
248 path = gtk_tree_model_get_path(model, &iter); | |
249 gtk_tree_view_scroll_to_cell(gtk_tree_selection_get_tree_view(sel), path, NULL, FALSE, 0, 0); | |
250 gtk_tree_path_free(path); | |
251 return FALSE; | |
252 } | |
253 | |
11740 | 254 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) |
255 { | |
11741 | 256 gchar *buf, *pname, *pdesc, *pauth, *pweb; |
11740 | 257 GtkTreeIter iter; |
12600
e856f985a0b9
[gaim-migrate @ 14934]
Richard Laager <rlaager@wiktel.com>
parents:
12343
diff
changeset
|
258 GValue val; |
11740 | 259 GaimPlugin *plug; |
260 | |
11833 | 261 if (!gtk_tree_selection_get_selected (sel, &model, &iter)) |
262 { | |
263 /* Clear the old plugin details */ | |
264 gtk_label_set_markup(GTK_LABEL(plugin_details), ""); | |
265 gtk_widget_set_sensitive(pref_button, FALSE); | |
12343 | 266 |
267 /* Collapse and disable the expander widget */ | |
268 gtk_expander_set_expanded(GTK_EXPANDER(expander), FALSE); | |
269 gtk_widget_set_sensitive(expander, FALSE); | |
270 | |
11740 | 271 return; |
11833 | 272 } |
273 | |
12343 | 274 gtk_widget_set_sensitive(expander, TRUE); |
275 | |
12600
e856f985a0b9
[gaim-migrate @ 14934]
Richard Laager <rlaager@wiktel.com>
parents:
12343
diff
changeset
|
276 val.g_type = 0; |
11740 | 277 gtk_tree_model_get_value (model, &iter, 2, &val); |
278 plug = g_value_get_pointer(&val); | |
279 | |
280 pname = g_markup_escape_text(_(plug->info->name), -1); | |
281 pdesc = (plug->info->description) ? | |
282 g_markup_escape_text(_(plug->info->description), -1) : NULL; | |
283 pauth = (plug->info->author) ? | |
284 g_markup_escape_text(_(plug->info->author), -1) : NULL; | |
285 pweb = (plug->info->homepage) ? | |
286 g_markup_escape_text(_(plug->info->homepage), -1) : NULL; | |
287 buf = g_strdup_printf( | |
11771
08b1dd8aa11c
[gaim-migrate @ 14062]
Richard Laager <rlaager@wiktel.com>
parents:
11770
diff
changeset
|
288 _("%s%s" |
11740 | 289 "<span weight=\"bold\">Written by:</span>\t%s\n" |
12705
31b860fcf1aa
[gaim-migrate @ 15048]
Richard Laager <rlaager@wiktel.com>
parents:
12702
diff
changeset
|
290 "<span weight=\"bold\">Website:</span>\t\t%s\n" |
31b860fcf1aa
[gaim-migrate @ 15048]
Richard Laager <rlaager@wiktel.com>
parents:
12702
diff
changeset
|
291 "<span weight=\"bold\">Filename:</span>\t\t%s"), |
11771
08b1dd8aa11c
[gaim-migrate @ 14062]
Richard Laager <rlaager@wiktel.com>
parents:
11770
diff
changeset
|
292 pdesc ? pdesc : "", pdesc ? "\n\n" : "", |
11740 | 293 pauth ? pauth : "", pweb ? pweb : "", plug->path); |
294 | |
12695
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
295 if (plug->error != NULL) |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
296 { |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
297 char *tmp = g_strdup_printf( |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
298 _("%s\n" |
12705
31b860fcf1aa
[gaim-migrate @ 15048]
Richard Laager <rlaager@wiktel.com>
parents:
12702
diff
changeset
|
299 "<span foreground=\"#ff0000\" weight=\"bold\">" |
31b860fcf1aa
[gaim-migrate @ 15048]
Richard Laager <rlaager@wiktel.com>
parents:
12702
diff
changeset
|
300 "Error: %s\n" |
31b860fcf1aa
[gaim-migrate @ 15048]
Richard Laager <rlaager@wiktel.com>
parents:
12702
diff
changeset
|
301 "Check the plugin website for an update." |
31b860fcf1aa
[gaim-migrate @ 15048]
Richard Laager <rlaager@wiktel.com>
parents:
12702
diff
changeset
|
302 "</span>"), |
12695
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
303 buf, plug->error); |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
304 g_free(buf); |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
305 buf = tmp; |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
306 } |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
307 |
11817
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
308 gtk_widget_set_sensitive(pref_button, |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
309 gaim_plugin_is_loaded(plug) |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
310 && ((GAIM_IS_GTK_PLUGIN(plug) && plug->info->ui_info |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
311 && GAIM_GTK_PLUGIN_UI_INFO(plug)->get_config_frame) |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
312 || (plug->info->prefs_info |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
313 && plug->info->prefs_info->get_plugin_pref_frame))); |
1bb0efbd4394
[gaim-migrate @ 14108]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11813
diff
changeset
|
314 |
11740 | 315 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); |
11877 | 316 |
317 /* Make sure the selected plugin is still visible */ | |
318 g_idle_add(ensure_plugin_visible, sel); | |
319 | |
320 | |
11740 | 321 g_value_unset(&val); |
322 g_free(buf); | |
323 g_free(pname); | |
324 g_free(pdesc); | |
325 g_free(pauth); | |
326 g_free(pweb); | |
327 } | |
328 | |
11741 | 329 static void plugin_dialog_response_cb(GtkWidget *d, int response, GtkTreeSelection *sel) |
11740 | 330 { |
331 GaimPlugin *plug; | |
332 GtkWidget *dialog, *box; | |
333 GtkTreeModel *model; | |
12600
e856f985a0b9
[gaim-migrate @ 14934]
Richard Laager <rlaager@wiktel.com>
parents:
12343
diff
changeset
|
334 GValue val; |
11740 | 335 GtkTreeIter iter; |
336 | |
337 switch (response) { | |
338 case GTK_RESPONSE_CLOSE: | |
339 case GTK_RESPONSE_DELETE_EVENT: | |
340 gtk_widget_destroy(d); | |
11888 | 341 if (plugin_pref_dialogs != NULL) { |
342 g_hash_table_destroy(plugin_pref_dialogs); | |
343 plugin_pref_dialogs = NULL; | |
344 } | |
11740 | 345 plugin_dialog = NULL; |
346 break; | |
12246 | 347 case GAIM_RESPONSE_CONFIGURE: |
11740 | 348 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
349 return; | |
12600
e856f985a0b9
[gaim-migrate @ 14934]
Richard Laager <rlaager@wiktel.com>
parents:
12343
diff
changeset
|
350 val.g_type = 0; |
e856f985a0b9
[gaim-migrate @ 14934]
Richard Laager <rlaager@wiktel.com>
parents:
12343
diff
changeset
|
351 gtk_tree_model_get_value(model, &iter, 2, &val); |
11740 | 352 plug = g_value_get_pointer(&val); |
353 if (plug == NULL) | |
354 break; | |
11781
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
355 if (plugin_pref_dialogs != NULL && |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
356 g_hash_table_lookup(plugin_pref_dialogs, plug)) |
11770 | 357 break; |
11740 | 358 box = gaim_gtk_plugin_get_config_frame(plug); |
359 if (box == NULL) | |
360 break; | |
361 | |
11741 | 362 dialog = gtk_dialog_new_with_buttons(GAIM_ALERT_TITLE, GTK_WINDOW(d), |
11744 | 363 GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_DESTROY_WITH_PARENT, |
11740 | 364 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, |
365 NULL); | |
11781
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
366 if (plugin_pref_dialogs == NULL) |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
367 plugin_pref_dialogs = g_hash_table_new(NULL, NULL); |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
368 |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
369 g_hash_table_insert(plugin_pref_dialogs, plug, dialog); |
10317f1a2de2
[gaim-migrate @ 14072]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11777
diff
changeset
|
370 |
11770 | 371 g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(pref_dialog_response_cb), plug); |
11740 | 372 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), box); |
11747
b8bf638cc4aa
[gaim-migrate @ 14038]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11744
diff
changeset
|
373 gtk_window_set_role(GTK_WINDOW(dialog), "plugin_config"); |
12290 | 374 gtk_window_set_title(GTK_WINDOW(dialog), _(gaim_plugin_get_name(plug))); |
11740 | 375 gtk_widget_show_all(dialog); |
11770 | 376 g_value_unset(&val); |
11740 | 377 break; |
378 } | |
379 } | |
380 | |
12162
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
381 static void |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
382 show_plugin_prefs_cb(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer null) |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
383 { |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
384 GtkTreeSelection *sel; |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
385 GtkTreeIter iter; |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
386 GaimPlugin *plugin; |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
387 GtkTreeModel *model; |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
388 |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
389 sel = gtk_tree_view_get_selection(view); |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
390 |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
391 if (!gtk_tree_selection_get_selected(sel, &model, &iter)) |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
392 return; |
12246 | 393 |
12162
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
394 gtk_tree_model_get(model, &iter, 2, &plugin, -1); |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
395 |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
396 if (!gaim_plugin_is_loaded(plugin)) |
12174
c7652a910308
[gaim-migrate @ 14476]
Richard Laager <rlaager@wiktel.com>
parents:
12162
diff
changeset
|
397 return; |
c7652a910308
[gaim-migrate @ 14476]
Richard Laager <rlaager@wiktel.com>
parents:
12162
diff
changeset
|
398 |
12162
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
399 /* Now show the pref-dialog for the plugin */ |
12246 | 400 plugin_dialog_response_cb(NULL, GAIM_RESPONSE_CONFIGURE, sel); |
12162
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
401 } |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
402 |
11740 | 403 void gaim_gtk_plugin_dialog_show() |
404 { | |
11741 | 405 GtkWidget *sw; |
11740 | 406 GtkWidget *event_view; |
407 GtkListStore *ls; | |
408 GtkCellRenderer *rend, *rendt; | |
409 GtkTreeViewColumn *col; | |
410 GtkTreeSelection *sel; | |
411 | |
412 if (plugin_dialog != NULL) { | |
413 gtk_window_present(GTK_WINDOW(plugin_dialog)); | |
414 return; | |
415 } | |
416 | |
417 plugin_dialog = gtk_dialog_new_with_buttons(_("Plugins"), | |
418 NULL, | |
419 GTK_DIALOG_NO_SEPARATOR, | |
420 NULL); | |
12246 | 421 pref_button = gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), |
12276
b3652193d359
[gaim-migrate @ 14580]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12246
diff
changeset
|
422 _("Configure Pl_ugin"), GAIM_RESPONSE_CONFIGURE); |
12246 | 423 gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), |
424 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); | |
11813
1f7f4f850db5
[gaim-migrate @ 14104]
Gary Kramlich <grim@reaperworld.com>
parents:
11794
diff
changeset
|
425 gtk_widget_set_sensitive(pref_button, FALSE); |
11747
b8bf638cc4aa
[gaim-migrate @ 14038]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11744
diff
changeset
|
426 gtk_window_set_role(GTK_WINDOW(plugin_dialog), "plugins"); |
11740 | 427 |
428 sw = gtk_scrolled_window_new(NULL,NULL); | |
429 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); | |
430 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
431 | |
432 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(plugin_dialog)->vbox), sw, TRUE, TRUE, 0); | |
433 | |
12695
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
434 ls = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN); |
11740 | 435 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), |
436 1, GTK_SORT_ASCENDING); | |
437 | |
438 update_plugin_list(ls); | |
11813
1f7f4f850db5
[gaim-migrate @ 14104]
Gary Kramlich <grim@reaperworld.com>
parents:
11794
diff
changeset
|
439 |
11740 | 440 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); |
441 | |
12162
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
442 g_signal_connect(G_OBJECT(event_view), "row-activated", |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
443 G_CALLBACK(show_plugin_prefs_cb), event_view); |
5e24b8e49522
[gaim-migrate @ 14463]
Richard Laager <rlaager@wiktel.com>
parents:
12066
diff
changeset
|
444 |
11740 | 445 rend = gtk_cell_renderer_toggle_new(); |
446 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
447 | |
448 col = gtk_tree_view_column_new_with_attributes (_("Enabled"), | |
449 rend, | |
450 "active", 0, | |
451 NULL); | |
452 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
|
453 gtk_tree_view_column_set_sort_column_id(col, 0); |
11740 | 454 g_signal_connect (G_OBJECT(rend), "toggled", |
455 G_CALLBACK(plugin_load), ls); | |
12246 | 456 |
11740 | 457 rendt = gtk_cell_renderer_text_new(); |
12695
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
458 g_object_set(rendt, |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
459 "foreground", "#c0c0c0", |
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
460 NULL); |
11740 | 461 col = gtk_tree_view_column_new_with_attributes (_("Name"), |
462 rendt, | |
463 "markup", 1, | |
12695
0bc110c7ab91
[gaim-migrate @ 15038]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
464 "foreground-set", 3, |
11740 | 465 NULL); |
466 #if GTK_CHECK_VERSION(2,6,0) | |
467 gtk_tree_view_column_set_expand (col, TRUE); | |
468 g_object_set(rendt, "ellipsize", PANGO_ELLIPSIZE_END, NULL); | |
469 #endif | |
470 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
|
471 gtk_tree_view_column_set_sort_column_id(col, 1); |
11740 | 472 g_object_unref(G_OBJECT(ls)); |
473 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
12246 | 474 |
11740 | 475 expander = gtk_expander_new(_("<b>Plugin Details</b>")); |
476 gtk_expander_set_use_markup(GTK_EXPANDER(expander), TRUE); | |
477 plugin_details = gtk_label_new(NULL); | |
478 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); | |
479 gtk_container_add(GTK_CONTAINER(expander), plugin_details); | |
12343 | 480 gtk_widget_set_sensitive(expander, FALSE); |
11740 | 481 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(plugin_dialog)->vbox), expander, FALSE, FALSE, 0); |
482 | |
483 g_signal_connect (G_OBJECT (sel), "changed", G_CALLBACK (prefs_plugin_sel), NULL); | |
484 g_signal_connect(G_OBJECT(plugin_dialog), "response", G_CALLBACK(plugin_dialog_response_cb), sel); | |
485 gtk_window_set_default_size(GTK_WINDOW(plugin_dialog), 430, 430); | |
486 gtk_widget_show_all(plugin_dialog); | |
487 } |