annotate pidgin/gtkplugin.c @ 24860:d6c2d6c9fd2a

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