Mon, 08 Jun 2009 02:24:49 +0000
Use the JID for adding a chat/buddy because the name is for descriptive
purpose only, and using it will not fill in the Add Chat dialog correctly.
Because the JID is not visible, the user will not know what to actually put
there instead.
| 5205 | 1 | /** |
|
6927
528988ef2781
[gaim-migrate @ 7474]
Christian Hammond <chipx86@chipx86.com>
parents:
5982
diff
changeset
|
2 | * @file gtkplugin.c GTK+ Plugins support |
|
16254
eeb2bba4dc94
Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@pidgin.im>
parents:
16123
diff
changeset
|
3 | * @ingroup pidgin |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* pidgin |
| 5205 | 7 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
8 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
|
6927
528988ef2781
[gaim-migrate @ 7474]
Christian Hammond <chipx86@chipx86.com>
parents:
5982
diff
changeset
|
11 | * |
| 5205 | 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19733
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5205 | 25 | */ |
| 11740 | 26 | #include "internal.h" |
| 15577 | 27 | #include "pidgin.h" |
| 5205 | 28 | #include "gtkplugin.h" |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
29 | #include "gtkpluginpref.h" |
|
13436
b80f8990bc67
[gaim-migrate @ 15810]
Richard Laager <rlaager@pidgin.im>
parents:
13435
diff
changeset
|
30 | #include "gtkutils.h" |
|
5981
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
31 | #include "debug.h" |
|
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
32 | #include "prefs.h" |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
33 | #include "request.h" |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
34 | #include "pidgintooltip.h" |
|
5981
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
35 | |
| 5205 | 36 | #include <string.h> |
| 37 | ||
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
38 | #define PIDGIN_RESPONSE_CONFIGURE 98121 |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
39 | |
| 15884 | 40 | static void plugin_toggled_stage_two(PurplePlugin *plug, GtkTreeModel *model, |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
41 | GtkTreeIter *iter, gboolean unload); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
42 | |
|
12343
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
43 | static GtkWidget *expander = NULL; |
| 11740 | 44 | static GtkWidget *plugin_dialog = NULL; |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
45 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
46 | static GtkLabel *plugin_name = NULL; |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
47 | static GtkTextBuffer *plugin_desc = NULL; |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
48 | static GtkLabel *plugin_error = NULL; |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
49 | static GtkLabel *plugin_author = NULL; |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
50 | static GtkLabel *plugin_website = NULL; |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
51 | static gchar *plugin_website_uri = NULL; |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
52 | static GtkLabel *plugin_filename = NULL; |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
53 | |
| 11740 | 54 | static GtkWidget *pref_button = NULL; |
| 11781 | 55 | static GHashTable *plugin_pref_dialogs = NULL; |
| 11747 | 56 | |
| 5205 | 57 | GtkWidget * |
| 15884 | 58 | pidgin_plugin_get_config_frame(PurplePlugin *plugin) |
| 5205 | 59 | { |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
60 | GtkWidget *config = NULL; |
| 5205 | 61 | |
| 62 | g_return_val_if_fail(plugin != NULL, NULL); | |
| 63 | ||
|
15692
ecda27df58b9
Some more pidgininfication
Daniel Atallah <datallah@pidgin.im>
parents:
15577
diff
changeset
|
64 | if (PIDGIN_IS_PIDGIN_PLUGIN(plugin) && plugin->info->ui_info |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
65 | && PIDGIN_PLUGIN_UI_INFO(plugin)->get_config_frame) |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
66 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
67 | PidginPluginUiInfo *ui_info; |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
68 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
69 | ui_info = PIDGIN_PLUGIN_UI_INFO(plugin); |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
70 | |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
71 | config = ui_info->get_config_frame(plugin); |
| 5205 | 72 | |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
73 | if (plugin->info->prefs_info |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
74 | && plugin->info->prefs_info->get_plugin_pref_frame) |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
75 | { |
| 15884 | 76 | purple_debug_warning("gtkplugin", |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
77 | "Plugin %s contains both, ui_info and " |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
78 | "prefs_info preferences; prefs_info will be " |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
79 | "ignored.", plugin->info->name); |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
80 | } |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
81 | } |
| 5205 | 82 | |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
83 | if (config == NULL && plugin->info->prefs_info |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
84 | && plugin->info->prefs_info->get_plugin_pref_frame) |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
85 | { |
| 15884 | 86 | PurplePluginPrefFrame *frame; |
| 5205 | 87 | |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
88 | frame = plugin->info->prefs_info->get_plugin_pref_frame(plugin); |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
89 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
90 | config = pidgin_plugin_pref_create_frame(frame); |
| 12870 | 91 | |
|
22608
252962fae8b4
Leak fix from SF bug #1407047 which actually had a patch attached (on 2006-01-17 !)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22533
diff
changeset
|
92 | plugin->info->prefs_info->frame = frame; |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
93 | } |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
94 | |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
95 | return config; |
| 5205 | 96 | } |
|
5981
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
97 | |
|
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
98 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
99 | pidgin_plugins_save(void) |
|
5981
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
100 | { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
101 | purple_plugins_save_loaded(PIDGIN_PREFS_ROOT "/plugins/loaded"); |
|
5981
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
102 | } |
| 11740 | 103 | |
| 104 | static void | |
| 105 | update_plugin_list(void *data) | |
| 106 | { | |
| 107 | GtkListStore *ls = GTK_LIST_STORE(data); | |
| 108 | GtkTreeIter iter; | |
| 109 | GList *probes; | |
| 15884 | 110 | PurplePlugin *plug; |
| 11740 | 111 | |
| 112 | gtk_list_store_clear(ls); | |
| 15884 | 113 | purple_plugins_probe(G_MODULE_SUFFIX); |
| 11740 | 114 | |
| 15884 | 115 | for (probes = purple_plugins_get_all(); |
| 11740 | 116 | probes != NULL; |
| 117 | probes = probes->next) | |
| 118 | { | |
|
12702
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
119 | char *name; |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
120 | char *version; |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
121 | char *summary; |
| 11740 | 122 | char *desc; |
| 123 | plug = probes->data; | |
| 124 | ||
| 15884 | 125 | if (plug->info->type == PURPLE_PLUGIN_LOADER) { |
|
15336
a2454071e986
[gaim-migrate @ 18064]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15177
diff
changeset
|
126 | GList *cur; |
| 15884 | 127 | for (cur = PURPLE_PLUGIN_LOADER_INFO(plug)->exts; cur != NULL; |
|
15336
a2454071e986
[gaim-migrate @ 18064]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15177
diff
changeset
|
128 | cur = cur->next) |
| 15884 | 129 | purple_plugins_probe(cur->data); |
|
15336
a2454071e986
[gaim-migrate @ 18064]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15177
diff
changeset
|
130 | continue; |
| 15884 | 131 | } else if (plug->info->type != PURPLE_PLUGIN_STANDARD || |
| 132 | (plug->info->flags & PURPLE_PLUGIN_FLAG_INVISIBLE)) { | |
| 11740 | 133 | continue; |
| 134 | } | |
| 135 | ||
| 136 | gtk_list_store_append (ls, &iter); | |
|
12702
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
137 | |
|
26756
874b154f4220
More Pidgin updates for GTK+ 3.0. Removes any deprecated functions for GLib
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23180
diff
changeset
|
138 | if (plug->info->name) { |
|
874b154f4220
More Pidgin updates for GTK+ 3.0. Removes any deprecated functions for GLib
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23180
diff
changeset
|
139 | name = g_markup_escape_text(_(plug->info->name), -1); |
|
874b154f4220
More Pidgin updates for GTK+ 3.0. Removes any deprecated functions for GLib
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23180
diff
changeset
|
140 | } else { |
|
874b154f4220
More Pidgin updates for GTK+ 3.0. Removes any deprecated functions for GLib
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23180
diff
changeset
|
141 | char *tmp = g_path_get_basename(plug->path); |
|
874b154f4220
More Pidgin updates for GTK+ 3.0. Removes any deprecated functions for GLib
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23180
diff
changeset
|
142 | name = g_markup_escape_text(tmp, -1); |
|
874b154f4220
More Pidgin updates for GTK+ 3.0. Removes any deprecated functions for GLib
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23180
diff
changeset
|
143 | g_free(tmp); |
|
874b154f4220
More Pidgin updates for GTK+ 3.0. Removes any deprecated functions for GLib
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23180
diff
changeset
|
144 | } |
|
23100
013db96dd9a7
Translate the description of the plugin in the plugins dialog. Thanks to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22788
diff
changeset
|
145 | version = g_markup_escape_text(purple_plugin_get_version(plug), -1); |
|
013db96dd9a7
Translate the description of the plugin in the plugins dialog. Thanks to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22788
diff
changeset
|
146 | summary = g_markup_escape_text(purple_plugin_get_summary(plug), -1); |
|
12702
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
147 | |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
148 | desc = g_strdup_printf("<b>%s</b> %s\n%s", name, |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
149 | version, |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
150 | summary); |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
151 | g_free(name); |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
152 | g_free(version); |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
153 | g_free(summary); |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
154 | |
| 11740 | 155 | gtk_list_store_set(ls, &iter, |
| 15884 | 156 | 0, purple_plugin_is_loaded(plug), |
| 11740 | 157 | 1, desc, |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
158 | 2, plug, |
| 15884 | 159 | 3, purple_plugin_is_unloadable(plug), |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
160 | -1); |
| 11740 | 161 | g_free(desc); |
| 162 | } | |
| 163 | } | |
| 164 | ||
| 15884 | 165 | static void plugin_loading_common(PurplePlugin *plugin, GtkTreeView *view, gboolean loaded) |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
166 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
167 | GtkTreeIter iter; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
168 | GtkTreeModel *model = gtk_tree_view_get_model(view); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
169 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
170 | if (gtk_tree_model_get_iter_first(model, &iter)) { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
171 | do { |
| 15884 | 172 | PurplePlugin *plug; |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
173 | GtkTreeSelection *sel; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
174 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
175 | gtk_tree_model_get(model, &iter, 2, &plug, -1); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
176 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
177 | if (plug != plugin) |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
178 | continue; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
179 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
180 | gtk_list_store_set(GTK_LIST_STORE(model), &iter, 0, loaded, -1); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
181 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
182 | /* If the loaded/unloaded plugin is the selected row, |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
183 | * update the pref_button. */ |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
184 | sel = gtk_tree_view_get_selection(view); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
185 | if (gtk_tree_selection_get_selected(sel, &model, &iter)) |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
186 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
187 | gtk_tree_model_get(model, &iter, 2, &plug, -1); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
188 | if (plug == plugin) |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
189 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
190 | gtk_widget_set_sensitive(pref_button, |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
191 | loaded |
|
15692
ecda27df58b9
Some more pidgininfication
Daniel Atallah <datallah@pidgin.im>
parents:
15577
diff
changeset
|
192 | && ((PIDGIN_IS_PIDGIN_PLUGIN(plug) && plug->info->ui_info |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
193 | && PIDGIN_PLUGIN_UI_INFO(plug)->get_config_frame) |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
194 | || (plug->info->prefs_info |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
195 | && plug->info->prefs_info->get_plugin_pref_frame))); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
196 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
197 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
198 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
199 | break; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
200 | } while (gtk_tree_model_iter_next(model, &iter)); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
201 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
202 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
203 | |
| 15884 | 204 | static void plugin_load_cb(PurplePlugin *plugin, gpointer data) |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
205 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
206 | GtkTreeView *view = (GtkTreeView *)data; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
207 | plugin_loading_common(plugin, view, TRUE); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
208 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
209 | |
| 15884 | 210 | static void plugin_unload_cb(PurplePlugin *plugin, gpointer data) |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
211 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
212 | GtkTreeView *view = (GtkTreeView *)data; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
213 | plugin_loading_common(plugin, view, FALSE); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
214 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
215 | |
| 15884 | 216 | static void pref_dialog_response_cb(GtkWidget *d, int response, PurplePlugin *plug) |
| 11781 | 217 | { |
| 218 | switch (response) { | |
| 219 | case GTK_RESPONSE_CLOSE: | |
| 220 | case GTK_RESPONSE_DELETE_EVENT: | |
| 221 | g_hash_table_remove(plugin_pref_dialogs, plug); | |
| 222 | if (g_hash_table_size(plugin_pref_dialogs) == 0) { | |
| 223 | g_hash_table_destroy(plugin_pref_dialogs); | |
| 224 | plugin_pref_dialogs = NULL; | |
| 225 | } | |
| 226 | gtk_widget_destroy(d); | |
|
22608
252962fae8b4
Leak fix from SF bug #1407047 which actually had a patch attached (on 2006-01-17 !)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22533
diff
changeset
|
227 | |
|
252962fae8b4
Leak fix from SF bug #1407047 which actually had a patch attached (on 2006-01-17 !)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22533
diff
changeset
|
228 | if (plug->info->prefs_info && plug->info->prefs_info->frame) { |
|
252962fae8b4
Leak fix from SF bug #1407047 which actually had a patch attached (on 2006-01-17 !)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22533
diff
changeset
|
229 | purple_plugin_pref_frame_destroy(plug->info->prefs_info->frame); |
|
252962fae8b4
Leak fix from SF bug #1407047 which actually had a patch attached (on 2006-01-17 !)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22533
diff
changeset
|
230 | plug->info->prefs_info->frame = NULL; |
|
252962fae8b4
Leak fix from SF bug #1407047 which actually had a patch attached (on 2006-01-17 !)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22533
diff
changeset
|
231 | } |
|
252962fae8b4
Leak fix from SF bug #1407047 which actually had a patch attached (on 2006-01-17 !)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22533
diff
changeset
|
232 | |
| 11781 | 233 | break; |
| 234 | } | |
| 235 | } | |
| 236 | ||
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
237 | static void plugin_unload_confirm_cb(gpointer *data) |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
238 | { |
| 15884 | 239 | PurplePlugin *plugin = (PurplePlugin *)data[0]; |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
240 | GtkTreeModel *model = (GtkTreeModel *)data[1]; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
241 | GtkTreeIter *iter = (GtkTreeIter *)data[2]; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
242 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
243 | plugin_toggled_stage_two(plugin, model, iter, TRUE); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
244 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
245 | g_free(data); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
246 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
247 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
248 | static void plugin_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
| 11740 | 249 | { |
| 250 | GtkTreeModel *model = (GtkTreeModel *)data; | |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
251 | GtkTreeIter *iter = g_new(GtkTreeIter, 1); |
| 11740 | 252 | GtkTreePath *path = gtk_tree_path_new_from_string(pth); |
| 15884 | 253 | PurplePlugin *plug; |
| 11781 | 254 | GtkWidget *dialog = NULL; |
| 11740 | 255 | |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
256 | gtk_tree_model_get_iter(model, iter, path); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
257 | gtk_tree_path_free(path); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
258 | gtk_tree_model_get(model, iter, 2, &plug, -1); |
| 11740 | 259 | |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
260 | /* Apparently, GTK+ won't honor the sensitive flag on cell renderers for booleans. */ |
| 15884 | 261 | if (purple_plugin_is_unloadable(plug)) |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
262 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
263 | g_free(iter); |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
264 | return; |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
265 | } |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
266 | |
| 15884 | 267 | if (!purple_plugin_is_loaded(plug)) |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
268 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
269 | pidgin_set_cursor(plugin_dialog, GDK_WATCH); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
270 | |
| 15884 | 271 | purple_plugin_load(plug); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
272 | plugin_toggled_stage_two(plug, model, iter, FALSE); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
273 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
274 | pidgin_clear_cursor(plugin_dialog); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
275 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
276 | else |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
277 | { |
| 11781 | 278 | if (plugin_pref_dialogs != NULL && |
| 279 | (dialog = g_hash_table_lookup(plugin_pref_dialogs, plug))) | |
| 280 | pref_dialog_response_cb(dialog, GTK_RESPONSE_DELETE_EVENT, plug); | |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
281 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
282 | if (plug->dependent_plugins != NULL) |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
283 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
284 | GString *tmp = g_string_new(_("The following plugins will be unloaded.")); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
285 | GList *l; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
286 | gpointer *cb_data; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
287 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
288 | for (l = plug->dependent_plugins ; l != NULL ; l = l->next) |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
289 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
290 | const char *dep_name = (const char *)l->data; |
| 15884 | 291 | PurplePlugin *dep_plugin = purple_plugins_find_with_id(dep_name); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
292 | g_return_if_fail(dep_plugin != NULL); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
293 | |
|
23100
013db96dd9a7
Translate the description of the plugin in the plugins dialog. Thanks to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22788
diff
changeset
|
294 | g_string_append_printf(tmp, "\n\t%s\n", purple_plugin_get_name(dep_plugin)); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
295 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
296 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
297 | cb_data = g_new(gpointer, 3); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
298 | cb_data[0] = plug; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
299 | cb_data[1] = model; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
300 | cb_data[2] = iter; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
301 | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
302 | purple_request_action(plugin_dialog, NULL, |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
303 | _("Multiple plugins will be unloaded."), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16254
diff
changeset
|
304 | tmp->str, 0, |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
305 | NULL, NULL, NULL, |
|
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
306 | cb_data, 2, |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
307 | _("Unload Plugins"), G_CALLBACK(plugin_unload_confirm_cb), |
|
13378
973e8b2b2c88
[gaim-migrate @ 15750]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12927
diff
changeset
|
308 | _("Cancel"), g_free); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
309 | g_string_free(tmp, TRUE); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
310 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
311 | else |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
312 | plugin_toggled_stage_two(plug, model, iter, TRUE); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
313 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
314 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
315 | |
| 15884 | 316 | static void plugin_toggled_stage_two(PurplePlugin *plug, GtkTreeModel *model, GtkTreeIter *iter, gboolean unload) |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
317 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
318 | if (unload) |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
319 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
320 | pidgin_set_cursor(plugin_dialog, GDK_WATCH); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
321 | |
|
20872
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
322 | if (!purple_plugin_unload(plug)) |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
323 | { |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
324 | const char *primary = _("Could not unload plugin"); |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
325 | const char *reload = _("The plugin could not be unloaded now, but will be disabled at the next startup."); |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
326 | |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
327 | if (!plug->error) |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
328 | { |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
329 | purple_notify_warning(NULL, NULL, primary, reload); |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
330 | } |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
331 | else |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
332 | { |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
333 | char *tmp = g_strdup_printf("%s\n\n%s", reload, plug->error); |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
334 | purple_notify_warning(NULL, NULL, primary, tmp); |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
335 | g_free(tmp); |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
336 | } |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
337 | |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
338 | purple_plugin_disable(plug); |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
339 | } |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
340 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
341 | pidgin_clear_cursor(plugin_dialog); |
| 11781 | 342 | } |
| 11740 | 343 | |
| 11781 | 344 | gtk_widget_set_sensitive(pref_button, |
| 15884 | 345 | purple_plugin_is_loaded(plug) |
|
15692
ecda27df58b9
Some more pidgininfication
Daniel Atallah <datallah@pidgin.im>
parents:
15577
diff
changeset
|
346 | && ((PIDGIN_IS_PIDGIN_PLUGIN(plug) && plug->info->ui_info |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
347 | && PIDGIN_PLUGIN_UI_INFO(plug)->get_config_frame) |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
348 | || (plug->info->prefs_info |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
349 | && plug->info->prefs_info->get_plugin_pref_frame))); |
| 11740 | 350 | |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
351 | if (plug->error != NULL) |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
352 | { |
|
23100
013db96dd9a7
Translate the description of the plugin in the plugins dialog. Thanks to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22788
diff
changeset
|
353 | gchar *name = g_markup_escape_text(purple_plugin_get_name(plug), -1); |
| 11781 | 354 | |
| 11740 | 355 | gchar *error = g_markup_escape_text(plug->error, -1); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
356 | gchar *text; |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
357 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
358 | text = g_strdup_printf( |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
359 | "<b>%s</b> %s\n<span weight=\"bold\" color=\"red\"%s</span>", |
|
23100
013db96dd9a7
Translate the description of the plugin in the plugins dialog. Thanks to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22788
diff
changeset
|
360 | purple_plugin_get_name(plug), purple_plugin_get_version(plug), error); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
361 | gtk_list_store_set(GTK_LIST_STORE (model), iter, |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
362 | 1, text, |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
363 | -1); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
364 | g_free(text); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
365 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
366 | text = g_strdup_printf( |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
367 | "<span weight=\"bold\" color=\"red\">%s</span>", |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
368 | error); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
369 | gtk_label_set_markup(plugin_error, text); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
370 | g_free(text); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
371 | |
| 11740 | 372 | g_free(error); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
373 | g_free(name); |
| 11740 | 374 | } |
| 375 | ||
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
376 | gtk_list_store_set(GTK_LIST_STORE (model), iter, |
| 15884 | 377 | 0, purple_plugin_is_loaded(plug), |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
378 | -1); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
379 | g_free(iter); |
| 11740 | 380 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
381 | pidgin_plugins_save(); |
| 11740 | 382 | } |
| 383 | ||
| 11877 | 384 | static gboolean ensure_plugin_visible(void *data) |
| 385 | { | |
| 386 | GtkTreeSelection *sel = GTK_TREE_SELECTION(data); | |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
387 | GtkTreeView *tv = gtk_tree_selection_get_tree_view(sel); |
| 11877 | 388 | GtkTreeModel *model = gtk_tree_view_get_model(tv); |
| 389 | GtkTreePath *path; | |
| 390 | GtkTreeIter iter; | |
| 391 | if (!gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 392 | return FALSE; | |
| 393 | path = gtk_tree_model_get_path(model, &iter); | |
| 394 | gtk_tree_view_scroll_to_cell(gtk_tree_selection_get_tree_view(sel), path, NULL, FALSE, 0, 0); | |
| 395 | gtk_tree_path_free(path); | |
| 396 | return FALSE; | |
| 397 | } | |
| 398 | ||
| 11740 | 399 | static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) |
| 400 | { | |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
401 | gchar *buf, *tmp, *name, *version; |
| 11740 | 402 | GtkTreeIter iter; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12343
diff
changeset
|
403 | GValue val; |
| 15884 | 404 | PurplePlugin *plug; |
| 11740 | 405 | |
|
11833
119ea75db24b
[gaim-migrate @ 14124]
Mark Doliner <markdoliner@pidgin.im>
parents:
11817
diff
changeset
|
406 | if (!gtk_tree_selection_get_selected (sel, &model, &iter)) |
|
119ea75db24b
[gaim-migrate @ 14124]
Mark Doliner <markdoliner@pidgin.im>
parents:
11817
diff
changeset
|
407 | { |
|
119ea75db24b
[gaim-migrate @ 14124]
Mark Doliner <markdoliner@pidgin.im>
parents:
11817
diff
changeset
|
408 | gtk_widget_set_sensitive(pref_button, FALSE); |
|
12343
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
409 | |
|
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
410 | /* Collapse and disable the expander widget */ |
|
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
411 | gtk_expander_set_expanded(GTK_EXPANDER(expander), FALSE); |
|
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
412 | gtk_widget_set_sensitive(expander, FALSE); |
|
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
413 | |
| 11740 | 414 | return; |
|
11833
119ea75db24b
[gaim-migrate @ 14124]
Mark Doliner <markdoliner@pidgin.im>
parents:
11817
diff
changeset
|
415 | } |
|
119ea75db24b
[gaim-migrate @ 14124]
Mark Doliner <markdoliner@pidgin.im>
parents:
11817
diff
changeset
|
416 | |
|
12343
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
417 | gtk_widget_set_sensitive(expander, TRUE); |
|
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
418 | |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12343
diff
changeset
|
419 | val.g_type = 0; |
| 11740 | 420 | gtk_tree_model_get_value (model, &iter, 2, &val); |
| 421 | plug = g_value_get_pointer(&val); | |
| 422 | ||
|
23100
013db96dd9a7
Translate the description of the plugin in the plugins dialog. Thanks to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22788
diff
changeset
|
423 | name = g_markup_escape_text(purple_plugin_get_name(plug), -1); |
|
013db96dd9a7
Translate the description of the plugin in the plugins dialog. Thanks to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22788
diff
changeset
|
424 | version = g_markup_escape_text(purple_plugin_get_version(plug), -1); |
| 11740 | 425 | buf = g_strdup_printf( |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
426 | "<span size=\"larger\" weight=\"bold\">%s</span> " |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
427 | "<span size=\"smaller\">%s</span>", |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
428 | name, version); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
429 | gtk_label_set_markup(plugin_name, buf); |
|
23180
5d6a0a35837f
applied changes from 97a20dd56598fa5c690eabcbc8ec3ff6e560aefd
Daniel Atallah <datallah@pidgin.im>
parents:
23100
diff
changeset
|
430 | g_free(name); |
|
5d6a0a35837f
applied changes from 97a20dd56598fa5c690eabcbc8ec3ff6e560aefd
Daniel Atallah <datallah@pidgin.im>
parents:
23100
diff
changeset
|
431 | g_free(version); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
432 | g_free(buf); |
| 11740 | 433 | |
|
23100
013db96dd9a7
Translate the description of the plugin in the plugins dialog. Thanks to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22788
diff
changeset
|
434 | gtk_text_buffer_set_text(plugin_desc, purple_plugin_get_description(plug), -1); |
|
013db96dd9a7
Translate the description of the plugin in the plugins dialog. Thanks to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22788
diff
changeset
|
435 | gtk_label_set_text(plugin_author, purple_plugin_get_author(plug)); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
436 | gtk_label_set_text(plugin_filename, plug->path); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
437 | |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
438 | g_free(plugin_website_uri); |
|
23100
013db96dd9a7
Translate the description of the plugin in the plugins dialog. Thanks to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22788
diff
changeset
|
439 | plugin_website_uri = g_strdup(purple_plugin_get_homepage(plug)); |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
440 | if (plugin_website_uri) |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
441 | { |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
442 | tmp = g_markup_escape_text(plugin_website_uri, -1); |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
443 | buf = g_strdup_printf("<span underline=\"single\" " |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
444 | "foreground=\"blue\">%s</span>", tmp); |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
445 | gtk_label_set_markup(plugin_website, buf); |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
446 | g_free(tmp); |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
447 | g_free(buf); |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
448 | } |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
449 | else |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
450 | { |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
451 | gtk_label_set_text(plugin_website, NULL); |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
452 | } |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
453 | |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
454 | if (plug->error == NULL) |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
455 | { |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
456 | gtk_label_set_text(plugin_error, NULL); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
457 | } |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
458 | else |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
459 | { |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
460 | tmp = g_markup_escape_text(plug->error, -1); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
461 | buf = g_strdup_printf( |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
462 | _("<span foreground=\"red\" weight=\"bold\">" |
|
12705
7780ec726bdb
[gaim-migrate @ 15048]
Richard Laager <rlaager@pidgin.im>
parents:
12702
diff
changeset
|
463 | "Error: %s\n" |
|
7780ec726bdb
[gaim-migrate @ 15048]
Richard Laager <rlaager@pidgin.im>
parents:
12702
diff
changeset
|
464 | "Check the plugin website for an update." |
|
7780ec726bdb
[gaim-migrate @ 15048]
Richard Laager <rlaager@pidgin.im>
parents:
12702
diff
changeset
|
465 | "</span>"), |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
466 | tmp); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
467 | gtk_label_set_markup(plugin_error, buf); |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
468 | g_free(buf); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
469 | g_free(tmp); |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
470 | } |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
471 | |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
472 | gtk_widget_set_sensitive(pref_button, |
| 15884 | 473 | purple_plugin_is_loaded(plug) |
|
15692
ecda27df58b9
Some more pidgininfication
Daniel Atallah <datallah@pidgin.im>
parents:
15577
diff
changeset
|
474 | && ((PIDGIN_IS_PIDGIN_PLUGIN(plug) && plug->info->ui_info |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
475 | && PIDGIN_PLUGIN_UI_INFO(plug)->get_config_frame) |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
476 | || (plug->info->prefs_info |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
477 | && plug->info->prefs_info->get_plugin_pref_frame))); |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
478 | |
| 11877 | 479 | /* Make sure the selected plugin is still visible */ |
| 480 | g_idle_add(ensure_plugin_visible, sel); | |
| 481 | ||
| 11740 | 482 | g_value_unset(&val); |
| 483 | } | |
| 484 | ||
| 11741 | 485 | static void plugin_dialog_response_cb(GtkWidget *d, int response, GtkTreeSelection *sel) |
| 11740 | 486 | { |
| 15884 | 487 | PurplePlugin *plug; |
| 11740 | 488 | GtkWidget *dialog, *box; |
| 489 | GtkTreeModel *model; | |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12343
diff
changeset
|
490 | GValue val; |
| 11740 | 491 | GtkTreeIter iter; |
| 492 | ||
| 493 | switch (response) { | |
| 494 | case GTK_RESPONSE_CLOSE: | |
| 495 | case GTK_RESPONSE_DELETE_EVENT: | |
| 15884 | 496 | purple_request_close_with_handle(plugin_dialog); |
| 497 | purple_signals_disconnect_by_handle(plugin_dialog); | |
| 11740 | 498 | gtk_widget_destroy(d); |
|
11888
525706b75438
[gaim-migrate @ 14179]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11886
diff
changeset
|
499 | if (plugin_pref_dialogs != NULL) { |
|
525706b75438
[gaim-migrate @ 14179]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11886
diff
changeset
|
500 | g_hash_table_destroy(plugin_pref_dialogs); |
|
525706b75438
[gaim-migrate @ 14179]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11886
diff
changeset
|
501 | plugin_pref_dialogs = NULL; |
|
525706b75438
[gaim-migrate @ 14179]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11886
diff
changeset
|
502 | } |
| 11740 | 503 | plugin_dialog = NULL; |
| 504 | break; | |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
505 | case PIDGIN_RESPONSE_CONFIGURE: |
| 11740 | 506 | if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
| 507 | return; | |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12343
diff
changeset
|
508 | val.g_type = 0; |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12343
diff
changeset
|
509 | gtk_tree_model_get_value(model, &iter, 2, &val); |
| 11740 | 510 | plug = g_value_get_pointer(&val); |
| 511 | if (plug == NULL) | |
| 512 | break; | |
| 11781 | 513 | if (plugin_pref_dialogs != NULL && |
| 514 | g_hash_table_lookup(plugin_pref_dialogs, plug)) | |
| 11770 | 515 | break; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
516 | box = pidgin_plugin_get_config_frame(plug); |
| 11740 | 517 | if (box == NULL) |
| 518 | break; | |
| 519 | ||
| 15882 | 520 | dialog = gtk_dialog_new_with_buttons(PIDGIN_ALERT_TITLE, GTK_WINDOW(d), |
| 11744 | 521 | GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_DESTROY_WITH_PARENT, |
| 11740 | 522 | GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, |
| 523 | NULL); | |
| 11781 | 524 | if (plugin_pref_dialogs == NULL) |
| 525 | plugin_pref_dialogs = g_hash_table_new(NULL, NULL); | |
| 526 | ||
| 527 | g_hash_table_insert(plugin_pref_dialogs, plug, dialog); | |
| 528 | ||
| 11770 | 529 | g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(pref_dialog_response_cb), plug); |
| 11740 | 530 | gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), box); |
| 11747 | 531 | gtk_window_set_role(GTK_WINDOW(dialog), "plugin_config"); |
| 15884 | 532 | gtk_window_set_title(GTK_WINDOW(dialog), _(purple_plugin_get_name(plug))); |
| 11740 | 533 | gtk_widget_show_all(dialog); |
| 11770 | 534 | g_value_unset(&val); |
| 11740 | 535 | break; |
| 536 | } | |
| 537 | } | |
| 538 | ||
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
539 | static void |
|
13718
f29249a2856c
[gaim-migrate @ 16125]
Richard Laager <rlaager@pidgin.im>
parents:
13436
diff
changeset
|
540 | show_plugin_prefs_cb(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *column, GtkWidget *dialog) |
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
541 | { |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
542 | GtkTreeSelection *sel; |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
543 | GtkTreeIter iter; |
| 15884 | 544 | PurplePlugin *plugin; |
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
545 | GtkTreeModel *model; |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
546 | |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
547 | sel = gtk_tree_view_get_selection(view); |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
548 | |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
549 | if (!gtk_tree_selection_get_selected(sel, &model, &iter)) |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
550 | return; |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
551 | |
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
552 | gtk_tree_model_get(model, &iter, 2, &plugin, -1); |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
553 | |
| 15884 | 554 | if (!purple_plugin_is_loaded(plugin)) |
|
12174
3b0b53e84591
[gaim-migrate @ 14476]
Richard Laager <rlaager@pidgin.im>
parents:
12162
diff
changeset
|
555 | return; |
|
3b0b53e84591
[gaim-migrate @ 14476]
Richard Laager <rlaager@pidgin.im>
parents:
12162
diff
changeset
|
556 | |
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
557 | /* Now show the pref-dialog for the plugin */ |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
558 | plugin_dialog_response_cb(dialog, PIDGIN_RESPONSE_CONFIGURE, sel); |
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
559 | } |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
560 | |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
561 | static gboolean |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
562 | pidgin_plugins_paint_tooltip(GtkWidget *tipwindow, gpointer data) |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
563 | { |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
564 | PangoLayout *layout = g_object_get_data(G_OBJECT(tipwindow), "tooltip-plugin"); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
565 | gtk_paint_layout(tipwindow->style, tipwindow->window, GTK_STATE_NORMAL, FALSE, |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
566 | NULL, tipwindow, "tooltip", |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
567 | 6, 6, layout); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
568 | return TRUE; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
569 | } |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
570 | |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
571 | static gboolean |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
572 | pidgin_plugins_create_tooltip(GtkWidget *tipwindow, GtkTreePath *path, |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
573 | gpointer data, int *w, int *h) |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
574 | { |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
575 | GtkTreeIter iter; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
576 | GtkTreeView *treeview = GTK_TREE_VIEW(data); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
577 | PurplePlugin *plugin = NULL; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
578 | GtkTreeModel *model = gtk_tree_view_get_model(treeview); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
579 | PangoLayout *layout; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
580 | int width, height; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
581 | char *markup, *name, *desc, *author; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
582 | |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
583 | if (!gtk_tree_model_get_iter(model, &iter, path)) |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
584 | return FALSE; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
585 | |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
586 | gtk_tree_model_get(model, &iter, 2, &plugin, -1); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
587 | |
|
22533
7e1e39d5db7e
Allow translation/transliteration foo in the plugin window tooltip.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22065
diff
changeset
|
588 | markup = g_strdup_printf("<span size='x-large' weight='bold'>%s</span>\n<b>%s:</b> %s\n<b>%s:</b> %s", |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
589 | name = g_markup_escape_text(purple_plugin_get_name(plugin), -1), |
|
22533
7e1e39d5db7e
Allow translation/transliteration foo in the plugin window tooltip.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22065
diff
changeset
|
590 | _("Description"), desc = g_markup_escape_text(purple_plugin_get_description(plugin), -1), |
|
7e1e39d5db7e
Allow translation/transliteration foo in the plugin window tooltip.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22065
diff
changeset
|
591 | _("Author"), author = g_markup_escape_text(purple_plugin_get_author(plugin), -1)); |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
592 | |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
593 | layout = gtk_widget_create_pango_layout(tipwindow, NULL); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
594 | pango_layout_set_markup(layout, markup, -1); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
595 | pango_layout_set_wrap(layout, PANGO_WRAP_WORD); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
596 | pango_layout_set_width(layout, 600000); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
597 | pango_layout_get_size(layout, &width, &height); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
598 | g_object_set_data_full(G_OBJECT(tipwindow), "tooltip-plugin", layout, g_object_unref); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
599 | |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
600 | if (w) |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
601 | *w = PANGO_PIXELS(width) + 12; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
602 | if (h) |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
603 | *h = PANGO_PIXELS(height) + 12; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
604 | |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
605 | g_free(markup); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
606 | g_free(name); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
607 | g_free(desc); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
608 | g_free(author); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
609 | |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
610 | return TRUE; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
611 | } |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
612 | |
|
22788
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
613 | static gboolean |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
614 | website_button_motion_cb(GtkWidget *button, GdkEventCrossing *event, |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
615 | gpointer unused) |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
616 | { |
|
22788
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
617 | if (plugin_website_uri) { |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
618 | pidgin_set_cursor(button, GDK_HAND2); |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
619 | return TRUE; |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
620 | } |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
621 | return FALSE; |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
622 | } |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
623 | |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
624 | static gboolean |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
625 | website_button_clicked_cb(GtkButton *button, GdkEventButton *event, |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
626 | gpointer unused) |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
627 | { |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
628 | if (plugin_website_uri) { |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
629 | purple_notify_uri(NULL, plugin_website_uri); |
|
22788
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
630 | return TRUE; |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
631 | } |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
632 | return FALSE; |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
633 | } |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
634 | |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
635 | static GtkWidget * |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
636 | create_details() |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
637 | { |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
638 | GtkBox *vbox = GTK_BOX(gtk_vbox_new(FALSE, 3)); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
639 | GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
640 | GtkWidget *label, *view, *website_button; |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
641 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
642 | plugin_name = GTK_LABEL(gtk_label_new(NULL)); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
643 | gtk_misc_set_alignment(GTK_MISC(plugin_name), 0, 0); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
644 | gtk_label_set_line_wrap(plugin_name, FALSE); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
645 | gtk_label_set_selectable(plugin_name, TRUE); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
646 | gtk_box_pack_start(vbox, GTK_WIDGET(plugin_name), FALSE, FALSE, 0); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
647 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
648 | view = gtk_text_view_new(); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
649 | plugin_desc = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view)); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
650 | g_object_set(view, "wrap-mode", GTK_WRAP_WORD, |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
651 | "editable", FALSE, |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
652 | "left-margin", PIDGIN_HIG_CAT_SPACE, |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
653 | "right-margin", PIDGIN_HIG_CAT_SPACE, |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
654 | NULL); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
655 | gtk_box_pack_start(vbox, view, TRUE, TRUE, 0); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
656 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
657 | plugin_error = GTK_LABEL(gtk_label_new(NULL)); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
658 | gtk_misc_set_alignment(GTK_MISC(plugin_error), 0, 0); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
659 | gtk_label_set_line_wrap(plugin_error, FALSE); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
660 | gtk_label_set_selectable(plugin_error, TRUE); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
661 | gtk_box_pack_start(vbox, GTK_WIDGET(plugin_error), FALSE, FALSE, 0); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
662 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
663 | plugin_author = GTK_LABEL(gtk_label_new(NULL)); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
664 | gtk_label_set_line_wrap(plugin_author, FALSE); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
665 | gtk_misc_set_alignment(GTK_MISC(plugin_author), 0, 0); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
666 | gtk_label_set_selectable(plugin_author, TRUE); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
667 | pidgin_add_widget_to_vbox(vbox, "", sg, |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
668 | GTK_WIDGET(plugin_author), TRUE, &label); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
669 | gtk_label_set_markup(GTK_LABEL(label), _("<b>Written by:</b>")); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
670 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
671 | |
|
22788
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
672 | website_button = gtk_event_box_new(); |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
673 | #if GTK_CHECK_VERSION(2,4,0) |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
674 | gtk_event_box_set_visible_window(GTK_EVENT_BOX(website_button), FALSE); |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
675 | #endif |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
676 | |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
677 | plugin_website = GTK_LABEL(gtk_label_new(NULL)); |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
678 | #if GTK_CHECK_VERSION(2,6,0) |
|
22788
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
679 | g_object_set(G_OBJECT(plugin_website), |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
680 | "ellipsize", PANGO_ELLIPSIZE_MIDDLE, NULL); |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
681 | #endif |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
682 | gtk_misc_set_alignment(GTK_MISC(plugin_website), 0, 0); |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
683 | gtk_container_add(GTK_CONTAINER(website_button), |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
684 | GTK_WIDGET(plugin_website)); |
|
22788
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
685 | g_signal_connect(website_button, "button-release-event", |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
686 | G_CALLBACK(website_button_clicked_cb), NULL); |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
687 | g_signal_connect(website_button, "enter-notify-event", |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
688 | G_CALLBACK(website_button_motion_cb), NULL); |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
689 | g_signal_connect(website_button, "leave-notify-event", |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
690 | G_CALLBACK(pidgin_clear_cursor), NULL); |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
691 | |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
692 | pidgin_add_widget_to_vbox(vbox, "", sg, website_button, TRUE, &label); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
693 | gtk_label_set_markup(GTK_LABEL(label), _("<b>Web site:</b>")); |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
694 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
695 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
696 | plugin_filename = GTK_LABEL(gtk_label_new(NULL)); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
697 | gtk_label_set_line_wrap(plugin_filename, FALSE); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
698 | gtk_misc_set_alignment(GTK_MISC(plugin_filename), 0, 0); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
699 | gtk_label_set_selectable(plugin_filename, TRUE); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
700 | pidgin_add_widget_to_vbox(vbox, "", sg, |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
701 | GTK_WIDGET(plugin_filename), TRUE, &label); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
702 | gtk_label_set_markup(GTK_LABEL(label), _("<b>Filename:</b>")); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
703 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
704 | |
|
23180
5d6a0a35837f
applied changes from 97a20dd56598fa5c690eabcbc8ec3ff6e560aefd
Daniel Atallah <datallah@pidgin.im>
parents:
23100
diff
changeset
|
705 | g_object_unref(sg); |
|
5d6a0a35837f
applied changes from 97a20dd56598fa5c690eabcbc8ec3ff6e560aefd
Daniel Atallah <datallah@pidgin.im>
parents:
23100
diff
changeset
|
706 | |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
707 | return GTK_WIDGET(vbox); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
708 | } |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
709 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
710 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
711 | void pidgin_plugin_dialog_show() |
| 11740 | 712 | { |
| 11741 | 713 | GtkWidget *sw; |
| 11740 | 714 | GtkWidget *event_view; |
| 715 | GtkListStore *ls; | |
| 716 | GtkCellRenderer *rend, *rendt; | |
| 717 | GtkTreeViewColumn *col; | |
| 718 | GtkTreeSelection *sel; | |
| 719 | ||
| 720 | if (plugin_dialog != NULL) { | |
| 721 | gtk_window_present(GTK_WINDOW(plugin_dialog)); | |
| 722 | return; | |
| 723 | } | |
| 724 | ||
| 725 | plugin_dialog = gtk_dialog_new_with_buttons(_("Plugins"), | |
| 726 | NULL, | |
| 727 | GTK_DIALOG_NO_SEPARATOR, | |
| 728 | NULL); | |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
729 | pref_button = gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
730 | _("Configure Pl_ugin"), PIDGIN_RESPONSE_CONFIGURE); |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
731 | gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), |
|
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
732 | GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); |
| 11813 | 733 | gtk_widget_set_sensitive(pref_button, FALSE); |
| 11747 | 734 | gtk_window_set_role(GTK_WINDOW(plugin_dialog), "plugins"); |
| 11740 | 735 | |
| 736 | sw = gtk_scrolled_window_new(NULL,NULL); | |
| 13775 | 737 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); |
| 11740 | 738 | gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
| 739 | ||
| 740 | gtk_box_pack_start(GTK_BOX(GTK_DIALOG(plugin_dialog)->vbox), sw, TRUE, TRUE, 0); | |
| 741 | ||
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
742 | ls = gtk_list_store_new(4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN); |
| 11740 | 743 | gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), |
| 744 | 1, GTK_SORT_ASCENDING); | |
| 745 | ||
| 746 | update_plugin_list(ls); | |
| 11813 | 747 | |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
748 | event_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(ls)); |
| 11740 | 749 | |
| 14359 | 750 | gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(event_view), TRUE); |
| 751 | ||
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
752 | g_signal_connect(G_OBJECT(event_view), "row-activated", |
|
13718
f29249a2856c
[gaim-migrate @ 16125]
Richard Laager <rlaager@pidgin.im>
parents:
13436
diff
changeset
|
753 | G_CALLBACK(show_plugin_prefs_cb), plugin_dialog); |
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
754 | |
| 15884 | 755 | purple_signal_connect(purple_plugins_get_handle(), "plugin-load", plugin_dialog, |
| 756 | PURPLE_CALLBACK(plugin_load_cb), event_view); | |
| 757 | purple_signal_connect(purple_plugins_get_handle(), "plugin-unload", plugin_dialog, | |
| 758 | PURPLE_CALLBACK(plugin_unload_cb), event_view); | |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
759 | |
| 11740 | 760 | rend = gtk_cell_renderer_toggle_new(); |
| 761 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
| 762 | ||
| 763 | col = gtk_tree_view_column_new_with_attributes (_("Enabled"), | |
| 764 | rend, | |
| 765 | "active", 0, | |
| 766 | NULL); | |
| 767 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
|
11794
6c39942d27a9
[gaim-migrate @ 14085]
Gary Kramlich <grim@reaperworld.com>
parents:
11783
diff
changeset
|
768 | gtk_tree_view_column_set_sort_column_id(col, 0); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
769 | g_signal_connect(G_OBJECT(rend), "toggled", |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
770 | G_CALLBACK(plugin_toggled), ls); |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
771 | |
| 11740 | 772 | rendt = gtk_cell_renderer_text_new(); |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
773 | g_object_set(rendt, |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
774 | "foreground", "#c0c0c0", |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
775 | NULL); |
| 11740 | 776 | col = gtk_tree_view_column_new_with_attributes (_("Name"), |
| 777 | rendt, | |
| 778 | "markup", 1, | |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
779 | "foreground-set", 3, |
| 11740 | 780 | NULL); |
| 781 | #if GTK_CHECK_VERSION(2,6,0) | |
| 782 | gtk_tree_view_column_set_expand (col, TRUE); | |
| 783 | g_object_set(rendt, "ellipsize", PANGO_ELLIPSIZE_END, NULL); | |
| 784 | #endif | |
| 785 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
|
11794
6c39942d27a9
[gaim-migrate @ 14085]
Gary Kramlich <grim@reaperworld.com>
parents:
11783
diff
changeset
|
786 | gtk_tree_view_column_set_sort_column_id(col, 1); |
| 11740 | 787 | g_object_unref(G_OBJECT(ls)); |
| 788 | gtk_container_add(GTK_CONTAINER(sw), event_view); | |
|
15177
8b6c66e09388
[gaim-migrate @ 17901]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14359
diff
changeset
|
789 | gtk_tree_view_set_search_column(GTK_TREE_VIEW(event_view), 1); |
|
8b6c66e09388
[gaim-migrate @ 17901]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14359
diff
changeset
|
790 | gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(event_view), |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
791 | pidgin_tree_view_search_equal_func, NULL, NULL); |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
792 | |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
793 | pidgin_tooltip_setup_for_treeview(event_view, event_view, |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
794 | pidgin_plugins_create_tooltip, |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
795 | pidgin_plugins_paint_tooltip); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
796 | |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
797 | |
| 11740 | 798 | expander = gtk_expander_new(_("<b>Plugin Details</b>")); |
| 799 | gtk_expander_set_use_markup(GTK_EXPANDER(expander), TRUE); | |
|
12343
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
800 | gtk_widget_set_sensitive(expander, FALSE); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
801 | gtk_container_add(GTK_CONTAINER(expander), create_details()); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
802 | gtk_box_pack_start(GTK_BOX(GTK_DIALOG(plugin_dialog)->vbox), expander, |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
803 | FALSE, FALSE, 0); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
804 | |
| 11740 | 805 | |
| 806 | g_signal_connect (G_OBJECT (sel), "changed", G_CALLBACK (prefs_plugin_sel), NULL); | |
| 807 | g_signal_connect(G_OBJECT(plugin_dialog), "response", G_CALLBACK(plugin_dialog_response_cb), sel); | |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
808 | gtk_window_set_default_size(GTK_WINDOW(plugin_dialog), 430, 530); |
| 11740 | 809 | gtk_widget_show_all(plugin_dialog); |
| 810 | } |