Mercurial > pidgin.yaz
annotate src/gtkpluginpref.c @ 14069:d594f0466585
[gaim-migrate @ 16690]
Fix CID 221
I also fixed an imperial ton of leaks. It was quite amazing, actually.
There is also some other cleanup stuff in here too.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 10 Aug 2006 23:42:17 +0000 |
parents | 8bda65b88e49 |
children |
rev | line source |
---|---|
8713 | 1 /** |
10297 | 2 * @file gtkpluginpref.c GTK+ Plugin preferences |
3 * @ingroup gtkui | |
4 * | |
8713 | 5 * gaim |
6 * | |
7 * Gaim is the legal property of its developers, whose names are too numerous | |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
10 * | |
11 * This program is free software; you can redistribute it and/or modify | |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
25 #ifdef HAVE_CONFIG_H | |
26 # include <config.h> | |
27 #endif | |
28 | |
29 #include "debug.h" | |
30 #include "internal.h" | |
31 #include "pluginpref.h" | |
32 #include "prefs.h" | |
33 | |
12712
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
34 #include "gtkimhtml.h" |
8713 | 35 #include "gtkpluginpref.h" |
36 #include "gtkprefs.h" | |
37 #include "gtkutils.h" | |
38 | |
39 static gboolean | |
40 entry_cb(GtkWidget *entry, gpointer data) { | |
41 char *pref = data; | |
42 | |
43 gaim_prefs_set_string(pref, gtk_entry_get_text(GTK_ENTRY(entry))); | |
44 | |
45 return FALSE; | |
46 } | |
47 | |
12712
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
48 |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
49 static void |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
50 imhtml_cb(GtkTextBuffer *buffer, gpointer data) |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
51 { |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
52 char *pref; |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
53 char *text; |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
54 GtkIMHtml *imhtml = data; |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
55 |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
56 pref = g_object_get_data(G_OBJECT(imhtml), "pref-key"); |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
57 g_return_if_fail(pref); |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
58 |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
59 text = gtk_imhtml_get_markup(imhtml); |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
60 gaim_prefs_set_string(pref, text); |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
61 g_free(text); |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
62 } |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
63 |
8713 | 64 static void |
12794
4e3dde2b2641
[gaim-migrate @ 15141]
Richard Laager <rlaager@wiktel.com>
parents:
12712
diff
changeset
|
65 imhtml_format_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, gpointer data) |
4e3dde2b2641
[gaim-migrate @ 15141]
Richard Laager <rlaager@wiktel.com>
parents:
12712
diff
changeset
|
66 { |
4e3dde2b2641
[gaim-migrate @ 15141]
Richard Laager <rlaager@wiktel.com>
parents:
12712
diff
changeset
|
67 imhtml_cb(gtk_text_view_get_buffer(GTK_TEXT_VIEW(imhtml)), data); |
4e3dde2b2641
[gaim-migrate @ 15141]
Richard Laager <rlaager@wiktel.com>
parents:
12712
diff
changeset
|
68 } |
4e3dde2b2641
[gaim-migrate @ 15141]
Richard Laager <rlaager@wiktel.com>
parents:
12712
diff
changeset
|
69 |
4e3dde2b2641
[gaim-migrate @ 15141]
Richard Laager <rlaager@wiktel.com>
parents:
12712
diff
changeset
|
70 static void |
8713 | 71 make_string_pref(GtkWidget *parent, GaimPluginPref *pref, GtkSizeGroup *sg) { |
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
72 GtkWidget *box, *gtk_label, *entry; |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
73 const gchar *pref_name; |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
74 const gchar *pref_label; |
12712
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
75 GaimStringFormatType format; |
8713 | 76 |
77 pref_name = gaim_plugin_pref_get_name(pref); | |
78 pref_label = gaim_plugin_pref_get_label(pref); | |
12712
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
79 format = gaim_plugin_pref_get_format_type(pref); |
8713 | 80 |
81 switch(gaim_plugin_pref_get_type(pref)) { | |
82 case GAIM_PLUGIN_PREF_CHOICE: | |
83 gtk_label = gaim_gtk_prefs_dropdown_from_list(parent, pref_label, | |
84 GAIM_PREF_STRING, pref_name, | |
10414 | 85 gaim_plugin_pref_get_choices(pref)); |
8713 | 86 gtk_misc_set_alignment(GTK_MISC(gtk_label), 0, 0.5); |
87 | |
88 if(sg) | |
89 gtk_size_group_add_widget(sg, gtk_label); | |
90 | |
91 break; | |
92 case GAIM_PLUGIN_PREF_NONE: | |
93 default: | |
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
94 if (format == GAIM_STRING_FORMAT_TYPE_NONE) |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
95 box = gtk_hbox_new(FALSE, GAIM_HIG_BOX_SPACE); |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
96 else |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
97 box = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE); |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
98 |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
99 gtk_widget_show(box); |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
100 gtk_box_pack_start(GTK_BOX(parent), box, FALSE, FALSE, 0); |
8713 | 101 |
102 gtk_label = gtk_label_new_with_mnemonic(pref_label); | |
103 gtk_misc_set_alignment(GTK_MISC(gtk_label), 0, 0.5); | |
104 gtk_widget_show(gtk_label); | |
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
105 gtk_box_pack_start(GTK_BOX(box), gtk_label, FALSE, FALSE, 0); |
8713 | 106 |
107 if(sg) | |
108 gtk_size_group_add_widget(sg, gtk_label); | |
109 | |
12712
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
110 if (format == GAIM_STRING_FORMAT_TYPE_NONE) |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
111 { |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
112 entry = gtk_entry_new(); |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
113 gtk_entry_set_text(GTK_ENTRY(entry), gaim_prefs_get_string(pref_name)); |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
114 gtk_entry_set_max_length(GTK_ENTRY(entry), |
8713 | 115 gaim_plugin_pref_get_max_length(pref)); |
12712
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
116 if (gaim_plugin_pref_get_masked(pref)) |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
117 { |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
118 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
119 gtk_entry_set_invisible_char(GTK_ENTRY(entry), GAIM_INVISIBLE_CHAR); |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
120 } |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
121 g_signal_connect(G_OBJECT(entry), "changed", |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
122 G_CALLBACK(entry_cb), |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
123 (gpointer)pref_name); |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
124 gtk_label_set_mnemonic_widget(GTK_LABEL(gtk_label), entry); |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
125 gtk_widget_show(entry); |
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
126 gtk_box_pack_start(GTK_BOX(box), entry, FALSE, FALSE, 0); |
12712
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
127 } |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
128 else |
11986 | 129 { |
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
130 GtkWidget *hbox; |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
131 GtkWidget *spacer; |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
132 GtkWidget *imhtml; |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
133 GtkWidget *toolbar; |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
134 GtkWidget *frame; |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
135 |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
136 hbox = gtk_hbox_new(FALSE, GAIM_HIG_BOX_SPACE); |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
137 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
138 gtk_widget_show(hbox); |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
139 |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
140 spacer = gtk_label_new(" "); |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
141 gtk_box_pack_start(GTK_BOX(hbox), spacer, FALSE, FALSE, 0); |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
142 gtk_widget_show(spacer); |
12712
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
143 |
13280
3de53fe8345f
[gaim-migrate @ 15646]
Richard Laager <rlaager@wiktel.com>
parents:
13106
diff
changeset
|
144 frame = gaim_gtk_create_imhtml(TRUE, &imhtml, &toolbar, NULL); |
12712
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
145 if (!(format & GAIM_STRING_FORMAT_TYPE_HTML)) |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
146 gtk_widget_destroy(toolbar); |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
147 |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
148 gtk_imhtml_append_text(GTK_IMHTML(imhtml), gaim_prefs_get_string(pref_name), |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
149 (format & GAIM_STRING_FORMAT_TYPE_MULTILINE) ? 0 : GTK_IMHTML_NO_NEWLINE); |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
150 gtk_label_set_mnemonic_widget(GTK_LABEL(gtk_label), imhtml); |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
151 gtk_widget_show_all(frame); |
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
152 g_object_set_data(G_OBJECT(imhtml), "pref-key", (gpointer)pref_name); |
12712
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
153 g_signal_connect(G_OBJECT(gtk_text_view_get_buffer(GTK_TEXT_VIEW(imhtml))), |
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
154 "changed", G_CALLBACK(imhtml_cb), imhtml); |
12794
4e3dde2b2641
[gaim-migrate @ 15141]
Richard Laager <rlaager@wiktel.com>
parents:
12712
diff
changeset
|
155 g_signal_connect(G_OBJECT(imhtml), |
4e3dde2b2641
[gaim-migrate @ 15141]
Richard Laager <rlaager@wiktel.com>
parents:
12712
diff
changeset
|
156 "format_function_toggle", G_CALLBACK(imhtml_format_cb), imhtml); |
12712
8ae981f2c9cb
[gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents:
11986
diff
changeset
|
157 gtk_box_pack_start(GTK_BOX(hbox), frame, FALSE, FALSE, 0); |
11986 | 158 } |
8713 | 159 |
160 break; | |
161 } | |
162 } | |
163 | |
164 static void | |
165 make_int_pref(GtkWidget *parent, GaimPluginPref *pref, GtkSizeGroup *sg) { | |
166 GtkWidget *gtk_label; | |
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
167 const gchar *pref_name; |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
168 const gchar *pref_label; |
8713 | 169 gint max, min; |
170 | |
171 pref_name = gaim_plugin_pref_get_name(pref); | |
172 pref_label = gaim_plugin_pref_get_label(pref); | |
173 | |
174 switch(gaim_plugin_pref_get_type(pref)) { | |
175 case GAIM_PLUGIN_PREF_CHOICE: | |
176 gtk_label = gaim_gtk_prefs_dropdown_from_list(parent, pref_label, | |
9529 | 177 GAIM_PREF_INT, pref_name, gaim_plugin_pref_get_choices(pref)); |
8713 | 178 gtk_misc_set_alignment(GTK_MISC(gtk_label), 0, 0.5); |
179 | |
180 if(sg) | |
181 gtk_size_group_add_widget(sg, gtk_label); | |
182 | |
183 break; | |
184 case GAIM_PLUGIN_PREF_NONE: | |
185 default: | |
186 gaim_plugin_pref_get_bounds(pref, &min, &max); | |
10414 | 187 gaim_gtk_prefs_labeled_spin_button(parent, pref_label, |
9529 | 188 pref_name, min, max, sg); |
8713 | 189 break; |
190 } | |
191 } | |
192 | |
9529 | 193 |
194 static void | |
195 make_info_pref(GtkWidget *parent, GaimPluginPref *pref) { | |
196 GtkWidget *gtk_label = gtk_label_new(gaim_plugin_pref_get_label(pref)); | |
197 gtk_misc_set_alignment(GTK_MISC(gtk_label), 0, 0); | |
198 gtk_label_set_line_wrap(GTK_LABEL(gtk_label), TRUE); | |
199 gtk_box_pack_start(GTK_BOX(parent), gtk_label, FALSE, FALSE, 0); | |
200 gtk_widget_show(gtk_label); | |
201 } | |
202 | |
203 | |
8713 | 204 GtkWidget * |
205 gaim_gtk_plugin_pref_create_frame(GaimPluginPrefFrame *frame) { | |
206 GtkWidget *ret, *parent; | |
207 GtkSizeGroup *sg; | |
208 GList *pp; | |
209 | |
210 g_return_val_if_fail(frame, NULL); | |
211 | |
212 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
213 | |
214 parent = ret = gtk_vbox_new(FALSE, 16); | |
11243 | 215 gtk_container_set_border_width(GTK_CONTAINER(ret), GAIM_HIG_BORDER); |
8713 | 216 gtk_widget_show(ret); |
217 | |
218 for(pp = gaim_plugin_pref_frame_get_prefs(frame); | |
219 pp != NULL; | |
220 pp = pp->next) | |
221 { | |
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
222 GaimPluginPref *pref = (GaimPluginPref *)pp->data; |
8713 | 223 |
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
224 const char *name = gaim_plugin_pref_get_name(pref); |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12794
diff
changeset
|
225 const char *label = gaim_plugin_pref_get_label(pref); |
8713 | 226 |
227 if(name == NULL) { | |
228 if(label == NULL) | |
229 continue; | |
9529 | 230 |
231 if(gaim_plugin_pref_get_type(pref) == GAIM_PLUGIN_PREF_INFO) { | |
232 make_info_pref(parent, pref); | |
233 } else { | |
234 parent = gaim_gtk_make_frame(ret, label); | |
235 gtk_widget_show(parent); | |
236 } | |
8713 | 237 |
238 continue; | |
239 } | |
240 | |
241 switch(gaim_prefs_get_type(name)) { | |
242 case GAIM_PREF_BOOLEAN: | |
243 gaim_gtk_prefs_checkbox(label, name, parent); | |
244 break; | |
245 case GAIM_PREF_INT: | |
246 make_int_pref(parent, pref, sg); | |
247 break; | |
248 case GAIM_PREF_STRING: | |
249 make_string_pref(parent, pref, sg); | |
250 break; | |
251 default: | |
252 break; | |
253 } | |
254 } | |
255 | |
256 return ret; | |
257 } |