annotate pidgin/gtkplugin.c @ 22959:2555e069cd8c

Add the ability on win32 to choose at runtime whether we use the GIOChannel implementation from glib or the one in libpurple. I'm not sure if anyone else will use this, but I've used it for testing and here it is.
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 15 May 2008 19:53:05 +0000
parents 917bc972a141
children 4ead1ab25573
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);
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
424 g_free(buf);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
425
22939
917bc972a141 Translate the description of the plugin in the plugins dialog. Thanks to
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22628
diff changeset
426 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
427 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
428 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
429
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
430 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
431 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
432 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
433 {
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 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
435 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
436 "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
437 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
438 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
439 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
440 }
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 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
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 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
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
22621
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
446 if (plug->error == NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
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 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
449 }
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
450 else
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 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
453 buf = g_strdup_printf(
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
454 _("<span foreground=\"red\" weight=\"bold\">"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
455 "Error: %s\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
456 "Check the plugin website for an update."
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
457 "</span>"),
22621
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
458 tmp);
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
459 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
460 g_free(buf);
22621
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
461 g_free(tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
462 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
463
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
464 gtk_widget_set_sensitive(pref_button,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
465 purple_plugin_is_loaded(plug)
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15514
diff changeset
466 && ((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
467 && 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
468 || (plug->info->prefs_info
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
469 && 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
470
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
471 /* 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
472 g_idle_add(ensure_plugin_visible, sel);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
473
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
474 g_value_unset(&val);
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
477 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
478 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
479 PurplePlugin *plug;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
480 GtkWidget *dialog, *box;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
481 GtkTreeModel *model;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
482 GValue val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
483 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
484
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
485 switch (response) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
486 case GTK_RESPONSE_CLOSE:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
487 case GTK_RESPONSE_DELETE_EVENT:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
488 purple_request_close_with_handle(plugin_dialog);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
489 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
490 gtk_widget_destroy(d);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
491 if (plugin_pref_dialogs != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
492 g_hash_table_destroy(plugin_pref_dialogs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
493 plugin_pref_dialogs = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
494 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
495 plugin_dialog = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
496 break;
15820
c02a897a67c7 More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15632
diff changeset
497 case PIDGIN_RESPONSE_CONFIGURE:
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
498 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
499 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
500 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
501 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
502 plug = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
503 if (plug == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
504 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
505 if (plugin_pref_dialogs != NULL &&
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
506 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
507 break;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
508 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
509 if (box == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
510 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
511
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15820
diff changeset
512 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
513 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
514 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
515 NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
516 if (plugin_pref_dialogs == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
517 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
518
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
519 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
520
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
521 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
522 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
523 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
524 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
525 gtk_widget_show_all(dialog);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
526 g_value_unset(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
527 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
528 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
529 }
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 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
532 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
533 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
534 GtkTreeSelection *sel;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
535 GtkTreeIter iter;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
536 PurplePlugin *plugin;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
537 GtkTreeModel *model;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
538
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
539 sel = gtk_tree_view_get_selection(view);
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 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
542 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
543
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
544 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
545
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
546 if (!purple_plugin_is_loaded(plugin))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
547 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
548
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
549 /* Now show the pref-dialog for the plugin */
15820
c02a897a67c7 More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15632
diff changeset
550 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
551 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
552
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
553 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
554 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
555 {
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 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
557 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
558 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
559 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
560 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
561 }
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
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 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
564 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
565 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
566 {
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 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
568 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
569 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
570 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
571 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
572 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
573 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
574
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 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
576 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
577
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 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
579
22385
19f26913fe71 Allow translation/transliteration foo in the plugin window tooltip.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21946
diff changeset
580 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
581 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
582 _("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
583 _("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
584
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
585 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
586 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
587 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
588 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
589 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
590 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
591
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 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
593 *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
594 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
595 *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
596
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 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
598 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
599 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
600 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
601
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 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
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
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
605 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
606 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
607 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
608 {
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
609 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
610 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
611 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
612 }
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 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
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
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 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
617 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
618 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
619 {
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 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
621 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
622 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
623 }
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 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
625 }
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
626
22621
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
627 static GtkWidget *
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
628 create_details()
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
629 {
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
630 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
631 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
632 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
633
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
634 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
635 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
636 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
637 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
638 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
639
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
640 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
641 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
642 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
643 "editable", FALSE,
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
644 "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
645 "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
646 NULL);
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
647 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
648
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
649 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
650 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
651 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
652 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
653 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
654
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
655 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
656 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
657 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
658 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
659 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
660 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
661 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
662 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
663
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
664 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
665 #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
666 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
667 #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
668
22621
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
669 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
670 #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
671 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
672 "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
673 #endif
22621
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
674 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
675 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
676 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
677 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
678 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
679 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
680 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
681 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
682 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
683
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
684 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
685 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
686 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
687
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
688 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
689 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
690 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
691 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
692 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
693 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
694 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
695 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
696
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
697 return GTK_WIDGET(vbox);
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
698 }
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
699
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
700
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
701 void pidgin_plugin_dialog_show()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
702 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
703 GtkWidget *sw;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
704 GtkWidget *event_view;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
705 GtkListStore *ls;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
706 GtkCellRenderer *rend, *rendt;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
707 GtkTreeViewColumn *col;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
708 GtkTreeSelection *sel;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
709
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
710 if (plugin_dialog != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
711 gtk_window_present(GTK_WINDOW(plugin_dialog));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
712 return;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
715 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
716 NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
717 GTK_DIALOG_NO_SEPARATOR,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
718 NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
719 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
720 _("Configure Pl_ugin"), PIDGIN_RESPONSE_CONFIGURE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
721 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
722 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
723 gtk_widget_set_sensitive(pref_button, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
724 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
725
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
726 sw = gtk_scrolled_window_new(NULL,NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
727 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
728 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
729
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
730 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
731
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
732 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
733 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
734 1, GTK_SORT_ASCENDING);
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 update_plugin_list(ls);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
737
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
738 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
739
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
740 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
741
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
742 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
743 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
744
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
745 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
746 PURPLE_CALLBACK(plugin_load_cb), event_view);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
747 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
748 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
749
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
750 rend = gtk_cell_renderer_toggle_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
751 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
752
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
753 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
754 rend,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
755 "active", 0,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
756 NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
757 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
758 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
759 g_signal_connect(G_OBJECT(rend), "toggled",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
760 G_CALLBACK(plugin_toggled), ls);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
761
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
762 rendt = gtk_cell_renderer_text_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
763 g_object_set(rendt,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
764 "foreground", "#c0c0c0",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
765 NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
766 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
767 rendt,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
768 "markup", 1,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
769 "foreground-set", 3,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
770 NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
771 #if GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
772 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
773 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
774 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
775 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
776 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
777 g_object_unref(G_OBJECT(ls));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
778 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
779 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
780 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
781 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
782
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
783 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
784 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
785 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
786
22621
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
787
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
788 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
789 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
790 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
791 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
792 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
793 FALSE, FALSE, 0);
efc232f1822b Improve the layout of the plugin description pane.
Will Thompson <will.thompson@collabora.co.uk>
parents: 22460
diff changeset
794
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
795
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
796 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
797 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
798 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
799 gtk_widget_show_all(plugin_dialog);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
800 }