Mon, 09 Sep 2019 21:39:27 -0400
Remove purple_plugin_get_filename wrapper as well.
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* pidgin |
| 5205 | 2 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
|
6927
528988ef2781
[gaim-migrate @ 7474]
Christian Hammond <chipx86@chipx86.com>
parents:
5982
diff
changeset
|
6 | * |
| 5205 | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19733
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5205 | 20 | */ |
| 11740 | 21 | #include "internal.h" |
| 15577 | 22 | #include "pidgin.h" |
| 5205 | 23 | #include "gtkplugin.h" |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
24 | #include "gtkpluginpref.h" |
|
13436
b80f8990bc67
[gaim-migrate @ 15810]
Richard Laager <rlaager@pidgin.im>
parents:
13435
diff
changeset
|
25 | #include "gtkutils.h" |
|
5981
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
26 | #include "debug.h" |
|
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
27 | #include "prefs.h" |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
28 | #include "request.h" |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
29 | #include "pidgintooltip.h" |
|
5981
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
30 | |
| 5205 | 31 | #include <string.h> |
| 32 | ||
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33168
diff
changeset
|
33 | #include "gtk3compat.h" |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33168
diff
changeset
|
34 | |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
35 | #define PIDGIN_RESPONSE_CONFIGURE 98121 |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
36 | |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
37 | typedef struct |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
38 | { |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
39 | PidginPluginConfigFrameCb config_frame_cb; |
|
36406
8fba0d44840d
Added PidginPluginInfo, inheriting PurplePluginInfo to hold UI information
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
40 | } PidginPluginInfoPrivate; |
|
8fba0d44840d
Added PidginPluginInfo, inheriting PurplePluginInfo to hold UI information
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
41 | |
|
36447
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
42 | enum |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
43 | { |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
44 | PROP_0, |
| 36936 | 45 | PROP_GTK_CONFIG_FRAME_CB, |
|
36447
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
46 | PROP_LAST |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
47 | }; |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
48 | |
| 36929 | 49 | typedef struct |
| 50 | { | |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
51 | enum |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
52 | { |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
53 | PIDGIN_PLUGIN_UI_DATA_TYPE_FRAME, |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
54 | PIDGIN_PLUGIN_UI_DATA_TYPE_REQUEST |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
55 | } type; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
56 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
57 | union |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
58 | { |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
59 | struct |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
60 | { |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
61 | GtkWidget *dialog; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
62 | PurplePluginPrefFrame *pref_frame; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
63 | } frame; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
64 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
65 | gpointer request_handle; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
66 | } u; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
67 | } PidginPluginUiData; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
68 | |
|
39238
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
69 | G_DEFINE_TYPE_WITH_PRIVATE(PidginPluginInfo, pidgin_plugin_info, |
|
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
70 | PURPLE_TYPE_PLUGIN_INFO); |
|
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
71 | |
| 15884 | 72 | static void plugin_toggled_stage_two(PurplePlugin *plug, GtkTreeModel *model, |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
73 | GtkTreeIter *iter, GError *error, gboolean unload); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
74 | |
|
12343
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
75 | static GtkWidget *expander = NULL; |
| 11740 | 76 | static GtkWidget *plugin_dialog = NULL; |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
77 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
78 | static GtkLabel *plugin_name = NULL; |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
79 | static GtkTextBuffer *plugin_desc = NULL; |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
80 | static GtkLabel *plugin_error = NULL; |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
81 | static GtkLabel *plugin_authors = NULL; |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
82 | static GtkLabel *plugin_website = NULL; |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
83 | static gchar *plugin_website_uri = NULL; |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
84 | static GtkLabel *plugin_filename = NULL; |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
85 | |
| 11740 | 86 | static GtkWidget *pref_button = NULL; |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
87 | |
|
36447
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
88 | /* Set method for GObject properties */ |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
89 | static void |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
90 | pidgin_plugin_info_set_property(GObject *obj, guint param_id, const GValue *value, |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
91 | GParamSpec *pspec) |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
92 | { |
|
39238
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
93 | PidginPluginInfoPrivate *priv = |
|
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
94 | pidgin_plugin_info_get_instance_private( |
|
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
95 | PIDGIN_PLUGIN_INFO(obj)); |
|
36447
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
96 | |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
97 | switch (param_id) { |
| 36936 | 98 | case PROP_GTK_CONFIG_FRAME_CB: |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
99 | priv->config_frame_cb = g_value_get_pointer(value); |
|
36447
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
100 | break; |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
101 | default: |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
102 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
103 | break; |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
104 | } |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
105 | } |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
106 | |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
107 | /* Get method for GObject properties */ |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
108 | static void |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
109 | pidgin_plugin_info_get_property(GObject *obj, guint param_id, GValue *value, |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
110 | GParamSpec *pspec) |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
111 | { |
|
39238
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
112 | PidginPluginInfoPrivate *priv = |
|
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
113 | pidgin_plugin_info_get_instance_private( |
|
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
114 | PIDGIN_PLUGIN_INFO(obj)); |
|
36447
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
115 | |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
116 | switch (param_id) { |
| 36936 | 117 | case PROP_GTK_CONFIG_FRAME_CB: |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
118 | g_value_set_pointer(value, priv->config_frame_cb); |
|
36447
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
119 | break; |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
120 | default: |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
121 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
122 | break; |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
123 | } |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
124 | } |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
125 | |
|
36406
8fba0d44840d
Added PidginPluginInfo, inheriting PurplePluginInfo to hold UI information
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
126 | /* Class initializer function */ |
|
8fba0d44840d
Added PidginPluginInfo, inheriting PurplePluginInfo to hold UI information
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
127 | static void pidgin_plugin_info_class_init(PidginPluginInfoClass *klass) |
|
8fba0d44840d
Added PidginPluginInfo, inheriting PurplePluginInfo to hold UI information
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
128 | { |
|
36447
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
129 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
130 | |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
131 | /* Setup properties */ |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
132 | obj_class->get_property = pidgin_plugin_info_get_property; |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
133 | obj_class->set_property = pidgin_plugin_info_set_property; |
|
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
134 | |
| 36936 | 135 | g_object_class_install_property(obj_class, PROP_GTK_CONFIG_FRAME_CB, |
|
36935
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
136 | g_param_spec_pointer("gtk-config-frame-cb", |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
137 | "GTK configuration frame callback", |
|
36447
2d36e433e617
Added properties "finch_preferences_frame" to FinchPluginInfo, "pidgin_config_frame" to PidginPluginInfo
Ankit Vani <a@nevitus.org>
parents:
36446
diff
changeset
|
138 | "Callback that returns a GTK configuration frame", |
|
36954
26c2cf81a97a
Added G_PARAM_STATIC_STRINGS flag to PluginInfo properties
Ankit Vani <a@nevitus.org>
parents:
36936
diff
changeset
|
139 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | |
|
26c2cf81a97a
Added G_PARAM_STATIC_STRINGS flag to PluginInfo properties
Ankit Vani <a@nevitus.org>
parents:
36936
diff
changeset
|
140 | G_PARAM_STATIC_STRINGS)); |
|
36406
8fba0d44840d
Added PidginPluginInfo, inheriting PurplePluginInfo to hold UI information
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
141 | } |
|
8fba0d44840d
Added PidginPluginInfo, inheriting PurplePluginInfo to hold UI information
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
142 | |
|
39238
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
143 | static void |
|
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
144 | pidgin_plugin_info_init(PidginPluginInfo *info) |
|
36406
8fba0d44840d
Added PidginPluginInfo, inheriting PurplePluginInfo to hold UI information
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
145 | { |
|
8fba0d44840d
Added PidginPluginInfo, inheriting PurplePluginInfo to hold UI information
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
146 | } |
|
8fba0d44840d
Added PidginPluginInfo, inheriting PurplePluginInfo to hold UI information
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
147 | |
|
36446
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
148 | PidginPluginInfo * |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
149 | pidgin_plugin_info_new(const char *first_property, ...) |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
150 | { |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
151 | GObject *info; |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
152 | va_list var_args; |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
153 | |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
154 | /* at least ID is required */ |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
155 | if (!first_property) |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
156 | return NULL; |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
157 | |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
158 | va_start(var_args, first_property); |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
159 | info = g_object_new_valist(PIDGIN_TYPE_PLUGIN_INFO, first_property, |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
160 | var_args); |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
161 | va_end(var_args); |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
162 | |
|
36479
345ec7248f48
Updated plugin info properties as per changes in GPlugin
Ankit Vani <a@nevitus.org>
parents:
36467
diff
changeset
|
163 | g_object_set(info, "ui-requirement", PIDGIN_UI, NULL); |
|
36446
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
164 | |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
165 | return PIDGIN_PLUGIN_INFO(info); |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
166 | } |
|
e75794a5a7f0
Added [purple,pidgin,finch]_plugin_info_new()
Ankit Vani <a@nevitus.org>
parents:
36440
diff
changeset
|
167 | |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
168 | static gboolean |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
169 | pidgin_plugin_has_prefs(PurplePlugin *plugin) |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
170 | { |
| 36929 | 171 | PurplePluginInfo *info = purple_plugin_get_info(plugin); |
| 172 | PidginPluginInfoPrivate *priv = NULL; | |
| 173 | gboolean ret; | |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
174 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
175 | g_return_val_if_fail(plugin != NULL, FALSE); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
176 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
177 | if (!purple_plugin_is_loaded(plugin)) |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
178 | return FALSE; |
| 11747 | 179 | |
| 36929 | 180 | if (PIDGIN_IS_PLUGIN_INFO(info)) |
|
39238
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
181 | priv = pidgin_plugin_info_get_instance_private( |
|
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
182 | PIDGIN_PLUGIN_INFO(info)); |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
183 | |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
184 | ret = ((priv && priv->config_frame_cb) || |
|
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
185 | purple_plugin_info_get_pref_frame_cb(info) || |
|
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
186 | purple_plugin_info_get_pref_request_cb(info)); |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
187 | |
| 36929 | 188 | return ret; |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
189 | } |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
190 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
191 | static GtkWidget * |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
192 | pidgin_plugin_get_config_frame(PurplePlugin *plugin, |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
193 | PurplePluginPrefFrame **purple_pref_frame) |
| 5205 | 194 | { |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
195 | GtkWidget *config = NULL; |
|
36420
7a5cb79a8243
Refactored gtkplugin to use the new API. Handling of dependent plugins on unload is left till GPlugin implements it.
Ankit Vani <a@nevitus.org>
parents:
36417
diff
changeset
|
196 | PurplePluginInfo *info; |
|
37575
32611080681c
Cleanup the plugin pref stuff so it works and doesn't crash
Gary Kramlich <grim@reaperworld.com>
parents:
37422
diff
changeset
|
197 | PurplePluginPrefFrameCb pref_frame_cb = NULL; |
| 5205 | 198 | |
|
37575
32611080681c
Cleanup the plugin pref stuff so it works and doesn't crash
Gary Kramlich <grim@reaperworld.com>
parents:
37422
diff
changeset
|
199 | g_return_val_if_fail(PURPLE_IS_PLUGIN(plugin), NULL); |
| 5205 | 200 | |
|
36431
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
201 | info = purple_plugin_get_info(plugin); |
|
37575
32611080681c
Cleanup the plugin pref stuff so it works and doesn't crash
Gary Kramlich <grim@reaperworld.com>
parents:
37422
diff
changeset
|
202 | if(!PURPLE_IS_PLUGIN_INFO(info)) |
|
32611080681c
Cleanup the plugin pref stuff so it works and doesn't crash
Gary Kramlich <grim@reaperworld.com>
parents:
37422
diff
changeset
|
203 | return NULL; |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
204 | |
|
37575
32611080681c
Cleanup the plugin pref stuff so it works and doesn't crash
Gary Kramlich <grim@reaperworld.com>
parents:
37422
diff
changeset
|
205 | pref_frame_cb = purple_plugin_info_get_pref_frame_cb(info); |
|
32611080681c
Cleanup the plugin pref stuff so it works and doesn't crash
Gary Kramlich <grim@reaperworld.com>
parents:
37422
diff
changeset
|
206 | if(pref_frame_cb) { |
|
32611080681c
Cleanup the plugin pref stuff so it works and doesn't crash
Gary Kramlich <grim@reaperworld.com>
parents:
37422
diff
changeset
|
207 | PurplePluginPrefFrame *frame = pref_frame_cb(plugin); |
| 5205 | 208 | |
|
37575
32611080681c
Cleanup the plugin pref stuff so it works and doesn't crash
Gary Kramlich <grim@reaperworld.com>
parents:
37422
diff
changeset
|
209 | if(frame) { |
|
32611080681c
Cleanup the plugin pref stuff so it works and doesn't crash
Gary Kramlich <grim@reaperworld.com>
parents:
37422
diff
changeset
|
210 | config = pidgin_plugin_pref_create_frame(frame); |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
211 | |
|
37575
32611080681c
Cleanup the plugin pref stuff so it works and doesn't crash
Gary Kramlich <grim@reaperworld.com>
parents:
37422
diff
changeset
|
212 | *purple_pref_frame = frame; |
|
32611080681c
Cleanup the plugin pref stuff so it works and doesn't crash
Gary Kramlich <grim@reaperworld.com>
parents:
37422
diff
changeset
|
213 | } |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
214 | } |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
215 | |
|
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
216 | return config; |
| 5205 | 217 | } |
|
5981
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
218 | |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
219 | static void |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
220 | pref_dialog_close(PurplePlugin *plugin) |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
221 | { |
| 36929 | 222 | PurplePluginInfo *info; |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
223 | PidginPluginUiData *ui_data; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
224 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
225 | g_return_if_fail(plugin != NULL); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
226 | |
| 36929 | 227 | info = purple_plugin_get_info(plugin); |
| 228 | ||
| 229 | ui_data = purple_plugin_info_get_ui_data(info); | |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
230 | if (ui_data == NULL) |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
231 | return; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
232 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
233 | if (ui_data->type == PIDGIN_PLUGIN_UI_DATA_TYPE_REQUEST) { |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
234 | purple_request_close(PURPLE_REQUEST_FIELDS, |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
235 | ui_data->u.request_handle); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
236 | return; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
237 | } |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
238 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
239 | g_return_if_fail(ui_data->type == PIDGIN_PLUGIN_UI_DATA_TYPE_FRAME); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
240 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
241 | gtk_widget_destroy(ui_data->u.frame.dialog); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
242 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
243 | if (ui_data->u.frame.pref_frame) |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
244 | purple_plugin_pref_frame_destroy(ui_data->u.frame.pref_frame); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
245 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
246 | g_free(ui_data); |
| 36929 | 247 | purple_plugin_info_set_ui_data(info, NULL); |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
248 | } |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
249 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
250 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
251 | static void |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
252 | pref_dialog_response_cb(GtkWidget *dialog, int response, PurplePlugin *plugin) |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
253 | { |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
254 | if (response == GTK_RESPONSE_CLOSE || |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
255 | response == GTK_RESPONSE_DELETE_EVENT) |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
256 | { |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
257 | pref_dialog_close(plugin); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
258 | } |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
259 | } |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
260 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
261 | static void |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
262 | pidgin_plugin_open_config(PurplePlugin *plugin, GtkWindow *parent) |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
263 | { |
| 36929 | 264 | PurplePluginInfo *info; |
|
36420
7a5cb79a8243
Refactored gtkplugin to use the new API. Handling of dependent plugins on unload is left till GPlugin implements it.
Ankit Vani <a@nevitus.org>
parents:
36417
diff
changeset
|
265 | PidginPluginInfoPrivate *priv = NULL; |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
266 | PidginPluginUiData *ui_data; |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
267 | PurplePluginPrefFrameCb pref_frame_cb; |
|
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
268 | PurplePluginPrefRequestCb pref_request_cb; |
|
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
269 | PidginPluginConfigFrameCb get_pidgin_frame = NULL; |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
270 | gint prefs_count; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
271 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
272 | g_return_if_fail(plugin != NULL); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
273 | |
| 36929 | 274 | info = purple_plugin_get_info(plugin); |
| 275 | ||
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
276 | if (!pidgin_plugin_has_prefs(plugin)) { |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
277 | purple_debug_warning("gtkplugin", "Plugin has no prefs"); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
278 | return; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
279 | } |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
280 | |
| 36929 | 281 | if (purple_plugin_info_get_ui_data(info)) |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
282 | return; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
283 | |
|
36420
7a5cb79a8243
Refactored gtkplugin to use the new API. Handling of dependent plugins on unload is left till GPlugin implements it.
Ankit Vani <a@nevitus.org>
parents:
36417
diff
changeset
|
284 | if (PIDGIN_IS_PLUGIN_INFO(info)) |
|
39238
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
285 | priv = pidgin_plugin_info_get_instance_private( |
|
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38583
diff
changeset
|
286 | PIDGIN_PLUGIN_INFO(info)); |
|
36420
7a5cb79a8243
Refactored gtkplugin to use the new API. Handling of dependent plugins on unload is left till GPlugin implements it.
Ankit Vani <a@nevitus.org>
parents:
36417
diff
changeset
|
287 | |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
288 | pref_frame_cb = purple_plugin_info_get_pref_frame_cb(info); |
|
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
289 | pref_request_cb = purple_plugin_info_get_pref_request_cb(info); |
| 36929 | 290 | |
| 291 | if (priv) | |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
292 | get_pidgin_frame = priv->config_frame_cb; |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
293 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
294 | prefs_count = 0; |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
295 | if (pref_frame_cb) |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
296 | prefs_count++; |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
297 | if (pref_request_cb) |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
298 | prefs_count++; |
| 36929 | 299 | if (get_pidgin_frame) |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
300 | prefs_count++; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
301 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
302 | if (prefs_count > 1) { |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
303 | purple_debug_warning("gtkplugin", |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
304 | "Plugin %s contains more than one prefs " |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
305 | "callback, some will be ignored.", |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
306 | gplugin_plugin_info_get_name( |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
307 | GPLUGIN_PLUGIN_INFO(info))); |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
308 | } |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
309 | g_return_if_fail(prefs_count > 0); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
310 | |
| 36929 | 311 | ui_data = g_new0(PidginPluginUiData, 1); |
| 312 | purple_plugin_info_set_ui_data(info, ui_data); | |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
313 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
314 | /* Priority: pidgin frame > purple request > purple frame |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
315 | * Purple frame could be replaced with purple request some day. |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
316 | */ |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
317 | if (pref_request_cb && !get_pidgin_frame) { |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
318 | ui_data->type = PIDGIN_PLUGIN_UI_DATA_TYPE_REQUEST; |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36929
diff
changeset
|
319 | ui_data->u.request_handle = pref_request_cb(plugin); |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
320 | purple_request_add_close_notify(ui_data->u.request_handle, |
| 36929 | 321 | purple_callback_set_zero, &info->ui_data); |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
322 | purple_request_add_close_notify(ui_data->u.request_handle, |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
323 | g_free, ui_data); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
324 | } else { |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
325 | GtkWidget *box, *dialog; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
326 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
327 | ui_data->type = PIDGIN_PLUGIN_UI_DATA_TYPE_FRAME; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
328 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
329 | box = pidgin_plugin_get_config_frame(plugin, |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
330 | &ui_data->u.frame.pref_frame); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
331 | if (box == NULL) { |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
332 | purple_debug_error("gtkplugin", |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
333 | "Failed to display prefs frame"); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
334 | g_free(ui_data); |
| 36929 | 335 | purple_plugin_info_set_ui_data(info, NULL); |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
336 | return; |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
337 | } |
|
37688
7d9ac7dbfdac
gtkplugin: fix plugin preferences dialog resize
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37576
diff
changeset
|
338 | gtk_widget_set_vexpand(box, TRUE); |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
339 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
340 | ui_data->u.frame.dialog = dialog = gtk_dialog_new_with_buttons( |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
341 | PIDGIN_ALERT_TITLE, parent, |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
342 | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CLOSE, |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
343 | GTK_RESPONSE_CLOSE, NULL); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
344 | |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
345 | g_signal_connect(G_OBJECT(dialog), "response", |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
346 | G_CALLBACK(pref_dialog_response_cb), plugin); |
| 36212 | 347 | |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
348 | gtk_container_add(GTK_CONTAINER( |
| 36212 | 349 | gtk_dialog_get_content_area(GTK_DIALOG(dialog))), |
|
37576
3cf4744a9521
Don't allow horizontal scrolling. The default width right now is too low for 2 out of 3 plugins that I checked causing some seriously weird scrolling to become necessary
Gary Kramlich <grim@reaperworld.com>
parents:
37575
diff
changeset
|
350 | pidgin_make_scrollable(box, GTK_POLICY_NEVER, |
| 36212 | 351 | GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, 400, 400)); |
| 352 | ||
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
353 | gtk_window_set_role(GTK_WINDOW(dialog), "plugin_config"); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
354 | gtk_window_set_title(GTK_WINDOW(dialog), |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
355 | _(gplugin_plugin_info_get_name( |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
356 | GPLUGIN_PLUGIN_INFO(info)))); |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
357 | gtk_widget_show_all(dialog); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
358 | } |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
359 | } |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
360 | |
|
5981
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
361 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
362 | pidgin_plugins_save(void) |
|
5981
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
363 | { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
364 | purple_plugins_save_loaded(PIDGIN_PREFS_ROOT "/plugins/loaded"); |
|
5981
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
365 | } |
| 11740 | 366 | |
| 367 | static void | |
| 368 | update_plugin_list(void *data) | |
| 369 | { | |
| 370 | GtkListStore *ls = GTK_LIST_STORE(data); | |
| 371 | GtkTreeIter iter; | |
|
36420
7a5cb79a8243
Refactored gtkplugin to use the new API. Handling of dependent plugins on unload is left till GPlugin implements it.
Ankit Vani <a@nevitus.org>
parents:
36417
diff
changeset
|
372 | GList *plugins, *l; |
| 15884 | 373 | PurplePlugin *plug; |
|
36431
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
374 | PurplePluginInfo *info; |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
375 | GPluginPluginInfo *ginfo; |
| 11740 | 376 | |
| 377 | gtk_list_store_clear(ls); | |
|
36431
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
378 | purple_plugins_refresh(); |
| 11740 | 379 | |
|
36420
7a5cb79a8243
Refactored gtkplugin to use the new API. Handling of dependent plugins on unload is left till GPlugin implements it.
Ankit Vani <a@nevitus.org>
parents:
36417
diff
changeset
|
380 | plugins = purple_plugins_find_all(); |
|
7a5cb79a8243
Refactored gtkplugin to use the new API. Handling of dependent plugins on unload is left till GPlugin implements it.
Ankit Vani <a@nevitus.org>
parents:
36417
diff
changeset
|
381 | |
|
7a5cb79a8243
Refactored gtkplugin to use the new API. Handling of dependent plugins on unload is left till GPlugin implements it.
Ankit Vani <a@nevitus.org>
parents:
36417
diff
changeset
|
382 | for (l = plugins; l != NULL; l = l->next) |
| 11740 | 383 | { |
|
12702
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
384 | char *name; |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
385 | char *version; |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
386 | char *summary; |
| 11740 | 387 | char *desc; |
|
36431
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
388 | plug = PURPLE_PLUGIN(l->data); |
|
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
389 | info = purple_plugin_get_info(plug); |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
390 | ginfo = GPLUGIN_PLUGIN_INFO(info); |
| 11740 | 391 | |
|
36467
52aa83c47311
Replaced purple_plugin_loads_on_query() with purple_plugin_is_internal().
Ankit Vani <a@nevitus.org>
parents:
36464
diff
changeset
|
392 | if (purple_plugin_is_internal(plug)) |
|
15336
a2454071e986
[gaim-migrate @ 18064]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15177
diff
changeset
|
393 | continue; |
| 11740 | 394 | |
| 395 | gtk_list_store_append (ls, &iter); | |
|
12702
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
396 | |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
397 | if (gplugin_plugin_info_get_name(ginfo)) { |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
398 | name = g_markup_escape_text( |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
399 | _(gplugin_plugin_info_get_name(ginfo)), -1); |
|
26756
874b154f4220
More Pidgin updates for GTK+ 3.0. Removes any deprecated functions for GLib
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23180
diff
changeset
|
400 | } else { |
|
39835
c28a375781dd
Remove purple_plugin_get_filename wrapper as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39834
diff
changeset
|
401 | char *tmp = g_path_get_basename( |
|
c28a375781dd
Remove purple_plugin_get_filename wrapper as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39834
diff
changeset
|
402 | gplugin_plugin_get_filename(plug)); |
|
26756
874b154f4220
More Pidgin updates for GTK+ 3.0. Removes any deprecated functions for GLib
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23180
diff
changeset
|
403 | name = g_markup_escape_text(tmp, -1); |
|
874b154f4220
More Pidgin updates for GTK+ 3.0. Removes any deprecated functions for GLib
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23180
diff
changeset
|
404 | g_free(tmp); |
|
874b154f4220
More Pidgin updates for GTK+ 3.0. Removes any deprecated functions for GLib
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23180
diff
changeset
|
405 | } |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
406 | version = g_markup_escape_text( |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
407 | gplugin_plugin_info_get_version(ginfo), -1); |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
408 | summary = g_markup_escape_text( |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
409 | gplugin_plugin_info_get_summary(ginfo), -1); |
|
12702
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
410 | |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
411 | desc = g_strdup_printf("<b>%s</b> %s\n%s", name, |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
412 | version, |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
413 | summary); |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
414 | g_free(name); |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
415 | g_free(version); |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
416 | g_free(summary); |
|
fbd3bef47358
[gaim-migrate @ 15045]
Richard Laager <rlaager@pidgin.im>
parents:
12695
diff
changeset
|
417 | |
| 11740 | 418 | gtk_list_store_set(ls, &iter, |
| 15884 | 419 | 0, purple_plugin_is_loaded(plug), |
| 11740 | 420 | 1, desc, |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
421 | 2, plug, |
|
36760
88a9488af4e8
Fixed pidgin's plugin list display
Ankit Vani <a@nevitus.org>
parents:
36701
diff
changeset
|
422 | 3, purple_plugin_info_get_error(info), |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
423 | -1); |
| 11740 | 424 | g_free(desc); |
| 425 | } | |
|
36420
7a5cb79a8243
Refactored gtkplugin to use the new API. Handling of dependent plugins on unload is left till GPlugin implements it.
Ankit Vani <a@nevitus.org>
parents:
36417
diff
changeset
|
426 | |
|
36430
559d5d9d8a6c
Refactored the codebase to remove purple_plugins_free_found_list()
Ankit Vani <a@nevitus.org>
parents:
36422
diff
changeset
|
427 | g_list_free(plugins); |
| 11740 | 428 | } |
| 429 | ||
|
36780
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
430 | static gboolean |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
431 | check_if_loaded(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
432 | { |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
433 | PurplePlugin *plugin; |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
434 | gtk_tree_model_get(model, iter, 2, &plugin, -1); |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
435 | gtk_list_store_set(GTK_LIST_STORE(model), iter, |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
436 | 0, purple_plugin_is_loaded(plugin), |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
437 | -1); |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
438 | return FALSE; |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
439 | } |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
440 | |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
441 | static void |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
442 | update_loaded_plugins(GtkTreeModel *model) |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
443 | { |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
444 | gtk_tree_model_foreach(model, check_if_loaded, NULL); |
| 11740 | 445 | } |
| 446 | ||
| 15884 | 447 | static void plugin_loading_common(PurplePlugin *plugin, GtkTreeView *view, gboolean loaded) |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
448 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
449 | GtkTreeIter iter; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
450 | GtkTreeModel *model = gtk_tree_view_get_model(view); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
451 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
452 | if (gtk_tree_model_get_iter_first(model, &iter)) { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
453 | do { |
| 15884 | 454 | PurplePlugin *plug; |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
455 | GtkTreeSelection *sel; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
456 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
457 | gtk_tree_model_get(model, &iter, 2, &plug, -1); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
458 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
459 | if (plug != plugin) |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
460 | continue; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
461 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
462 | gtk_list_store_set(GTK_LIST_STORE(model), &iter, 0, loaded, -1); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
463 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
464 | /* If the loaded/unloaded plugin is the selected row, |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
465 | * update the pref_button. */ |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
466 | sel = gtk_tree_view_get_selection(view); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
467 | if (gtk_tree_selection_get_selected(sel, &model, &iter)) |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
468 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
469 | gtk_tree_model_get(model, &iter, 2, &plug, -1); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
470 | if (plug == plugin) |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
471 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
472 | gtk_widget_set_sensitive(pref_button, |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
473 | pidgin_plugin_has_prefs(plug)); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
474 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
475 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
476 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
477 | break; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
478 | } while (gtk_tree_model_iter_next(model, &iter)); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
479 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
480 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
481 | |
| 15884 | 482 | static void plugin_load_cb(PurplePlugin *plugin, gpointer data) |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
483 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
484 | GtkTreeView *view = (GtkTreeView *)data; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
485 | plugin_loading_common(plugin, view, TRUE); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
486 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
487 | |
| 15884 | 488 | static void plugin_unload_cb(PurplePlugin *plugin, gpointer data) |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
489 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
490 | GtkTreeView *view = (GtkTreeView *)data; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
491 | plugin_loading_common(plugin, view, FALSE); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
492 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
493 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
494 | static void plugin_unload_confirm_cb(gpointer *data) |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
495 | { |
| 15884 | 496 | PurplePlugin *plugin = (PurplePlugin *)data[0]; |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
497 | GtkTreeModel *model = (GtkTreeModel *)data[1]; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
498 | GtkTreeIter *iter = (GtkTreeIter *)data[2]; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
499 | |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
500 | plugin_toggled_stage_two(plugin, model, iter, NULL, TRUE); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
501 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
502 | g_free(data); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
503 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
504 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
505 | static void plugin_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
| 11740 | 506 | { |
| 507 | GtkTreeModel *model = (GtkTreeModel *)data; | |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
508 | GtkTreeIter *iter = g_new(GtkTreeIter, 1); |
| 11740 | 509 | GtkTreePath *path = gtk_tree_path_new_from_string(pth); |
| 15884 | 510 | PurplePlugin *plug; |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
511 | GError *error = NULL; |
| 11740 | 512 | |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
513 | gtk_tree_model_get_iter(model, iter, path); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
514 | gtk_tree_path_free(path); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
515 | gtk_tree_model_get(model, iter, 2, &plug, -1); |
| 11740 | 516 | |
| 15884 | 517 | if (!purple_plugin_is_loaded(plug)) |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
518 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
519 | pidgin_set_cursor(plugin_dialog, GDK_WATCH); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
520 | |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
521 | purple_plugin_load(plug, &error); |
|
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
522 | plugin_toggled_stage_two(plug, model, iter, error, FALSE); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
523 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
524 | pidgin_clear_cursor(plugin_dialog); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
525 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
526 | else |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
527 | { |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
528 | pref_dialog_close(plug); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
529 | |
|
36440
58d31fb6330a
Refactored the codebase according to the API changes
Ankit Vani <a@nevitus.org>
parents:
36438
diff
changeset
|
530 | if (purple_plugin_get_dependent_plugins(plug) != NULL) |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
531 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
532 | GString *tmp = g_string_new(_("The following plugins will be unloaded.")); |
| 36438 | 533 | GSList *l; |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
534 | gpointer *cb_data; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
535 | |
|
36440
58d31fb6330a
Refactored the codebase according to the API changes
Ankit Vani <a@nevitus.org>
parents:
36438
diff
changeset
|
536 | for (l = purple_plugin_get_dependent_plugins(plug); l != NULL ; l = l->next) |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
537 | { |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
538 | const char *dep_name = (const char *)l->data; |
|
36431
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
539 | PurplePlugin *dep_plugin = purple_plugins_find_plugin(dep_name); |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
540 | GPluginPluginInfo *dep_info; |
|
36420
7a5cb79a8243
Refactored gtkplugin to use the new API. Handling of dependent plugins on unload is left till GPlugin implements it.
Ankit Vani <a@nevitus.org>
parents:
36417
diff
changeset
|
541 | |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
542 | g_return_if_fail(dep_plugin != NULL); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
543 | |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
544 | dep_info = GPLUGIN_PLUGIN_INFO( |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
545 | purple_plugin_get_info(dep_plugin)); |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
546 | g_string_append_printf( |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
547 | tmp, "\n\t%s\n", |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
548 | gplugin_plugin_info_get_name(dep_info)); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
549 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
550 | |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
551 | cb_data = g_new(gpointer, 3); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
552 | cb_data[0] = plug; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
553 | cb_data[1] = model; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
554 | cb_data[2] = iter; |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
555 | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
556 | purple_request_action(plugin_dialog, NULL, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33271
diff
changeset
|
557 | _("Multiple plugins will be unloaded."), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33271
diff
changeset
|
558 | tmp->str, 0, NULL, cb_data, 2, |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33271
diff
changeset
|
559 | _("Unload Plugins"), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33271
diff
changeset
|
560 | G_CALLBACK(plugin_unload_confirm_cb), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33271
diff
changeset
|
561 | _("Cancel"), g_free); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
562 | g_string_free(tmp, TRUE); |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
563 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
564 | else |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
565 | plugin_toggled_stage_two(plug, model, iter, NULL, TRUE); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
566 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
567 | } |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
568 | |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
569 | static void plugin_toggled_stage_two(PurplePlugin *plug, GtkTreeModel *model, GtkTreeIter *iter, GError *error, gboolean unload) |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
570 | { |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
571 | GPluginPluginInfo *info = |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
572 | GPLUGIN_PLUGIN_INFO(purple_plugin_get_info(plug)); |
|
36420
7a5cb79a8243
Refactored gtkplugin to use the new API. Handling of dependent plugins on unload is left till GPlugin implements it.
Ankit Vani <a@nevitus.org>
parents:
36417
diff
changeset
|
573 | |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
574 | if (unload) |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
575 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
576 | pidgin_set_cursor(plugin_dialog, GDK_WATCH); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
577 | |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
578 | if (!purple_plugin_unload(plug, &error)) |
|
20872
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
579 | { |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
580 | const char *primary = _("Could not unload plugin"); |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
581 | const char *reload = _("The plugin could not be unloaded now, but will be disabled at the next startup."); |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
582 | |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
583 | char *tmp = g_strdup_printf("%s\n\n%s", reload, error->message); |
| 36782 | 584 | purple_notify_warning(NULL, NULL, primary, tmp, NULL); |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
585 | g_free(tmp); |
|
20872
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
586 | |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
587 | purple_plugin_disable(plug); |
|
fc317689cfef
Use the new purple_plugin_disable() function and purple_plugin_unload()'s
Richard Laager <rlaager@pidgin.im>
parents:
20147
diff
changeset
|
588 | } |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
589 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
590 | pidgin_clear_cursor(plugin_dialog); |
| 11781 | 591 | } |
|
36831
9d29e248716d
Notify plugin load error in pidgin
Ankit Vani <a@nevitus.org>
parents:
36782
diff
changeset
|
592 | else if (!unload && error) |
|
9d29e248716d
Notify plugin load error in pidgin
Ankit Vani <a@nevitus.org>
parents:
36782
diff
changeset
|
593 | { |
|
9d29e248716d
Notify plugin load error in pidgin
Ankit Vani <a@nevitus.org>
parents:
36782
diff
changeset
|
594 | purple_notify_warning(NULL, NULL, _("Could not load plugin"), error->message, NULL); |
|
9d29e248716d
Notify plugin load error in pidgin
Ankit Vani <a@nevitus.org>
parents:
36782
diff
changeset
|
595 | } |
| 11740 | 596 | |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
597 | gtk_widget_set_sensitive(pref_button, pidgin_plugin_has_prefs(plug)); |
| 11740 | 598 | |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
599 | if (error != NULL) |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
600 | { |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
601 | gchar *name = g_markup_escape_text( |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
602 | gplugin_plugin_info_get_name(info), -1); |
| 11781 | 603 | |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
604 | gchar *disp_error = g_markup_escape_text(error->message, -1); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
605 | gchar *text; |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
606 | |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
607 | text = g_strdup_printf("<b>%s</b> %s\n<span weight=\"bold\" " |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
608 | "color=\"red\">%s</span>", |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
609 | gplugin_plugin_info_get_name(info), |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
610 | gplugin_plugin_info_get_version(info), |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
611 | disp_error); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
612 | gtk_list_store_set(GTK_LIST_STORE (model), iter, |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
613 | 1, text, |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
614 | -1); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
615 | g_free(text); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
616 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
617 | text = g_strdup_printf( |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
618 | "<span weight=\"bold\" color=\"red\">%s</span>", |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
619 | disp_error); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
620 | gtk_label_set_markup(plugin_error, text); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
621 | g_free(text); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
622 | |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
623 | g_free(disp_error); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
624 | g_free(name); |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
625 | |
|
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
626 | g_error_free(error); |
| 11740 | 627 | } |
| 628 | ||
|
36780
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
629 | if ((unload && purple_plugin_get_dependent_plugins(plug)) || |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
630 | (!unload && gplugin_plugin_info_get_dependencies(info))) { |
|
36780
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
631 | update_loaded_plugins(model); |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
632 | } else { |
|
36780
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
633 | gtk_list_store_set(GTK_LIST_STORE (model), iter, |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
634 | 0, purple_plugin_is_loaded(plug), |
|
2e95872a71c3
Update the automatically loaded plugins via dependencies/dependent plugins on plugin load/unload in pidgin
Ankit Vani <a@nevitus.org>
parents:
36760
diff
changeset
|
635 | -1); |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
636 | } |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
637 | g_free(iter); |
| 11740 | 638 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
639 | pidgin_plugins_save(); |
| 11740 | 640 | } |
| 641 | ||
| 11877 | 642 | static gboolean ensure_plugin_visible(void *data) |
| 643 | { | |
| 644 | GtkTreeSelection *sel = GTK_TREE_SELECTION(data); | |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
645 | GtkTreeView *tv = gtk_tree_selection_get_tree_view(sel); |
| 11877 | 646 | GtkTreeModel *model = gtk_tree_view_get_model(tv); |
| 647 | GtkTreePath *path; | |
| 648 | GtkTreeIter iter; | |
| 649 | if (!gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 650 | return FALSE; | |
| 651 | path = gtk_tree_model_get_path(model, &iter); | |
| 652 | gtk_tree_view_scroll_to_cell(gtk_tree_selection_get_tree_view(sel), path, NULL, FALSE, 0, 0); | |
| 653 | gtk_tree_path_free(path); | |
| 654 | return FALSE; | |
| 655 | } | |
| 656 | ||
| 11740 | 657 | static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) |
| 658 | { | |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
659 | gchar *buf, *tmp, *name, *version; |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
660 | gchar *authors = NULL; |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
661 | const gchar * const *authorlist; |
| 11740 | 662 | GtkTreeIter iter; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12343
diff
changeset
|
663 | GValue val; |
| 15884 | 664 | PurplePlugin *plug; |
|
36431
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
665 | PurplePluginInfo *info; |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
666 | GPluginPluginInfo *ginfo; |
| 11740 | 667 | |
|
11833
119ea75db24b
[gaim-migrate @ 14124]
Mark Doliner <markdoliner@pidgin.im>
parents:
11817
diff
changeset
|
668 | if (!gtk_tree_selection_get_selected (sel, &model, &iter)) |
|
119ea75db24b
[gaim-migrate @ 14124]
Mark Doliner <markdoliner@pidgin.im>
parents:
11817
diff
changeset
|
669 | { |
|
119ea75db24b
[gaim-migrate @ 14124]
Mark Doliner <markdoliner@pidgin.im>
parents:
11817
diff
changeset
|
670 | gtk_widget_set_sensitive(pref_button, FALSE); |
|
12343
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
671 | |
|
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
672 | /* Collapse and disable the expander widget */ |
|
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
673 | gtk_expander_set_expanded(GTK_EXPANDER(expander), FALSE); |
|
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
674 | gtk_widget_set_sensitive(expander, FALSE); |
|
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
675 | |
| 11740 | 676 | return; |
|
11833
119ea75db24b
[gaim-migrate @ 14124]
Mark Doliner <markdoliner@pidgin.im>
parents:
11817
diff
changeset
|
677 | } |
|
119ea75db24b
[gaim-migrate @ 14124]
Mark Doliner <markdoliner@pidgin.im>
parents:
11817
diff
changeset
|
678 | |
|
12343
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
679 | gtk_widget_set_sensitive(expander, TRUE); |
|
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
680 | |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12343
diff
changeset
|
681 | val.g_type = 0; |
| 11740 | 682 | gtk_tree_model_get_value (model, &iter, 2, &val); |
| 683 | plug = g_value_get_pointer(&val); | |
|
36431
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
684 | info = purple_plugin_get_info(plug); |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
685 | ginfo = GPLUGIN_PLUGIN_INFO(info); |
| 11740 | 686 | |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
687 | name = g_markup_escape_text(gplugin_plugin_info_get_name(ginfo), -1); |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
688 | version = g_markup_escape_text(gplugin_plugin_info_get_version(ginfo), |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
689 | -1); |
| 11740 | 690 | buf = g_strdup_printf( |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
691 | "<span size=\"larger\" weight=\"bold\">%s</span> " |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
692 | "<span size=\"smaller\">%s</span>", |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
693 | name, version); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
694 | gtk_label_set_markup(plugin_name, buf); |
|
23180
5d6a0a35837f
applied changes from 97a20dd56598fa5c690eabcbc8ec3ff6e560aefd
Daniel Atallah <datallah@pidgin.im>
parents:
23100
diff
changeset
|
695 | g_free(name); |
|
5d6a0a35837f
applied changes from 97a20dd56598fa5c690eabcbc8ec3ff6e560aefd
Daniel Atallah <datallah@pidgin.im>
parents:
23100
diff
changeset
|
696 | g_free(version); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
697 | g_free(buf); |
| 11740 | 698 | |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
699 | gtk_text_buffer_set_text( |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
700 | plugin_desc, gplugin_plugin_info_get_description(ginfo), -1); |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
701 | |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
702 | authorlist = gplugin_plugin_info_get_authors(ginfo); |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
703 | if (authorlist) |
|
36760
88a9488af4e8
Fixed pidgin's plugin list display
Ankit Vani <a@nevitus.org>
parents:
36701
diff
changeset
|
704 | authors = g_strjoinv(",\n", (gchar **)authorlist); |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
705 | gtk_label_set_text(plugin_authors, authors); |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
706 | g_free(authors); |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
707 | |
|
39835
c28a375781dd
Remove purple_plugin_get_filename wrapper as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39834
diff
changeset
|
708 | gtk_label_set_text(plugin_filename, gplugin_plugin_get_filename(plug)); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
709 | |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
710 | g_free(plugin_website_uri); |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
711 | plugin_website_uri = g_strdup(gplugin_plugin_info_get_website(ginfo)); |
|
36420
7a5cb79a8243
Refactored gtkplugin to use the new API. Handling of dependent plugins on unload is left till GPlugin implements it.
Ankit Vani <a@nevitus.org>
parents:
36417
diff
changeset
|
712 | |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
713 | if (plugin_website_uri) |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
714 | { |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
715 | tmp = g_markup_escape_text(plugin_website_uri, -1); |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
716 | buf = g_strdup_printf("<span underline=\"single\" " |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
717 | "foreground=\"blue\">%s</span>", tmp); |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
718 | gtk_label_set_markup(plugin_website, buf); |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
719 | g_free(tmp); |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
720 | g_free(buf); |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
721 | } |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
722 | else |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
723 | { |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
724 | gtk_label_set_text(plugin_website, NULL); |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
725 | } |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
726 | |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
727 | if (purple_plugin_info_get_error(info) == NULL) |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
728 | { |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
729 | gtk_label_set_text(plugin_error, NULL); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
730 | } |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
731 | else |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
732 | { |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36479
diff
changeset
|
733 | tmp = g_markup_escape_text(purple_plugin_info_get_error(info), -1); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
734 | buf = g_strdup_printf( |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
735 | _("<span foreground=\"red\" weight=\"bold\">" |
|
12705
7780ec726bdb
[gaim-migrate @ 15048]
Richard Laager <rlaager@pidgin.im>
parents:
12702
diff
changeset
|
736 | "Error: %s\n" |
|
7780ec726bdb
[gaim-migrate @ 15048]
Richard Laager <rlaager@pidgin.im>
parents:
12702
diff
changeset
|
737 | "Check the plugin website for an update." |
|
7780ec726bdb
[gaim-migrate @ 15048]
Richard Laager <rlaager@pidgin.im>
parents:
12702
diff
changeset
|
738 | "</span>"), |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
739 | tmp); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
740 | gtk_label_set_markup(plugin_error, buf); |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
741 | g_free(buf); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
742 | g_free(tmp); |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
743 | } |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
744 | |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
745 | gtk_widget_set_sensitive(pref_button, pidgin_plugin_has_prefs(plug)); |
|
11817
b8622a510778
[gaim-migrate @ 14108]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11813
diff
changeset
|
746 | |
| 11877 | 747 | /* Make sure the selected plugin is still visible */ |
| 748 | g_idle_add(ensure_plugin_visible, sel); | |
| 749 | ||
| 11740 | 750 | g_value_unset(&val); |
| 751 | } | |
| 752 | ||
| 11741 | 753 | static void plugin_dialog_response_cb(GtkWidget *d, int response, GtkTreeSelection *sel) |
| 11740 | 754 | { |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
755 | PurplePlugin *plugin; |
| 11740 | 756 | GtkTreeModel *model; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12343
diff
changeset
|
757 | GValue val; |
| 11740 | 758 | GtkTreeIter iter; |
| 36929 | 759 | GList *list, *it; |
| 11740 | 760 | |
|
37234
bfacdb2fbfdc
Prevent a segfault caused by opening the ExtPlacement plugin's config window.
Michael McConville <mmcconville@mykolab.com>
parents:
37158
diff
changeset
|
761 | g_return_if_fail(d != NULL); |
|
bfacdb2fbfdc
Prevent a segfault caused by opening the ExtPlacement plugin's config window.
Michael McConville <mmcconville@mykolab.com>
parents:
37158
diff
changeset
|
762 | |
| 11740 | 763 | switch (response) { |
| 764 | case GTK_RESPONSE_CLOSE: | |
| 765 | case GTK_RESPONSE_DELETE_EVENT: | |
| 15884 | 766 | purple_request_close_with_handle(plugin_dialog); |
| 767 | purple_signals_disconnect_by_handle(plugin_dialog); | |
| 36929 | 768 | list = purple_plugins_find_all(); |
| 769 | for (it = list; it; it = g_list_next(it)) | |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
770 | pref_dialog_close(it->data); |
| 36929 | 771 | g_list_free(list); |
| 11740 | 772 | gtk_widget_destroy(d); |
| 773 | plugin_dialog = NULL; | |
| 774 | break; | |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
775 | case PIDGIN_RESPONSE_CONFIGURE: |
| 11740 | 776 | if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
| 777 | return; | |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12343
diff
changeset
|
778 | val.g_type = 0; |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12343
diff
changeset
|
779 | gtk_tree_model_get_value(model, &iter, 2, &val); |
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
780 | plugin = g_value_get_pointer(&val); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
781 | g_value_unset(&val); |
|
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
782 | if (plugin == NULL) |
| 11740 | 783 | break; |
| 784 | ||
|
34479
7d4651f1035e
Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34477
diff
changeset
|
785 | pidgin_plugin_open_config(plugin, GTK_WINDOW(d)); |
| 11781 | 786 | |
| 11740 | 787 | break; |
| 788 | } | |
| 789 | } | |
| 790 | ||
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
791 | static void |
|
13718
f29249a2856c
[gaim-migrate @ 16125]
Richard Laager <rlaager@pidgin.im>
parents:
13436
diff
changeset
|
792 | show_plugin_prefs_cb(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *column, GtkWidget *dialog) |
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
793 | { |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
794 | GtkTreeSelection *sel; |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
795 | GtkTreeIter iter; |
| 15884 | 796 | PurplePlugin *plugin; |
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
797 | GtkTreeModel *model; |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
798 | |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
799 | sel = gtk_tree_view_get_selection(view); |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
800 | |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
801 | if (!gtk_tree_selection_get_selected(sel, &model, &iter)) |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
802 | return; |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
803 | |
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
804 | gtk_tree_model_get(model, &iter, 2, &plugin, -1); |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
805 | |
| 15884 | 806 | if (!purple_plugin_is_loaded(plugin)) |
|
12174
3b0b53e84591
[gaim-migrate @ 14476]
Richard Laager <rlaager@pidgin.im>
parents:
12162
diff
changeset
|
807 | return; |
|
3b0b53e84591
[gaim-migrate @ 14476]
Richard Laager <rlaager@pidgin.im>
parents:
12162
diff
changeset
|
808 | |
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
809 | /* Now show the pref-dialog for the plugin */ |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
810 | plugin_dialog_response_cb(dialog, PIDGIN_RESPONSE_CONFIGURE, sel); |
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
811 | } |
|
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
812 | |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
813 | static gboolean |
|
33161
c248c062f272
Pass the cairo context to the tooltip paint function.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33158
diff
changeset
|
814 | pidgin_plugins_paint_tooltip(GtkWidget *tipwindow, cairo_t *cr, gpointer data) |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
815 | { |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
816 | PangoLayout *layout = g_object_get_data(G_OBJECT(tipwindow), "tooltip-plugin"); |
|
33271
53bf180b9eb1
Use GtkStyleContext instead of GtkStyle on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
817 | GtkStyleContext *context = gtk_widget_get_style_context(tipwindow); |
|
53bf180b9eb1
Use GtkStyleContext instead of GtkStyle on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
818 | gtk_style_context_add_class(context, GTK_STYLE_CLASS_TOOLTIP); |
|
53bf180b9eb1
Use GtkStyleContext instead of GtkStyle on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
819 | gtk_render_layout(context, cr, 6, 6, layout); |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
820 | return TRUE; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
821 | } |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
822 | |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
823 | static gboolean |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
824 | pidgin_plugins_create_tooltip(GtkWidget *tipwindow, GtkTreePath *path, |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
825 | gpointer data, int *w, int *h) |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
826 | { |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
827 | GtkTreeIter iter; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
828 | GtkTreeView *treeview = GTK_TREE_VIEW(data); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
829 | PurplePlugin *plugin = NULL; |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
830 | GPluginPluginInfo *info; |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
831 | GtkTreeModel *model = gtk_tree_view_get_model(treeview); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
832 | PangoLayout *layout; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
833 | int width, height; |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
834 | const char * const *authorlist; |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
835 | char *markup, *name, *desc; |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
836 | char *authors = NULL, *pauthors = NULL; |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
837 | |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
838 | if (!gtk_tree_model_get_iter(model, &iter, path)) |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
839 | return FALSE; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
840 | |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
841 | gtk_tree_model_get(model, &iter, 2, &plugin, -1); |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
842 | info = GPLUGIN_PLUGIN_INFO(purple_plugin_get_info(plugin)); |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
843 | authorlist = gplugin_plugin_info_get_authors(info); |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
844 | |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
845 | if (authorlist) |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
846 | authors = g_strjoinv(", ", (gchar **)authorlist); |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
847 | if (authors) |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
848 | pauthors = g_markup_escape_text(authors, -1); |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
849 | |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
850 | markup = g_strdup_printf( |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
851 | "<span size='x-large' weight='bold'>%s</span>\n<b>%s:</b> " |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
852 | "%s\n<b>%s:</b> %s", |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
853 | name = g_markup_escape_text(gplugin_plugin_info_get_name(info), |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
854 | -1), |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
855 | _("Description"), |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
856 | desc = g_markup_escape_text( |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
857 | gplugin_plugin_info_get_description(info), -1), |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
858 | (g_strv_length((gchar **)authorlist) > 1 ? _("Authors") |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
859 | : _("Author")), |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39407
diff
changeset
|
860 | pauthors); |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
861 | |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
862 | layout = gtk_widget_create_pango_layout(tipwindow, NULL); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
863 | pango_layout_set_markup(layout, markup, -1); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
864 | pango_layout_set_wrap(layout, PANGO_WRAP_WORD); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
865 | pango_layout_set_width(layout, 600000); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
866 | pango_layout_get_size(layout, &width, &height); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
867 | g_object_set_data_full(G_OBJECT(tipwindow), "tooltip-plugin", layout, g_object_unref); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
868 | |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
869 | if (w) |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
870 | *w = PANGO_PIXELS(width) + 12; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
871 | if (h) |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
872 | *h = PANGO_PIXELS(height) + 12; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
873 | |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
874 | g_free(markup); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
875 | g_free(name); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
876 | g_free(desc); |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
877 | g_free(pauthors); |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
878 | g_free(authors); |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
879 | |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
880 | return TRUE; |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
881 | } |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
882 | |
|
22788
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
883 | static gboolean |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
884 | website_button_motion_cb(GtkWidget *button, GdkEventCrossing *event, |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
885 | gpointer unused) |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
886 | { |
|
22788
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
887 | if (plugin_website_uri) { |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
888 | pidgin_set_cursor(button, GDK_HAND2); |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
889 | return TRUE; |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
890 | } |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
891 | return FALSE; |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
892 | } |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
893 | |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
894 | static gboolean |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
895 | website_button_clicked_cb(GtkButton *button, GdkEventButton *event, |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
896 | gpointer unused) |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
897 | { |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
898 | if (plugin_website_uri) { |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
899 | purple_notify_uri(NULL, plugin_website_uri); |
|
22788
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
900 | return TRUE; |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
901 | } |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
902 | return FALSE; |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
903 | } |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
904 | |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
905 | static GtkWidget * |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
906 | create_details() |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
907 | { |
|
35527
707c3c2b2c8a
Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35454
diff
changeset
|
908 | GtkBox *vbox = GTK_BOX(gtk_box_new(GTK_ORIENTATION_VERTICAL, 3)); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
909 | GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
910 | GtkWidget *label, *view, *website_button; |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
911 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
912 | plugin_name = GTK_LABEL(gtk_label_new(NULL)); |
|
38007
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
913 | gtk_label_set_xalign(plugin_name, 0); |
|
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
914 | gtk_label_set_yalign(plugin_name, 0); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
915 | gtk_label_set_line_wrap(plugin_name, FALSE); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
916 | gtk_label_set_selectable(plugin_name, TRUE); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
917 | gtk_box_pack_start(vbox, GTK_WIDGET(plugin_name), FALSE, FALSE, 0); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
918 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
919 | view = gtk_text_view_new(); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
920 | plugin_desc = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view)); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
921 | g_object_set(view, "wrap-mode", GTK_WRAP_WORD, |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
922 | "editable", FALSE, |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
923 | "left-margin", PIDGIN_HIG_CAT_SPACE, |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
924 | "right-margin", PIDGIN_HIG_CAT_SPACE, |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
925 | NULL); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
926 | gtk_box_pack_start(vbox, view, TRUE, TRUE, 0); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
927 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
928 | plugin_error = GTK_LABEL(gtk_label_new(NULL)); |
|
38007
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
929 | gtk_label_set_xalign(plugin_error, 0); |
|
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
930 | gtk_label_set_yalign(plugin_error, 0); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
931 | gtk_label_set_line_wrap(plugin_error, FALSE); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
932 | gtk_label_set_selectable(plugin_error, TRUE); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
933 | gtk_box_pack_start(vbox, GTK_WIDGET(plugin_error), FALSE, FALSE, 0); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
934 | |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
935 | plugin_authors = GTK_LABEL(gtk_label_new(NULL)); |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
936 | gtk_label_set_line_wrap(plugin_authors, FALSE); |
|
38007
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
937 | gtk_label_set_xalign(plugin_authors, 0); |
|
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
938 | gtk_label_set_yalign(plugin_authors, 0); |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
939 | gtk_label_set_selectable(plugin_authors, TRUE); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
940 | pidgin_add_widget_to_vbox(vbox, "", sg, |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
941 | GTK_WIDGET(plugin_authors), TRUE, &label); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
942 | gtk_label_set_markup(GTK_LABEL(label), _("<b>Written by:</b>")); |
|
38007
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
943 | gtk_label_set_xalign(GTK_LABEL(label), 0); |
|
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
944 | gtk_label_set_yalign(GTK_LABEL(label), 0); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
945 | |
|
22788
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
946 | website_button = gtk_event_box_new(); |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
947 | gtk_event_box_set_visible_window(GTK_EVENT_BOX(website_button), FALSE); |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
948 | |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
949 | plugin_website = GTK_LABEL(gtk_label_new(NULL)); |
|
22788
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
950 | g_object_set(G_OBJECT(plugin_website), |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
951 | "ellipsize", PANGO_ELLIPSIZE_MIDDLE, NULL); |
|
38007
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
952 | gtk_label_set_xalign(plugin_website, 0); |
|
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
953 | gtk_label_set_yalign(plugin_website, 0); |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
954 | gtk_container_add(GTK_CONTAINER(website_button), |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
955 | GTK_WIDGET(plugin_website)); |
|
22788
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
956 | g_signal_connect(website_button, "button-release-event", |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
957 | G_CALLBACK(website_button_clicked_cb), NULL); |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
958 | g_signal_connect(website_button, "enter-notify-event", |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
959 | G_CALLBACK(website_button_motion_cb), NULL); |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
960 | g_signal_connect(website_button, "leave-notify-event", |
|
113ae3a1f584
Use an event-box instead of a button for the link, and change the cursor
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22785
diff
changeset
|
961 | G_CALLBACK(pidgin_clear_cursor), NULL); |
|
22785
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
962 | |
|
d712839ebf36
Make plugin website URLs clickable; it's a button with blue underlined text.
Will Thompson <resiak@pidgin.im>
parents:
22781
diff
changeset
|
963 | pidgin_add_widget_to_vbox(vbox, "", sg, website_button, TRUE, &label); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
964 | gtk_label_set_markup(GTK_LABEL(label), _("<b>Web site:</b>")); |
|
38007
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
965 | gtk_label_set_xalign(GTK_LABEL(label), 0); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
966 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
967 | plugin_filename = GTK_LABEL(gtk_label_new(NULL)); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
968 | gtk_label_set_line_wrap(plugin_filename, FALSE); |
|
38007
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
969 | gtk_label_set_xalign(plugin_filename, 0); |
|
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
970 | gtk_label_set_yalign(plugin_filename, 0); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
971 | gtk_label_set_selectable(plugin_filename, TRUE); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
972 | pidgin_add_widget_to_vbox(vbox, "", sg, |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
973 | GTK_WIDGET(plugin_filename), TRUE, &label); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
974 | gtk_label_set_markup(GTK_LABEL(label), _("<b>Filename:</b>")); |
|
38007
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
975 | gtk_label_set_xalign(GTK_LABEL(label), 0); |
|
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
976 | gtk_label_set_yalign(GTK_LABEL(label), 0); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
977 | |
|
23180
5d6a0a35837f
applied changes from 97a20dd56598fa5c690eabcbc8ec3ff6e560aefd
Daniel Atallah <datallah@pidgin.im>
parents:
23100
diff
changeset
|
978 | g_object_unref(sg); |
|
5d6a0a35837f
applied changes from 97a20dd56598fa5c690eabcbc8ec3ff6e560aefd
Daniel Atallah <datallah@pidgin.im>
parents:
23100
diff
changeset
|
979 | |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
980 | return GTK_WIDGET(vbox); |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
981 | } |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
982 | |
|
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
983 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
984 | void pidgin_plugin_dialog_show() |
| 11740 | 985 | { |
| 986 | GtkWidget *event_view; | |
| 987 | GtkListStore *ls; | |
| 988 | GtkCellRenderer *rend, *rendt; | |
| 989 | GtkTreeViewColumn *col; | |
| 990 | GtkTreeSelection *sel; | |
| 991 | ||
| 992 | if (plugin_dialog != NULL) { | |
| 993 | gtk_window_present(GTK_WINDOW(plugin_dialog)); | |
| 994 | return; | |
| 995 | } | |
| 996 | ||
|
33168
f51e53d27b99
Fix a minor warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33161
diff
changeset
|
997 | plugin_dialog = gtk_dialog_new(); |
|
f51e53d27b99
Fix a minor warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33161
diff
changeset
|
998 | gtk_window_set_title(GTK_WINDOW(plugin_dialog), _("Plugins")); |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
999 | pref_button = gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
1000 | _("Configure Pl_ugin"), PIDGIN_RESPONSE_CONFIGURE); |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
1001 | gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), |
|
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
1002 | GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); |
| 11813 | 1003 | gtk_widget_set_sensitive(pref_button, FALSE); |
| 11747 | 1004 | gtk_window_set_role(GTK_WINDOW(plugin_dialog), "plugins"); |
| 11740 | 1005 | |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
1006 | ls = gtk_list_store_new(4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN); |
| 11740 | 1007 | gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), |
| 1008 | 1, GTK_SORT_ASCENDING); | |
| 1009 | ||
| 1010 | update_plugin_list(ls); | |
| 11813 | 1011 | |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
1012 | event_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(ls)); |
| 11740 | 1013 | |
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
1014 | g_signal_connect(G_OBJECT(event_view), "row-activated", |
|
13718
f29249a2856c
[gaim-migrate @ 16125]
Richard Laager <rlaager@pidgin.im>
parents:
13436
diff
changeset
|
1015 | G_CALLBACK(show_plugin_prefs_cb), plugin_dialog); |
|
12162
449845a545ab
[gaim-migrate @ 14463]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12066
diff
changeset
|
1016 | |
| 15884 | 1017 | purple_signal_connect(purple_plugins_get_handle(), "plugin-load", plugin_dialog, |
| 1018 | PURPLE_CALLBACK(plugin_load_cb), event_view); | |
| 1019 | purple_signal_connect(purple_plugins_get_handle(), "plugin-unload", plugin_dialog, | |
| 1020 | PURPLE_CALLBACK(plugin_unload_cb), event_view); | |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
1021 | |
| 11740 | 1022 | rend = gtk_cell_renderer_toggle_new(); |
| 1023 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
| 1024 | ||
| 1025 | col = gtk_tree_view_column_new_with_attributes (_("Enabled"), | |
| 1026 | rend, | |
| 1027 | "active", 0, | |
| 1028 | NULL); | |
| 1029 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
|
11794
6c39942d27a9
[gaim-migrate @ 14085]
Gary Kramlich <grim@reaperworld.com>
parents:
11783
diff
changeset
|
1030 | gtk_tree_view_column_set_sort_column_id(col, 0); |
|
12927
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
1031 | g_signal_connect(G_OBJECT(rend), "toggled", |
|
f3e4ef8958a3
[gaim-migrate @ 15280]
Richard Laager <rlaager@pidgin.im>
parents:
12889
diff
changeset
|
1032 | G_CALLBACK(plugin_toggled), ls); |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
1033 | |
| 11740 | 1034 | rendt = gtk_cell_renderer_text_new(); |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
1035 | g_object_set(rendt, |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
1036 | "foreground", "#c0c0c0", |
|
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
1037 | NULL); |
| 11740 | 1038 | col = gtk_tree_view_column_new_with_attributes (_("Name"), |
| 1039 | rendt, | |
| 1040 | "markup", 1, | |
|
12695
0c93a42b7ee2
[gaim-migrate @ 15038]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
1041 | "foreground-set", 3, |
| 11740 | 1042 | NULL); |
| 1043 | gtk_tree_view_column_set_expand (col, TRUE); | |
| 1044 | g_object_set(rendt, "ellipsize", PANGO_ELLIPSIZE_END, NULL); | |
| 1045 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
|
11794
6c39942d27a9
[gaim-migrate @ 14085]
Gary Kramlich <grim@reaperworld.com>
parents:
11783
diff
changeset
|
1046 | gtk_tree_view_column_set_sort_column_id(col, 1); |
| 11740 | 1047 | g_object_unref(G_OBJECT(ls)); |
|
33158
ad941796372e
Remove some added trailing spaces.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33133
diff
changeset
|
1048 | gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(plugin_dialog))), |
|
36210
115560993ff5
Make the plugin preferences frame scrollable
Daniel Atallah <datallah@pidgin.im>
parents:
31321
diff
changeset
|
1049 | pidgin_make_scrollable(event_view, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, -1), |
|
31321
1fef3832cfa2
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30785
diff
changeset
|
1050 | TRUE, TRUE, 0); |
|
15177
8b6c66e09388
[gaim-migrate @ 17901]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14359
diff
changeset
|
1051 | gtk_tree_view_set_search_column(GTK_TREE_VIEW(event_view), 1); |
|
8b6c66e09388
[gaim-migrate @ 17901]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14359
diff
changeset
|
1052 | gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(event_view), |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1053 | pidgin_tree_view_search_equal_func, NULL, NULL); |
|
12246
7af1ef3b1cc4
[gaim-migrate @ 14548]
Mark Doliner <markdoliner@pidgin.im>
parents:
12240
diff
changeset
|
1054 | |
|
22065
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
1055 | pidgin_tooltip_setup_for_treeview(event_view, event_view, |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
1056 | pidgin_plugins_create_tooltip, |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
1057 | pidgin_plugins_paint_tooltip); |
|
4bfdea9613d1
Add tooltips to the plugin window. I did it mostly to test the new tooltip
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21352
diff
changeset
|
1058 | |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
1059 | |
| 11740 | 1060 | expander = gtk_expander_new(_("<b>Plugin Details</b>")); |
| 1061 | gtk_expander_set_use_markup(GTK_EXPANDER(expander), TRUE); | |
|
12343
0ede7c5a9465
[gaim-migrate @ 14647]
Mark Doliner <markdoliner@pidgin.im>
parents:
12290
diff
changeset
|
1062 | gtk_widget_set_sensitive(expander, FALSE); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
1063 | gtk_container_add(GTK_CONTAINER(expander), create_details()); |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32438
diff
changeset
|
1064 | gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(plugin_dialog))), |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33168
diff
changeset
|
1065 | expander, FALSE, FALSE, 0); |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
1066 | |
| 11740 | 1067 | |
| 1068 | g_signal_connect (G_OBJECT (sel), "changed", G_CALLBACK (prefs_plugin_sel), NULL); | |
| 1069 | g_signal_connect(G_OBJECT(plugin_dialog), "response", G_CALLBACK(plugin_dialog_response_cb), sel); | |
|
22781
c85c7a3609dc
Improve the layout of the plugin description pane.
Will Thompson <resiak@pidgin.im>
parents:
22608
diff
changeset
|
1070 | gtk_window_set_default_size(GTK_WINDOW(plugin_dialog), 430, 530); |
|
30760
7b0121a454cd
Auto-parent the Plugins dialog.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29500
diff
changeset
|
1071 | |
|
30785
9c4ea3886ce5
Remove an unnecessary cast. Get's rid of this compile warning:
Mark Doliner <markdoliner@pidgin.im>
parents:
30760
diff
changeset
|
1072 | pidgin_auto_parent_window(plugin_dialog); |
|
30760
7b0121a454cd
Auto-parent the Plugins dialog.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29500
diff
changeset
|
1073 | |
| 11740 | 1074 | gtk_widget_show_all(plugin_dialog); |
| 1075 | } |