Mercurial > pidgin
annotate src/prefs.c @ 4300:b191b8080ebc
[gaim-migrate @ 4554]
This should fix building on Win32
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 11 Jan 2003 20:57:18 +0000 |
parents | cddb50734169 |
children | bc125db09cd0 |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
3434 | 4 * Copyright (C) 1998-2002, Mark Spencer <markster@marko.net> |
1 | 5 * |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2074
diff
changeset
|
23 #include <config.h> |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
24 #endif |
1 | 25 #include <string.h> |
26 #include <sys/time.h> | |
27 | |
28 #include <sys/types.h> | |
29 #include <sys/stat.h> | |
30 | |
31 #include <unistd.h> | |
32 #include <stdio.h> | |
33 #include <stdlib.h> | |
970 | 34 #include <stdarg.h> |
3379 | 35 #include <ctype.h> |
1 | 36 #include <gtk/gtk.h> |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
37 #include "gtkimhtml.h" |
1 | 38 #include "gaim.h" |
1357
783ba886b6b6
[gaim-migrate @ 1367]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1324
diff
changeset
|
39 #include "prpl.h" |
3366 | 40 #include "proxy.h" |
41 | |
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
42 #ifdef _WIN32 |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
43 #include "win32dep.h" |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
44 #endif |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
45 |
3567 | 46 GtkWidget *tree_v = NULL; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
47 GtkWidget *prefs_away_list = NULL; |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
48 GtkWidget *prefs_away_menu = NULL; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
49 GtkWidget *preftree = NULL; |
3366 | 50 GtkWidget *fontseld = NULL; |
51 | |
3379 | 52 GtkListStore *prefs_away_store = NULL; |
3366 | 53 |
54 static int sound_row_sel = 0; | |
55 static char *last_sound_dir = NULL; | |
56 | |
57 static GtkWidget *sounddialog = NULL; | |
58 static GtkWidget *browser_entry = NULL; | |
59 static GtkWidget *sound_entry = NULL; | |
60 static GtkWidget *away_text = NULL; | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
61 GtkCTreeNode *general_node = NULL; |
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
62 GtkCTreeNode *deny_node = NULL; |
2254 | 63 GtkWidget *prefs_proxy_frame = NULL; |
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
64 GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); |
3427 | 65 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int, GtkSizeGroup *); |
3366 | 66 static GtkWidget *gaim_dropdown(GtkWidget *, const gchar *, int *, int, ...); |
67 static GtkWidget *show_color_pref(GtkWidget *, gboolean); | |
68 static void delete_prefs(GtkWidget *, void *); | |
69 void set_default_away(GtkWidget *, gpointer); | |
1026 | 70 |
3366 | 71 struct debug_window *dw = NULL; |
3565 | 72 GtkWidget *prefs = NULL; |
3366 | 73 GtkWidget *debugbutton = NULL; |
3565 | 74 static int notebook_page = 0; |
75 static GtkTreeIter plugin_iter; | |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
76 |
3630 | 77 /* |
78 * PROTOTYPES | |
79 */ | |
80 GtkTreeIter *prefs_notebook_add_page(char*, GdkPixbuf*, GtkWidget*, GtkTreeIter*, GtkTreeIter*, int); | |
81 | |
3366 | 82 void delete_prefs(GtkWidget *asdf, void *gdsa) { |
4215 | 83 GList *l = plugins; |
84 struct gaim_plugin *plug; | |
85 | |
4064 | 86 save_prefs(); |
3485 | 87 prefs = NULL; |
3567 | 88 tree_v = NULL; |
3485 | 89 sound_entry = NULL; |
90 browser_entry = NULL; | |
3526 | 91 debugbutton = NULL; |
92 prefs_away_menu = NULL; | |
3565 | 93 notebook_page = 0; |
3485 | 94 if(sounddialog) |
3379 | 95 gtk_widget_destroy(sounddialog); |
3500 | 96 g_object_unref(G_OBJECT(prefs_away_store)); |
4215 | 97 while(l) { |
98 plug = l->data; | |
99 if(plug->iter) { | |
100 g_free(plug->iter); | |
101 plug->iter = NULL; | |
102 } | |
103 l = l->next; | |
104 } | |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
105 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
106 |
3366 | 107 GtkWidget *preflabel; |
108 GtkWidget *prefsnotebook; | |
109 GtkTreeStore *prefstree; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
110 |
3818 | 111 static void set_misc_option(); |
112 static void set_logging_option(); | |
113 static void set_blist_option(); | |
114 static void set_convo_option(); | |
115 static void set_im_option(); | |
116 static void set_chat_option(); | |
117 static void set_font_option(); | |
118 static void set_sound_option(); | |
119 static void set_away_option(); | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
120 |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
121 #define PROXYHOST 0 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
122 #define PROXYPORT 1 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
123 #define PROXYTYPE 2 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
124 #define PROXYUSER 3 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
125 #define PROXYPASS 4 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
126 static void proxy_print_option(GtkEntry *entry, int entrynum) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
127 { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
128 if (entrynum == PROXYHOST) |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
129 g_snprintf(proxyhost, sizeof(proxyhost), "%s", gtk_entry_get_text(entry)); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
130 else if (entrynum == PROXYPORT) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
131 proxyport = atoi(gtk_entry_get_text(entry)); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
132 else if (entrynum == PROXYUSER) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
133 g_snprintf(proxyuser, sizeof(proxyuser), "%s", gtk_entry_get_text(entry)); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
134 else if (entrynum == PROXYPASS) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
135 g_snprintf(proxypass, sizeof(proxypass), "%s", gtk_entry_get_text(entry)); |
4137 | 136 proxy_info_is_from_gaimrc = 1; /* If the user specifies it, we want |
137 to save it */ | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
138 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
139 |
3366 | 140 |
3565 | 141 GtkWidget *make_frame(GtkWidget *ret, char *text) { |
3427 | 142 GtkWidget *vbox, *label, *hbox; |
143 char labeltext[256]; | |
3500 | 144 |
3427 | 145 vbox = gtk_vbox_new(FALSE, 6); |
146 gtk_box_pack_start(GTK_BOX(ret), vbox, FALSE, FALSE, 0); | |
147 label = gtk_label_new(NULL); | |
148 g_snprintf(labeltext, sizeof(labeltext), "<span weight=\"bold\">%s</span>", text); | |
149 gtk_label_set_markup(GTK_LABEL(label), labeltext); | |
150 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
151 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
152 hbox = gtk_hbox_new(FALSE, 6); | |
153 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); | |
154 label = gtk_label_new(" "); | |
155 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
156 vbox = gtk_vbox_new(FALSE, 6); | |
157 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); | |
158 return vbox; | |
159 } | |
160 | |
3366 | 161 /* OK, Apply and Cancel */ |
162 | |
3427 | 163 |
3366 | 164 static void pref_nb_select(GtkTreeSelection *sel, GtkNotebook *nb) { |
165 GtkTreeIter iter; | |
3427 | 166 char text[128]; |
3366 | 167 GValue val = { 0, }; |
168 GtkTreeModel *model = GTK_TREE_MODEL(prefstree); | |
3500 | 169 |
3366 | 170 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
171 return; | |
172 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3500 | 173 g_snprintf(text, sizeof(text), "<span weight=\"bold\" size=\"larger\">%s</span>", |
3427 | 174 g_value_get_string(&val)); |
175 gtk_label_set_markup (GTK_LABEL(preflabel), text); | |
3366 | 176 g_value_unset (&val); |
177 gtk_tree_model_get_value (model, &iter, 2, &val); | |
178 gtk_notebook_set_current_page (GTK_NOTEBOOK (prefsnotebook), g_value_get_int (&val)); | |
179 | |
180 } | |
181 | |
182 /* These are the pages in the preferences notebook */ | |
183 GtkWidget *interface_page() { | |
184 GtkWidget *ret; | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
185 GtkWidget *vbox; |
3427 | 186 ret = gtk_vbox_new(FALSE, 18); |
187 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 188 |
3427 | 189 vbox = make_frame(ret, _("Interface Options")); |
190 /* This shouldn't have to wait for user to click OK or APPLY or whatnot */ | |
191 /* This really shouldn't be in preferences at all */ | |
4045 | 192 debugbutton = gaim_button(_("Show _debug window"), &misc_options, OPT_MISC_DEBUG, vbox); |
3500 | 193 |
4227 | 194 gaim_button(_("D_isplay remote nicknames if no alias is set"), &misc_options, OPT_MISC_USE_SERVER_ALIAS, vbox); |
195 | |
3366 | 196 |
3427 | 197 gtk_widget_show_all(ret); |
3366 | 198 return ret; |
199 } | |
200 | |
4288 | 201 static void smiley_sel (GtkTreeSelection *sel, GtkTreeModel *model) { |
202 GtkTreeIter iter; | |
4298 | 203 const char *filename; |
4288 | 204 GValue val = { 0, }; |
205 | |
206 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
207 return; | |
208 gtk_tree_model_get_value (model, &iter, 2, &val); | |
209 filename = g_value_get_string(&val); | |
210 load_smiley_theme(filename, TRUE); | |
211 g_value_unset (&val); | |
212 } | |
213 | |
214 GtkWidget *theme_page() { | |
215 GtkWidget *ret; | |
216 GtkWidget *sw; | |
217 GSList *themes = smiley_themes; | |
218 GtkTreeIter iter; | |
219 GtkWidget *view; | |
220 GtkCellRenderer *rend; | |
221 GtkTreeViewColumn *col; | |
222 GtkTreeSelection *sel; | |
4290 | 223 GtkTreePath *path = NULL; |
4288 | 224 GtkListStore *store; |
225 GdkPixbuf *pixbuf; | |
226 int ind =0; | |
227 | |
228 ret = gtk_vbox_new(FALSE, 18); | |
229 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
230 | |
231 sw = gtk_scrolled_window_new(NULL,NULL); | |
232 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
233 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
234 | |
235 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
236 store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
237 while (themes) { | |
238 struct smiley_theme *theme = themes->data; | |
239 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" | |
240 "<span size='smaller' foreground='gray'>%s</span>", | |
241 theme->name, theme->author, theme->desc);; | |
242 gtk_list_store_append (store, &iter); | |
243 pixbuf = gdk_pixbuf_new_from_file(theme->icon, NULL); | |
244 | |
245 gtk_list_store_set(store, &iter, | |
246 0, pixbuf, | |
247 1, description, | |
248 2, theme->path, | |
249 -1); | |
250 g_free(description); | |
251 themes = themes->next; | |
252 if (current_smiley_theme && !strcmp(theme->path, current_smiley_theme->path)) { | |
253 /* path = gtk_tree_path_new_from_indices(ind); */ | |
254 char *iwishihadgtk2_2 = g_strdup_printf("%d", ind); | |
255 path = gtk_tree_path_new_from_string(iwishihadgtk2_2); | |
256 g_free(iwishihadgtk2_2); | |
257 } | |
258 ind++; | |
259 } | |
260 | |
261 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(store)); | |
262 | |
263 rend = gtk_cell_renderer_pixbuf_new(); | |
264 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); | |
265 | |
266 gtk_tree_selection_select_path(sel, path); | |
267 gtk_tree_path_free(path); | |
268 | |
269 col = gtk_tree_view_column_new_with_attributes ("Icon", | |
270 rend, | |
271 "pixbuf", 0, | |
272 NULL); | |
273 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
274 | |
275 rend = gtk_cell_renderer_text_new(); | |
276 col = gtk_tree_view_column_new_with_attributes ("Description", | |
277 rend, | |
278 "markup", 1, | |
279 NULL); | |
280 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
281 g_object_unref(G_OBJECT(store)); | |
282 gtk_container_add(GTK_CONTAINER(sw), view); | |
283 | |
284 g_signal_connect (G_OBJECT (sel), "changed", | |
285 G_CALLBACK (smiley_sel), | |
286 NULL); | |
287 | |
288 | |
289 gtk_widget_show_all(ret); | |
290 return ret; | |
291 } | |
292 | |
3366 | 293 GtkWidget *font_page() { |
294 GtkWidget *ret; | |
295 GtkWidget *button; | |
296 GtkWidget *vbox, *hbox; | |
297 GtkWidget *select = NULL; | |
3427 | 298 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
3500 | 299 |
3427 | 300 ret = gtk_vbox_new(FALSE, 18); |
301 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3500 | 302 |
3427 | 303 vbox = make_frame(ret, _("Style")); |
3818 | 304 gaim_button(_("_Bold"), &font_options, OPT_FONT_BOLD, vbox); |
305 gaim_button(_("_Italics"), &font_options, OPT_FONT_ITALIC, vbox); | |
306 gaim_button(_("_Underline"), &font_options, OPT_FONT_UNDERLINE, vbox); | |
307 gaim_button(_("_Strikethough"), &font_options, OPT_FONT_STRIKE, vbox); | |
3500 | 308 |
3427 | 309 vbox = make_frame(ret, _("Face")); |
310 hbox = gtk_hbox_new(FALSE, 6); | |
311 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3818 | 312 button = gaim_button(_("Use custo_m face"), &font_options, OPT_FONT_FACE, hbox); |
3427 | 313 gtk_size_group_add_widget(sg, button); |
314 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); | |
3366 | 315 |
3818 | 316 if (!(font_options & OPT_FONT_FACE)) |
3366 | 317 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
318 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
319 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_font_dialog), NULL); |
3366 | 320 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); |
321 | |
322 hbox = gtk_hbox_new(FALSE, 5); | |
323 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3818 | 324 button = gaim_button(_("Use custom si_ze"), &font_options, OPT_FONT_SIZE, hbox); |
3427 | 325 gtk_size_group_add_widget(sg, button); |
3818 | 326 select = gaim_labeled_spin_button(hbox, NULL, &fontsize, 1, 7, NULL); |
327 if (!(font_options & OPT_FONT_SIZE)) | |
3366 | 328 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
329 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); |
3366 | 330 |
3500 | 331 vbox = make_frame(ret, _("Color")); |
3366 | 332 hbox = gtk_hbox_new(FALSE, 5); |
333 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 334 |
335 | |
3818 | 336 button = gaim_button(_("_Text color"), &font_options, OPT_FONT_FGCOL, hbox); |
3427 | 337 gtk_size_group_add_widget(sg, button); |
338 | |
339 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
340 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
3366 | 341 pref_fg_picture = show_color_pref(hbox, TRUE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
342 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), |
3366 | 343 pref_fg_picture); |
3427 | 344 |
3818 | 345 if (!(font_options & OPT_FONT_FGCOL)) |
3366 | 346 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
347 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
348 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_fgcolor_dialog), NULL); |
3366 | 349 hbox = gtk_hbox_new(FALSE, 5); |
350 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 351 |
3818 | 352 button = gaim_button(_("Bac_kground color"), &font_options, OPT_FONT_BGCOL, hbox); |
3427 | 353 gtk_size_group_add_widget(sg, button); |
354 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
355 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
3366 | 356 pref_bg_picture = show_color_pref(hbox, FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
357 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), |
3366 | 358 pref_bg_picture); |
3472 | 359 |
3818 | 360 if (!(font_options & OPT_FONT_BGCOL)) |
3366 | 361 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
362 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_bgcolor_dialog), NULL); |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
363 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); |
3366 | 364 |
3427 | 365 gtk_widget_show_all(ret); |
3366 | 366 return ret; |
367 } | |
368 | |
369 | |
370 GtkWidget *messages_page() { | |
371 GtkWidget *ret; | |
372 GtkWidget *vbox; | |
3427 | 373 ret = gtk_vbox_new(FALSE, 18); |
374 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 375 |
3427 | 376 vbox = make_frame (ret, _("Display")); |
3818 | 377 gaim_button(_("Show graphical _smileys"), &convo_options, OPT_CONVO_SHOW_SMILEY, vbox); |
378 gaim_button(_("Show _timestamp on messages"), &convo_options, OPT_CONVO_SHOW_TIME, vbox); | |
379 gaim_button(_("Show _URLs as links"), &convo_options, OPT_CONVO_SEND_LINKS, vbox); | |
3803 | 380 #ifdef USE_GTKSPELL |
3818 | 381 gaim_button(_("_Highlight misspelled words"), &convo_options, OPT_CONVO_CHECK_SPELLING, vbox); |
3803 | 382 #endif |
3427 | 383 vbox = make_frame (ret, _("Ignore")); |
3818 | 384 gaim_button(_("Ignore c_olors"), &convo_options, OPT_CONVO_IGNORE_COLOUR, vbox); |
385 gaim_button(_("Ignore font _faces"), &convo_options, OPT_CONVO_IGNORE_FONTS, vbox); | |
386 gaim_button(_("Ignore font si_zes"), &convo_options, OPT_CONVO_IGNORE_SIZES, vbox); | |
387 /* gaim_button(_("Ignore Ti_K Automated Messages"), &away_options, OPT_AWAY_TIK_HACK, vbox); */ | |
3500 | 388 |
3427 | 389 gtk_widget_show_all(ret); |
3366 | 390 return ret; |
391 } | |
392 | |
393 GtkWidget *hotkeys_page() { | |
394 GtkWidget *ret; | |
395 GtkWidget *vbox; | |
3427 | 396 ret = gtk_vbox_new(FALSE, 18); |
397 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 398 |
3427 | 399 vbox = make_frame(ret, _("Send Message")); |
3818 | 400 gaim_button(_("_Enter sends message"), &convo_options, OPT_CONVO_ENTER_SENDS, vbox); |
401 gaim_button(_("C_ontrol-Enter sends message"), &convo_options, OPT_CONVO_CTL_ENTER, vbox); | |
3500 | 402 |
3427 | 403 vbox = make_frame (ret, _("Window Closing")); |
3818 | 404 gaim_button(_("E_scape closes window"), &convo_options, OPT_CONVO_ESC_CAN_CLOSE, vbox); |
405 gaim_button(_("Control-_W closes window"), &convo_options, OPT_CONVO_CTL_W_CLOSES, vbox); | |
3366 | 406 |
3427 | 407 vbox = make_frame(ret, "Insertions"); |
3818 | 408 gaim_button(_("Control-{B/I/U/S} inserts _HTML tags"), &convo_options, OPT_CONVO_CTL_CHARS, vbox); |
409 gaim_button(_("Control-(number) inserts _smileys"), &convo_options, OPT_CONVO_CTL_SMILEYS, vbox); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
410 |
3427 | 411 gtk_widget_show_all(ret); |
3366 | 412 return ret; |
413 } | |
414 | |
415 GtkWidget *list_page() { | |
416 GtkWidget *ret; | |
417 GtkWidget *vbox; | |
3427 | 418 ret = gtk_vbox_new(FALSE, 18); |
419 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 420 |
3427 | 421 vbox = make_frame (ret, _("Buttons")); |
3818 | 422 gaim_button(_("_Hide IM/Info/Chat buttons"), &blist_options, OPT_BLIST_NO_BUTTONS, vbox); |
423 gaim_button(_("Show _pictures on buttons"), &blist_options, OPT_BLIST_SHOW_BUTTON_XPM, vbox); | |
3366 | 424 |
3427 | 425 vbox = make_frame (ret, _("Buddy List Window")); |
4045 | 426 gaim_button(_("_Save window size/position"), &blist_options, OPT_BLIST_SAVED_WINDOWS, vbox); |
427 gaim_button(_("_Raise window on events"), &blist_options, OPT_BLIST_POPUP, vbox); | |
3366 | 428 |
3427 | 429 vbox = make_frame (ret, _("Group Display")); |
3818 | 430 gaim_button(_("Hide _groups with no online buddies"), &blist_options, OPT_BLIST_NO_MT_GRP, vbox); |
431 gaim_button(_("Show _numbers in groups"), &blist_options, OPT_BLIST_SHOW_GRPNUM, vbox); | |
3366 | 432 |
3427 | 433 vbox = make_frame (ret, _("Buddy Display")); |
3818 | 434 gaim_button(_("Show buddy type _icons"), &blist_options, OPT_BLIST_SHOW_PIXMAPS, vbox); |
435 gaim_button(_("Show _warning levels"), &blist_options, OPT_BLIST_SHOW_WARN, vbox); | |
436 gaim_button(_("Show idle _times"), &blist_options, OPT_BLIST_SHOW_IDLETIME, vbox); | |
437 gaim_button(_("Grey i_dle buddies"), &blist_options, OPT_BLIST_GREY_IDLERS, vbox); | |
3366 | 438 |
3427 | 439 gtk_widget_show_all(ret); |
3366 | 440 return ret; |
441 } | |
442 | |
443 GtkWidget *im_page() { | |
444 GtkWidget *ret; | |
3500 | 445 GtkWidget *vbox; |
3427 | 446 GtkWidget *typingbutton, *widge; |
447 GtkSizeGroup *sg; | |
3366 | 448 |
3427 | 449 ret = gtk_vbox_new(FALSE, 18); |
450 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
451 | |
452 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
453 | |
454 vbox = make_frame (ret, _("Window")); | |
4114 | 455 widge = gaim_dropdown(vbox, _("Show _buttons as:"), &im_options, OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM, |
456 _("Pictures"), OPT_IM_BUTTON_XPM, | |
457 _("Text"), OPT_IM_BUTTON_TEXT, | |
458 _("Pictures and text"), OPT_IM_BUTTON_XPM | OPT_IM_BUTTON_TEXT, NULL); | |
3427 | 459 gtk_size_group_add_widget(sg, widge); |
460 gtk_misc_set_alignment(GTK_MISC(widge), 0, 0); | |
3818 | 461 gaim_labeled_spin_button(vbox, _("New window _width:"), &conv_size.width, 25, 9999, sg); |
462 gaim_labeled_spin_button(vbox, _("New window _height:"), &conv_size.height, 25, 9999, sg); | |
463 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &conv_size.entry_height, 25, 9999, sg); | |
464 gaim_button(_("_Raise windows on events"), &im_options, OPT_IM_POPUP, vbox); | |
465 gaim_button(_("Hide window on _send"), &im_options, OPT_IM_POPDOWN, vbox); | |
3366 | 466 gtk_widget_show (vbox); |
467 | |
3427 | 468 vbox = make_frame (ret, _("Buddy Icons")); |
4045 | 469 gaim_button(_("Hide buddy _icons"), &im_options, OPT_IM_HIDE_ICONS, vbox); |
470 gaim_button(_("Disable buddy icon a_nimation"), &im_options, OPT_IM_NO_ANIMATION, vbox); | |
3366 | 471 |
3427 | 472 vbox = make_frame (ret, _("Display")); |
3818 | 473 gaim_button(_("Show _logins in window"), &im_options, OPT_IM_LOGON, vbox); |
3366 | 474 |
3427 | 475 vbox = make_frame (ret, _("Typing Notification")); |
3818 | 476 typingbutton = gaim_button(_("Notify buddies that you are _typing to them"), &misc_options, |
3366 | 477 OPT_MISC_STEALTH_TYPING, vbox); |
478 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(typingbutton), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(typingbutton))); | |
3818 | 479 misc_options ^= OPT_MISC_STEALTH_TYPING; |
3366 | 480 |
3427 | 481 gtk_widget_show_all(ret); |
3366 | 482 return ret; |
483 } | |
484 | |
485 GtkWidget *chat_page() { | |
486 GtkWidget *ret; | |
487 GtkWidget *vbox; | |
3427 | 488 GtkWidget *dd; |
489 GtkSizeGroup *sg; | |
3366 | 490 |
3427 | 491 ret = gtk_vbox_new(FALSE, 18); |
492 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3500 | 493 |
3427 | 494 sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); |
3366 | 495 |
3427 | 496 vbox = make_frame (ret, _("Window")); |
4114 | 497 dd = gaim_dropdown(vbox, _("Show _buttons as:"), &chat_options, OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM, |
498 _("Pictures"), OPT_CHAT_BUTTON_XPM, | |
499 _("Text"), OPT_CHAT_BUTTON_TEXT, | |
500 _("Pictures and text"), OPT_CHAT_BUTTON_XPM | OPT_CHAT_BUTTON_TEXT, NULL); | |
3427 | 501 gtk_size_group_add_widget(sg, dd); |
502 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
3818 | 503 gaim_labeled_spin_button(vbox, _("New window _width:"), &buddy_chat_size.width, 25, 9999, sg); |
504 gaim_labeled_spin_button(vbox, _("New window _height:"), &buddy_chat_size.height, 25, 9999, sg); | |
505 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &buddy_chat_size.entry_height, 25, 9999, sg); | |
506 gaim_button(_("_Raise windows on events"), &chat_options, OPT_CHAT_POPUP, vbox); | |
3366 | 507 |
3427 | 508 vbox = make_frame (ret, _("Tab Completion")); |
4045 | 509 gaim_button(_("_Tab-complete nicks"), &chat_options, OPT_CHAT_TAB_COMPLETE, vbox); |
510 gaim_button(_("_Old-style tab completion"), &chat_options, OPT_CHAT_OLD_STYLE_TAB, vbox); | |
3427 | 511 |
512 vbox = make_frame (ret, _("Display")); | |
3818 | 513 gaim_button(_("_Show people joining/leaving in window"), &chat_options, OPT_CHAT_LOGON, vbox); |
514 gaim_button(_("Co_lorize screennames"), &chat_options, OPT_CHAT_COLORIZE, vbox); | |
3427 | 515 |
516 gtk_widget_show_all(ret); | |
3366 | 517 return ret; |
518 } | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
519 |
3366 | 520 GtkWidget *tab_page() { |
521 GtkWidget *ret; | |
522 GtkWidget *vbox; | |
3427 | 523 GtkWidget *dd; |
524 GtkSizeGroup *sg; | |
525 ret = gtk_vbox_new(FALSE, 18); | |
526 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 527 |
3427 | 528 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
3500 | 529 |
3427 | 530 vbox = make_frame (ret, _("IM Tabs")); |
4114 | 531 dd = gaim_dropdown(vbox, _("Tab _placement:"), &im_options, OPT_IM_SIDE_TAB | OPT_IM_BR_TAB, |
532 _("Top"), 0, | |
533 _("Bottom"), OPT_IM_BR_TAB, | |
534 _("Left"), OPT_IM_SIDE_TAB, | |
535 _("Right"), OPT_IM_BR_TAB | OPT_IM_SIDE_TAB, NULL); | |
3427 | 536 gtk_size_group_add_widget(sg, dd); |
4045 | 537 gaim_button(_("Show all _instant messages in one tabbed\nwindow"), &im_options, OPT_IM_ONE_WINDOW, vbox); |
3818 | 538 gaim_button(_("Show a_liases in tabs/titles"), &im_options, OPT_IM_ALIAS_TAB, vbox); |
3366 | 539 |
3427 | 540 vbox = make_frame (ret, _("Chat Tabs")); |
4114 | 541 dd = gaim_dropdown(vbox, _("Tab _placement:"), &chat_options, OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, |
542 _("Top"), 0, | |
543 _("Bottom"), OPT_CHAT_BR_TAB, | |
544 _("Left"), OPT_CHAT_SIDE_TAB, | |
545 _("Right"), OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, NULL); | |
3427 | 546 gtk_size_group_add_widget(sg, dd); |
3818 | 547 gaim_button(_("Show all c_hats in one tabbed window"), &chat_options, OPT_CHAT_ONE_WINDOW, |
3366 | 548 vbox); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
549 |
3427 | 550 vbox = make_frame (ret, _("Combined Tabs")); |
3818 | 551 gaim_button(_("Show IMs and chats in _same tabbed\nwindow."), &convo_options, OPT_CONVO_COMBINE, vbox); |
3500 | 552 |
3427 | 553 vbox = make_frame (ret, _("Buddy List Tabs")); |
4114 | 554 dd = gaim_dropdown(vbox, _("Tab _placement:"), &blist_options, OPT_BLIST_BOTTOM_TAB, |
555 _("Top"), 0, | |
556 _("Bottom"), OPT_BLIST_BOTTOM_TAB, NULL); | |
3427 | 557 gtk_size_group_add_widget(sg, dd); |
3500 | 558 |
3427 | 559 gtk_widget_show_all(ret); |
3366 | 560 return ret; |
561 } | |
562 | |
563 GtkWidget *proxy_page() { | |
564 GtkWidget *ret; | |
565 GtkWidget *vbox; | |
566 GtkWidget *entry; | |
567 GtkWidget *label; | |
568 GtkWidget *hbox; | |
569 GtkWidget *table; | |
570 | |
3427 | 571 ret = gtk_vbox_new(FALSE, 18); |
572 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 573 |
3427 | 574 vbox = make_frame (ret, _("Proxy Type")); |
4114 | 575 gaim_dropdown(vbox, _("Proxy _type:"), &proxytype, -1, |
576 _("No proxy"), PROXY_NONE, | |
3366 | 577 "SOCKS 4", PROXY_SOCKS4, |
578 "SOCKS 5", PROXY_SOCKS5, | |
579 "HTTP", PROXY_HTTP, NULL); | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
580 |
2254 | 581 table = gtk_table_new(2, 2, FALSE); |
582 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
583 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
584 gtk_table_set_row_spacings(GTK_TABLE(table), 5); | |
585 | |
3427 | 586 vbox = make_frame(ret, _("Proxy Server")); |
587 prefs_proxy_frame = vbox; | |
2254 | 588 |
589 if (proxytype == PROXY_NONE) | |
3427 | 590 gtk_widget_set_sensitive(GTK_WIDGET(vbox), FALSE); |
2254 | 591 |
592 table = gtk_table_new(2, 4, FALSE); | |
593 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
594 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
595 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
3427 | 596 gtk_container_add(GTK_CONTAINER(vbox), table); |
2254 | 597 |
598 | |
3427 | 599 label = gtk_label_new_with_mnemonic(_("_Host")); |
2254 | 600 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
601 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
602 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
603 entry = gtk_entry_new(); |
3427 | 604 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 605 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
606 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
607 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
608 gtk_entry_set_text(GTK_ENTRY(entry), proxyhost); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
609 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
610 hbox = gtk_hbox_new(TRUE, 5); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
611 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
612 |
3427 | 613 label = gtk_label_new_with_mnemonic(_("Port")); |
2254 | 614 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
615 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
616 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
617 entry = gtk_entry_new(); |
3427 | 618 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 619 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
620 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
621 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); |
2254 | 622 |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
623 if (proxyport) { |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
624 char buf[128]; |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
625 g_snprintf(buf, sizeof(buf), "%d", proxyport); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
626 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
627 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
628 |
3427 | 629 label = gtk_label_new_with_mnemonic(_("_User")); |
2254 | 630 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
631 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
632 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
633 entry = gtk_entry_new(); |
3427 | 634 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 635 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
636 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
637 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
638 gtk_entry_set_text(GTK_ENTRY(entry), proxyuser); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
639 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
640 hbox = gtk_hbox_new(TRUE, 5); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
641 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
642 |
3427 | 643 label = gtk_label_new_with_mnemonic(_("Pa_ssword")); |
2254 | 644 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
645 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
646 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
647 entry = gtk_entry_new(); |
3427 | 648 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 649 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, GTK_FILL , 0, 0, 0); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
650 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
651 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
652 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
653 gtk_entry_set_text(GTK_ENTRY(entry), proxypass); |
3500 | 654 |
3427 | 655 gtk_widget_show_all(ret); |
3366 | 656 return ret; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
657 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
658 |
3821 | 659 #ifndef _WIN32 |
3432 | 660 static void browser_print_option(GtkEntry *entry, void *nullish) { |
3818 | 661 g_snprintf(web_command, sizeof(web_command), "%s", gtk_entry_get_text(entry)); |
3432 | 662 } |
3821 | 663 #endif |
3432 | 664 |
3366 | 665 GtkWidget *browser_page() { |
666 GtkWidget *ret; | |
3821 | 667 GtkWidget *vbox; |
668 #ifndef _WIN32 | |
669 GtkWidget *hbox; | |
670 #endif | |
3366 | 671 GtkWidget *label; |
3427 | 672 GtkSizeGroup *sg; |
673 | |
674 ret = gtk_vbox_new(FALSE, 18); | |
675 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
676 | |
677 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
3630 | 678 #ifndef _WIN32 |
679 /* Registered default browser is used by Windows */ | |
3427 | 680 vbox = make_frame (ret, _("Browser Selection")); |
4114 | 681 label = gaim_dropdown(vbox, _("_Browser"), &web_browser, -1, |
3427 | 682 "Netscape", BROWSER_NETSCAPE, |
683 "Konqueror", BROWSER_KONQ, | |
684 "Mozilla", BROWSER_MOZILLA, | |
4114 | 685 _("Manual"), BROWSER_MANUAL, |
3472 | 686 /* fixme: GNOME binary helper |
4114 | 687 _("GNOME URL Handler"), BROWSER_GNOME, */ |
3427 | 688 "Galeon", BROWSER_GALEON, |
689 "Opera", BROWSER_OPERA, NULL); | |
690 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
691 gtk_size_group_add_widget(sg, label); | |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
692 |
3366 | 693 hbox = gtk_hbox_new(FALSE, 5); |
694 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
4295 | 695 label = gtk_label_new_with_mnemonic(_("_Manual: ")); |
3366 | 696 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
3427 | 697 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
698 gtk_size_group_add_widget(sg, label); | |
3366 | 699 browser_entry = gtk_entry_new(); |
3427 | 700 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); |
3818 | 701 if (web_browser != BROWSER_MANUAL) |
3366 | 702 gtk_widget_set_sensitive(browser_entry, FALSE); |
703 gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
704 |
3818 | 705 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
706 g_signal_connect(GTK_OBJECT(browser_entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
707 G_CALLBACK(browser_print_option), NULL); |
3630 | 708 #endif /* end !_WIN32 */ |
3427 | 709 vbox = make_frame (ret, _("Browser Options")); |
3818 | 710 label = gaim_button(_("Open new _window by default"), &misc_options, OPT_MISC_BROWSER_POPUP, vbox); |
3630 | 711 #ifdef _WIN32 |
712 /* Until I figure out how to implement this on windows */ | |
713 gtk_widget_set_sensitive(label, FALSE); | |
714 #endif | |
3427 | 715 gtk_widget_show_all(ret); |
3366 | 716 return ret; |
3500 | 717 } |
3366 | 718 |
719 GtkWidget *logging_page() { | |
720 GtkWidget *ret; | |
721 GtkWidget *vbox; | |
3427 | 722 ret = gtk_vbox_new(FALSE, 18); |
723 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
724 |
3427 | 725 vbox = make_frame (ret, _("Message Logs")); |
4045 | 726 gaim_button(_("_Log all instant messages"), &logging_options, OPT_LOG_CONVOS, vbox); |
3818 | 727 gaim_button(_("Log all c_hats"), &logging_options, OPT_LOG_CHATS, vbox); |
728 gaim_button(_("Strip _HTML from logs"), &logging_options, OPT_LOG_STRIP_HTML, vbox); | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
729 |
3427 | 730 vbox = make_frame (ret, _("System Logs")); |
3818 | 731 gaim_button(_("Log when buddies _sign on/sign off"), &logging_options, OPT_LOG_BUDDY_SIGNON, |
3366 | 732 vbox); |
3818 | 733 gaim_button(_("Log when buddies become _idle/un-idle"), &logging_options, OPT_LOG_BUDDY_IDLE, |
3366 | 734 vbox); |
3818 | 735 gaim_button(_("Log when buddies go away/come _back"), &logging_options, OPT_LOG_BUDDY_AWAY, vbox); |
736 gaim_button(_("Log your _own signons/idleness/awayness"), &logging_options, OPT_LOG_MY_SIGNON, | |
3366 | 737 vbox); |
3818 | 738 gaim_button(_("I_ndividual log file for each buddy's signons"), &logging_options, |
3366 | 739 OPT_LOG_INDIVIDUAL, vbox); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
740 |
3427 | 741 gtk_widget_show_all(ret); |
3366 | 742 return ret; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
743 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
744 |
3366 | 745 static GtkWidget *sndcmd = NULL; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
746 |
3821 | 747 #ifndef _WIN32 |
4095 | 748 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
749 { |
3818 | 750 g_snprintf(sound_cmd, sizeof(sound_cmd), "%s", gtk_entry_get_text(GTK_ENTRY(sndcmd))); |
3366 | 751 return TRUE; |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
752 } |
3821 | 753 #endif |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
754 |
3366 | 755 GtkWidget *sound_page() { |
756 GtkWidget *ret; | |
3821 | 757 GtkWidget *vbox; |
758 GtkSizeGroup *sg; | |
759 #ifndef _WIN32 | |
760 GtkWidget *dd; | |
761 GtkWidget *hbox; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
762 GtkWidget *label; |
3821 | 763 #endif |
3366 | 764 |
3427 | 765 ret = gtk_vbox_new(FALSE, 18); |
766 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
767 |
3427 | 768 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
769 |
3427 | 770 vbox = make_frame (ret, _("Sound Options")); |
3818 | 771 gaim_button(_("_No sounds when you log in"), &sound_options, OPT_SOUND_SILENT_SIGNON, vbox); |
772 gaim_button(_("_Sounds while away"), &sound_options, OPT_SOUND_WHEN_AWAY, vbox); | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
773 |
3630 | 774 #ifndef _WIN32 |
3427 | 775 vbox = make_frame (ret, _("Sound Method")); |
4114 | 776 dd = gaim_dropdown(vbox, _("_Method"), &sound_options, OPT_SOUND_BEEP | |
3366 | 777 OPT_SOUND_ESD | OPT_SOUND_ARTSC | OPT_SOUND_NAS | OPT_SOUND_NORMAL | |
3500 | 778 OPT_SOUND_CMD, |
4114 | 779 _("Console beep"), OPT_SOUND_BEEP, |
3366 | 780 #ifdef ESD_SOUND |
3500 | 781 "ESD", OPT_SOUND_ESD, |
4082 | 782 #endif |
783 #ifdef ARTSC_SOUND | |
3366 | 784 "ArtsC", OPT_SOUND_ARTSC, |
4082 | 785 #endif |
786 #ifdef NAS_SOUND | |
3366 | 787 "NAS", OPT_SOUND_NAS, |
4082 | 788 #endif |
4114 | 789 _("Internal"), OPT_SOUND_NORMAL, |
790 _("Command"), OPT_SOUND_CMD, NULL); | |
3427 | 791 gtk_size_group_add_widget(sg, dd); |
792 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
793 |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
794 hbox = gtk_hbox_new(FALSE, 5); |
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
795 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
3427 | 796 |
3366 | 797 hbox = gtk_hbox_new(FALSE, 5); |
798 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 799 label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)")); |
3427 | 800 gtk_size_group_add_widget(sg, label); |
801 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 802 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
803 |
3366 | 804 sndcmd = gtk_entry_new(); |
3427 | 805 gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
806 |
3366 | 807 gtk_entry_set_editable(GTK_ENTRY(sndcmd), TRUE); |
808 gtk_entry_set_text(GTK_ENTRY(sndcmd), sound_cmd); | |
809 gtk_widget_set_size_request(sndcmd, 75, -1); | |
3427 | 810 |
3818 | 811 gtk_widget_set_sensitive(sndcmd, (sound_options & OPT_SOUND_CMD)); |
3366 | 812 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
813 g_signal_connect(GTK_OBJECT(sndcmd), "changed", G_CALLBACK(sound_cmd_yeah), NULL); |
3630 | 814 #endif /* _WIN32 */ |
3427 | 815 gtk_widget_show_all(ret); |
3366 | 816 return ret; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
817 } |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
818 |
3366 | 819 GtkWidget *away_page() { |
820 GtkWidget *ret; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
821 GtkWidget *vbox; |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
822 GtkWidget *hbox; |
3366 | 823 GtkWidget *label; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
824 GtkWidget *button; |
3366 | 825 GtkWidget *select; |
3427 | 826 GtkWidget *dd; |
827 GtkSizeGroup *sg; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
828 |
3427 | 829 ret = gtk_vbox_new(FALSE, 18); |
830 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
831 |
3427 | 832 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
833 |
3427 | 834 vbox = make_frame (ret, _("Away")); |
3818 | 835 gaim_button(_("_Sending messages removes away status"), &away_options, OPT_AWAY_BACK_ON_IM, vbox); |
836 gaim_button(_("_Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox); | |
837 gaim_button(_("_Ignore new conversations when away"), &away_options, OPT_AWAY_DISCARD, vbox); | |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
838 |
3427 | 839 vbox = make_frame (ret, _("Auto-response")); |
3366 | 840 hbox = gtk_hbox_new(FALSE, 0); |
841 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3427 | 842 gaim_labeled_spin_button(hbox, _("Seconds before _resending:"), |
3818 | 843 &away_resend, 1, 24 * 60 * 60, sg); |
844 gaim_button(_("_Don't send auto-response"), &away_options, OPT_AWAY_NO_AUTO_RESP, vbox); | |
845 gaim_button(_("_Only send auto-response when idle"), &away_options, OPT_AWAY_IDLE_RESP, vbox); | |
846 gaim_button(_("Do_n't send auto-response in active conversations"), &away_options, OPT_AWAY_DELAY_IN_USE, vbox); | |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
847 |
3818 | 848 if (away_options & OPT_AWAY_NO_AUTO_RESP) |
3366 | 849 gtk_widget_set_sensitive(hbox, FALSE); |
3500 | 850 |
3427 | 851 vbox = make_frame (ret, _("Idle")); |
4052 | 852 dd = gaim_dropdown(vbox, _("Idle _time reporting:"), &report_idle, -1, |
853 _("None"), IDLE_NONE, | |
854 _("Gaim usage"), IDLE_GAIM, | |
3366 | 855 #ifdef USE_SCREENSAVER |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
856 #ifndef _WIN32 |
4052 | 857 _("X usage"), IDLE_SCREENSAVER, |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
858 #else |
4052 | 859 _("Windows usage"), IDLE_SCREENSAVER, |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
860 #endif |
3366 | 861 #endif |
3427 | 862 NULL); |
863 gtk_size_group_add_widget(sg, dd); | |
864 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
865 |
3427 | 866 vbox = make_frame (ret, _("Auto-away")); |
3818 | 867 button = gaim_button(_("Set away _when idle"), &away_options, OPT_AWAY_AUTO, vbox); |
4052 | 868 select = gaim_labeled_spin_button(vbox, _("_Minutes before setting away:"), &auto_away, 1, 24 * 60, sg); |
3818 | 869 if (!(away_options & OPT_AWAY_AUTO)) |
3366 | 870 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
871 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); |
1 | 872 |
4052 | 873 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); |
3427 | 874 gtk_size_group_add_widget(sg, label); |
875 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 876 hbox = gtk_hbox_new(FALSE, 0); |
877 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
878 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
879 prefs_away_menu = gtk_option_menu_new(); | |
3427 | 880 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); |
3818 | 881 if (!(away_options & OPT_AWAY_AUTO)) |
3366 | 882 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
883 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), prefs_away_menu); |
3366 | 884 default_away_menu_init(prefs_away_menu); |
885 gtk_widget_show(prefs_away_menu); | |
886 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
3500 | 887 |
3427 | 888 gtk_widget_show_all(ret); |
3366 | 889 return ret; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
890 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
891 |
3551 | 892 #if USE_PLUGINS |
893 GtkWidget *plugin_description=NULL, *plugin_details=NULL; | |
894 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) | |
895 { | |
896 gchar buf[1024]; | |
897 GtkTreeIter iter; | |
898 GValue val = { 0, }; | |
899 struct gaim_plugin *plug; | |
900 | |
901 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
902 return; | |
903 gtk_tree_model_get_value (model, &iter, 2, &val); | |
904 plug = g_value_get_pointer(&val); | |
905 | |
3563 | 906 if (plug->error[0]) |
907 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n" | |
908 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
909 "%s"), plug->desc.name, plug->desc.version, plug->error, plug->desc.description); | |
910 else | |
911 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n" | |
912 "%s"), plug->desc.name, plug->desc.version, plug->desc.description); | |
3551 | 913 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
3630 | 914 g_snprintf(buf, sizeof(buf), |
915 #ifndef _WIN32 | |
916 _("<span size=\"larger\">%s %s</span>\n\n" | |
917 "<span weight=\"bold\">Written by:</span>\t%s\n" | |
918 "<span weight=\"bold\">URL:</span>\t%s\n" | |
919 "<span weight=\"bold\">File name:</span>\t%s"), | |
920 #else | |
921 _("<span size=\"larger\">%s %s</span>\n\n" | |
922 "<span weight=\"bold\">Written by:</span> %s\n" | |
923 "<span weight=\"bold\">URL:</span> %s\n" | |
924 "<span weight=\"bold\">File name:</span> %s"), | |
925 #endif | |
3551 | 926 plug->desc.name, plug->desc.version, plug->desc.authors, plug->desc.url, plug->path); |
927 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); | |
928 g_value_unset (&val); | |
929 } | |
930 | |
931 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
932 { | |
933 GtkTreeModel *model = (GtkTreeModel *)data; | |
934 GtkTreeIter iter; | |
935 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
936 struct gaim_plugin *plug; | |
937 gchar buf[1024]; | |
3565 | 938 GtkWidget *(*config)(); |
939 | |
3551 | 940 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); |
941 gdk_window_set_cursor(prefs->window, wait); | |
942 gdk_cursor_unref(wait); | |
943 | |
944 gtk_tree_model_get_iter (model, &iter, path); | |
945 gtk_tree_model_get (model, &iter, 2, &plug, -1); | |
946 | |
947 if (!plug->handle) | |
948 | |
949 if (plug->type == plugin) | |
950 #ifdef GAIM_PLUGINS | |
3565 | 951 { |
952 load_plugin(plug->path); | |
953 if (g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { | |
954 plug->iter = g_new0(GtkTreeIter, 1); | |
955 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); | |
3567 | 956 if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), &plugin_iter) == 1) { |
957 /* Expand the tree for the first plugin added */ | |
3630 | 958 GtkTreePath *path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), &plugin_iter); |
3567 | 959 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), path2, TRUE); |
960 gtk_tree_path_free (path2); | |
961 } | |
3565 | 962 } |
963 } | |
3551 | 964 #else |
965 {} | |
966 #endif | |
967 else | |
968 #ifdef USE_PERL | |
969 perl_load_file(plug->path); | |
970 #else | |
971 {} | |
972 #endif | |
973 else | |
974 if (plug->type == plugin) | |
975 #ifdef GAIM_PLUGINS | |
3565 | 976 { |
977 unload_plugin(plug); | |
978 if (plug->iter) { | |
979 gtk_tree_store_remove(GTK_TREE_STORE(prefstree), plug->iter); | |
980 g_free(plug->iter); | |
981 plug->iter = NULL; | |
982 } | |
983 } | |
3551 | 984 #else |
985 {} | |
986 #endif | |
987 else | |
988 #ifdef USE_PERL | |
989 perl_unload_file(plug); | |
990 #else | |
991 {} | |
992 #endif | |
993 gdk_window_set_cursor(prefs->window, NULL); | |
3563 | 994 if (plug->error[0]) |
995 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n" | |
996 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
997 "%s"), plug->desc.name, plug->desc.version, plug->error, plug->desc.description); | |
998 else | |
999 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n" | |
1000 "%s"), plug->desc.name, plug->desc.version, plug->desc.description); | |
1001 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
3551 | 1002 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, plug->handle, -1); |
3563 | 1003 |
3551 | 1004 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
1005 gtk_tree_path_free(path); | |
1006 } | |
1007 | |
1008 static GtkWidget *plugin_page () | |
1009 { | |
1010 GtkWidget *ret; | |
1011 | |
1012 GtkWidget *sw, *vp; | |
1013 GtkTreeIter iter; | |
1014 GtkWidget *event_view; | |
1015 GtkListStore *ls; | |
1016 GtkCellRenderer *rend, *rendt; | |
1017 GtkTreeViewColumn *col; | |
1018 GtkTreeSelection *sel; | |
1019 GtkTreePath *path; | |
1020 | |
1021 GtkWidget *nb; | |
1022 | |
1023 GList *probes = probed_plugins; | |
1024 struct gaim_plugin *plug; | |
1025 | |
1026 ret = gtk_vbox_new(FALSE, 18); | |
1027 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1028 | |
1029 sw = gtk_scrolled_window_new(NULL,NULL); | |
1030 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
1031 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1032 | |
1033 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
1034 | |
1035 ls = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); | |
1036 while (probes) { | |
1037 plug = probes->data; | |
1038 gtk_list_store_append (ls, &iter); | |
1039 gtk_list_store_set(ls, &iter, | |
1040 0, plug->handle, | |
1041 1, plug->desc.name ? plug->desc.name : plug->path, | |
1042 2, plug, -1); | |
1043 probes = probes->next; | |
1044 } | |
1045 | |
1046 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); | |
1047 | |
1048 rend = gtk_cell_renderer_toggle_new(); | |
1049 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1050 | |
1051 | |
4295 | 1052 col = gtk_tree_view_column_new_with_attributes (_("Load"), |
3551 | 1053 rend, |
1054 "active", 0, | |
1055 NULL); | |
1056 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1057 | |
1058 rendt = gtk_cell_renderer_text_new(); | |
4295 | 1059 col = gtk_tree_view_column_new_with_attributes (_("Name"), |
3551 | 1060 rendt, |
1061 "text", 1, | |
1062 NULL); | |
1063 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1064 g_object_unref(G_OBJECT(ls)); | |
1065 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
1066 | |
1067 | |
1068 nb = gtk_notebook_new(); | |
1069 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM); | |
1070 gtk_notebook_popup_disable(GTK_NOTEBOOK(nb)); | |
1071 | |
1072 /* Description */ | |
1073 sw = gtk_scrolled_window_new(NULL, NULL); | |
1074 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1075 plugin_description = gtk_label_new(NULL); | |
1076 | |
1077 vp = gtk_viewport_new(NULL, NULL); | |
3630 | 1078 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
3551 | 1079 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
1080 | |
3630 | 1081 gtk_container_add(GTK_CONTAINER(vp), plugin_description); |
1082 gtk_container_add(GTK_CONTAINER(sw), vp); | |
3551 | 1083 |
3630 | 1084 gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE); |
1085 gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE); | |
3551 | 1086 gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0); |
1087 gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6); | |
1088 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Description"))); | |
1089 | |
1090 /* Details */ | |
1091 sw = gtk_scrolled_window_new(NULL, NULL); | |
1092 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1093 plugin_details = gtk_label_new(NULL); | |
1094 | |
1095 vp = gtk_viewport_new(NULL, NULL); | |
3630 | 1096 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
3551 | 1097 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
1098 | |
3630 | 1099 gtk_container_add(GTK_CONTAINER(vp), plugin_details); |
1100 gtk_container_add(GTK_CONTAINER(sw), vp); | |
3551 | 1101 |
3630 | 1102 gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE); |
1103 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); | |
3551 | 1104 gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0); |
1105 gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6); | |
1106 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Details"))); | |
1107 gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0); | |
1108 | |
1109 g_signal_connect (G_OBJECT (sel), "changed", | |
1110 G_CALLBACK (prefs_plugin_sel), | |
1111 NULL); | |
1112 g_signal_connect (G_OBJECT(rend), "toggled", | |
1113 G_CALLBACK(plugin_load), ls); | |
1114 | |
1115 path = gtk_tree_path_new_first(); | |
1116 gtk_tree_selection_select_path(sel, path); | |
1117 gtk_tree_path_free(path); | |
1118 | |
1119 gtk_widget_show_all(ret); | |
1120 return ret; | |
1121 } | |
1122 #endif | |
1123 | |
3366 | 1124 static void event_toggled (GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1125 { |
3366 | 1126 GtkTreeModel *model = (GtkTreeModel *)data; |
1127 GtkTreeIter iter; | |
1128 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
3500 | 1129 gint soundnum; |
3366 | 1130 |
1131 gtk_tree_model_get_iter (model, &iter, path); | |
1132 gtk_tree_model_get (model, &iter, 2, &soundnum, -1); | |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1133 |
3818 | 1134 sound_options ^= sounds[soundnum].opt; |
1135 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, sound_options & sounds[soundnum].opt, -1); | |
3522 | 1136 |
1137 gtk_tree_path_free(path); | |
3366 | 1138 } |
1139 | |
1140 static void test_sound(GtkWidget *button, gpointer i_am_NULL) | |
1141 { | |
1142 guint32 tmp_sound = sound_options; | |
1143 if (!(sound_options & OPT_SOUND_WHEN_AWAY)) | |
1144 sound_options ^= OPT_SOUND_WHEN_AWAY; | |
1145 if (!(sound_options & sounds[sound_row_sel].opt)) | |
1146 sound_options ^= sounds[sound_row_sel].opt; | |
1147 play_sound(sound_row_sel); | |
3500 | 1148 |
3366 | 1149 sound_options = tmp_sound; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1150 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1151 |
3366 | 1152 static void reset_sound(GtkWidget *button, gpointer i_am_also_NULL) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1153 { |
3366 | 1154 /* This just resets a sound file back to default */ |
3818 | 1155 if (sound_file[sound_row_sel]) { |
1156 g_free(sound_file[sound_row_sel]); | |
1157 sound_file[sound_row_sel] = NULL; | |
3485 | 1158 } |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1159 |
3366 | 1160 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1161 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1162 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1163 void close_sounddialog(GtkWidget *w, GtkWidget *w2) |
1170 | 1164 { |
1165 | |
1166 GtkWidget *dest; | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1167 |
1170 | 1168 if (!GTK_IS_WIDGET(w2)) |
1169 dest = w; | |
1170 else | |
1171 dest = w2; | |
1172 | |
1173 sounddialog = NULL; | |
1174 | |
1175 gtk_widget_destroy(dest); | |
1176 } | |
1177 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1178 void do_select_sound(GtkWidget *w, int snd) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1179 { |
1953
f0ff0b367e3d
[gaim-migrate @ 1963]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1930
diff
changeset
|
1180 const char *file; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1181 |
1170 | 1182 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); |
1183 | |
1184 /* If they type in a directory, change there */ | |
1185 if (file_is_dir(file, sounddialog)) | |
1186 return; | |
1187 | |
1188 /* Let's just be safe */ | |
3818 | 1189 if (sound_file[snd]) |
1190 g_free(sound_file[snd]); | |
1170 | 1191 |
1192 /* Set it -- and forget it */ | |
3818 | 1193 sound_file[snd] = g_strdup(file); |
3500 | 1194 |
1175 | 1195 /* Set our text entry */ |
3818 | 1196 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file[snd]); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1197 |
1170 | 1198 /* Close the window! It's getting cold in here! */ |
1199 close_sounddialog(NULL, sounddialog); | |
2471
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1200 |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1201 if (last_sound_dir) |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1202 g_free(last_sound_dir); |
3818 | 1203 last_sound_dir = g_dirname(sound_file[snd]); |
1170 | 1204 } |
1205 | |
3366 | 1206 static void sel_sound(GtkWidget *button, gpointer being_NULL_is_fun) |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1207 { |
1170 | 1208 char *buf = g_malloc(BUF_LEN); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1209 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1210 if (!sounddialog) { |
1170 | 1211 sounddialog = gtk_file_selection_new(_("Gaim - Sound Configuration")); |
1212 | |
1213 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
1214 | |
3630 | 1215 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S, last_sound_dir ? last_sound_dir : gaim_home_dir()); |
1170 | 1216 |
1217 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
1218 | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1219 g_signal_connect(GTK_OBJECT(sounddialog), "destroy", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1220 G_CALLBACK(close_sounddialog), sounddialog); |
1170 | 1221 |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1222 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1223 "clicked", G_CALLBACK(do_select_sound), (int *)sound_row_sel); |
1170 | 1224 |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1225 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button), |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1226 "clicked", G_CALLBACK(close_sounddialog), sounddialog); |
1170 | 1227 } |
1228 | |
1229 g_free(buf); | |
1230 gtk_widget_show(sounddialog); | |
1231 gdk_window_raise(sounddialog->window); | |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1232 } |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1233 |
3366 | 1234 |
1235 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
1236 GtkTreeIter iter; | |
1237 GValue val = { 0, }; | |
3500 | 1238 |
3366 | 1239 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
1240 return; | |
1241 gtk_tree_model_get_value (model, &iter, 2, &val); | |
1242 sound_row_sel = g_value_get_uint(&val); | |
1243 if (sound_entry) | |
3818 | 1244 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file[sound_row_sel] ? sound_file[sound_row_sel] : "(default)"); |
3366 | 1245 g_value_unset (&val); |
1246 if (sounddialog) | |
1247 gtk_widget_destroy(sounddialog); | |
1248 } | |
1249 | |
1250 GtkWidget *sound_events_page() { | |
1251 | |
1252 GtkWidget *ret; | |
1253 GtkWidget *sw; | |
1254 GtkWidget *button, *hbox; | |
1255 GtkTreeIter iter; | |
1256 GtkWidget *event_view; | |
1257 GtkListStore *event_store; | |
1258 GtkCellRenderer *rend; | |
1259 GtkTreeViewColumn *col; | |
1260 GtkTreeSelection *sel; | |
1261 GtkTreePath *path; | |
1262 int j; | |
1263 | |
3427 | 1264 ret = gtk_vbox_new(FALSE, 18); |
1265 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 1266 |
1267 sw = gtk_scrolled_window_new(NULL,NULL); | |
1268 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
3814 | 1269 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
1270 | |
3427 | 1271 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3366 | 1272 event_store = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT); |
1273 | |
1274 for (j=0; j < NUM_SOUNDS; j++) { | |
1275 if (sounds[j].opt == 0) | |
1276 continue; | |
3500 | 1277 |
3366 | 1278 gtk_list_store_append (event_store, &iter); |
1279 gtk_list_store_set(event_store, &iter, | |
1280 0, sound_options & sounds[j].opt, | |
4114 | 1281 1, gettext(sounds[j].label), |
3366 | 1282 2, j, -1); |
1283 } | |
1284 | |
1285 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
3500 | 1286 |
3366 | 1287 rend = gtk_cell_renderer_toggle_new(); |
1288 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1289 g_signal_connect (G_OBJECT (sel), "changed", | |
1290 G_CALLBACK (prefs_sound_sel), | |
1291 NULL); | |
1292 g_signal_connect (G_OBJECT(rend), "toggled", | |
1293 G_CALLBACK(event_toggled), event_store); | |
1294 path = gtk_tree_path_new_first(); | |
1295 gtk_tree_selection_select_path(sel, path); | |
3522 | 1296 gtk_tree_path_free(path); |
3500 | 1297 |
4295 | 1298 col = gtk_tree_view_column_new_with_attributes (_("Play"), |
3366 | 1299 rend, |
1300 "active", 0, | |
1301 NULL); | |
1302 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1303 | |
1304 rend = gtk_cell_renderer_text_new(); | |
4295 | 1305 col = gtk_tree_view_column_new_with_attributes (_("Event"), |
3366 | 1306 rend, |
1307 "text", 1, | |
1308 NULL); | |
1309 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
3500 | 1310 g_object_unref(G_OBJECT(event_store)); |
3366 | 1311 gtk_container_add(GTK_CONTAINER(sw), event_view); |
1312 | |
3427 | 1313 hbox = gtk_hbox_new(FALSE, 6); |
1314 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
3366 | 1315 sound_entry = gtk_entry_new(); |
3818 | 1316 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file[0] ? sound_file[0] : "(default)"); |
3366 | 1317 gtk_entry_set_editable(GTK_ENTRY(sound_entry), FALSE); |
1318 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5); | |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1319 |
3025 | 1320 button = gtk_button_new_with_label(_("Test")); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1321 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); |
3366 | 1322 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
2759
f26f1d139615
[gaim-migrate @ 2772]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2746
diff
changeset
|
1323 |
1175 | 1324 button = gtk_button_new_with_label(_("Reset")); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1325 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); |
3366 | 1326 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
1175 | 1327 |
1381 | 1328 button = gtk_button_new_with_label(_("Choose...")); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1329 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(sel_sound), NULL); |
3366 | 1330 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
3500 | 1331 |
3427 | 1332 gtk_widget_show_all (ret); |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1333 |
3366 | 1334 return ret; |
2580
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1335 } |
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1336 |
3366 | 1337 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1338 { |
3366 | 1339 GtkTreeIter iter; |
1340 GValue val = { 0, }; | |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1341 gchar buffer[BUF_LONG]; |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1342 char *tmp; |
3374 | 1343 struct away_message *am; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1344 |
3366 | 1345 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
1346 return; | |
1347 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3374 | 1348 am = g_value_get_pointer(&val); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1349 gtk_imhtml_clear(GTK_IMHTML(away_text)); |
3374 | 1350 strncpy(buffer, am->message, BUF_LONG); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1351 tmp = stylize(buffer, BUF_LONG); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1352 gtk_imhtml_append_text(GTK_IMHTML(away_text), tmp, -1, GTK_IMHTML_NO_TITLE | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
1353 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1354 gtk_imhtml_append_text(GTK_IMHTML(away_text), "<BR>", -1, GTK_IMHTML_NO_TITLE | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
1355 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1356 g_free(tmp); |
3366 | 1357 g_value_unset (&val); |
3500 | 1358 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1359 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1360 |
3500 | 1361 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { |
3366 | 1362 struct away_message *am; |
1363 GtkTreeIter iter; | |
1364 GtkTreePath *path; | |
1365 GtkTreeStore *ts = GTK_TREE_STORE(gtk_tree_view_get_model(tv)); | |
1366 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
3379 | 1367 GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store); |
3366 | 1368 GValue val = { 0, }; |
3500 | 1369 |
3379 | 1370 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
3366 | 1371 return; |
3379 | 1372 gtk_tree_model_get_value (GTK_TREE_MODEL(prefs_away_store), &iter, 1, &val); |
3366 | 1373 am = g_value_get_pointer (&val); |
1374 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
1375 rem_away_mess(NULL, am); | |
3379 | 1376 gtk_list_store_remove(GTK_LIST_STORE(ts), &iter); |
1377 path = gtk_tree_path_new_first(); | |
3366 | 1378 gtk_tree_selection_select_path(sel, path); |
3522 | 1379 gtk_tree_path_free(path); |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1380 } |
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1381 |
3366 | 1382 GtkWidget *away_message_page() { |
1383 GtkWidget *ret; | |
3427 | 1384 GtkWidget *hbox; |
3379 | 1385 GtkWidget *button; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1386 GtkWidget *sw; |
3366 | 1387 GtkTreeIter iter; |
1388 GtkWidget *event_view; | |
1389 GtkCellRenderer *rend; | |
1390 GtkTreeViewColumn *col; | |
1391 GtkTreeSelection *sel; | |
940 | 1392 GSList *awy = away_messages; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1393 struct away_message *a; |
3366 | 1394 GtkWidget *sw2; |
3427 | 1395 GtkSizeGroup *sg; |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1396 |
3427 | 1397 ret = gtk_vbox_new(FALSE, 18); |
1398 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1399 | |
1400 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
3500 | 1401 |
3366 | 1402 sw = gtk_scrolled_window_new(NULL,NULL); |
1403 away_text = gtk_imhtml_new(NULL, NULL); | |
3427 | 1404 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); |
3817 | 1405 /* |
1406 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1407 */ | |
3427 | 1408 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3500 | 1409 |
3374 | 1410 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); |
3366 | 1411 while (awy) { |
1412 a = (struct away_message *)awy->data; | |
1413 gtk_list_store_append (prefs_away_store, &iter); | |
1414 gtk_list_store_set(prefs_away_store, &iter, | |
3374 | 1415 0, a->name, |
1416 1, a, -1); | |
3366 | 1417 awy = awy->next; |
1418 } | |
1419 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(prefs_away_store)); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1420 |
2906
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1421 |
3366 | 1422 rend = gtk_cell_renderer_text_new(); |
1423 col = gtk_tree_view_column_new_with_attributes ("NULL", | |
1424 rend, | |
1425 "text", 0, | |
1426 NULL); | |
1427 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1428 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
1429 gtk_widget_show(event_view); | |
3427 | 1430 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), event_view); |
3374 | 1431 |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1432 sw2 = gtk_scrolled_window_new(NULL, NULL); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1433 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1434 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
3427 | 1435 gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); |
3500 | 1436 |
3427 | 1437 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), away_text); |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
1438 gaim_setup_imhtml(away_text); |
3366 | 1439 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); |
1440 g_signal_connect (G_OBJECT (sel), "changed", | |
1441 G_CALLBACK (away_message_sel), | |
1442 NULL); | |
1443 hbox = gtk_hbox_new(TRUE, 5); | |
3427 | 1444 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); |
3366 | 1445 button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
1446 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
3427 | 1447 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1448 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(create_away_mess), NULL); |
3472 | 1449 |
3366 | 1450 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); |
3427 | 1451 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1452 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(remove_away_message), event_view); |
3472 | 1453 |
3366 | 1454 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3472 | 1455 |
3649 | 1456 button = gaim_pixbuf_button(_("_Edit"), "edit.png", GAIM_BUTTON_HORIZONTAL); |
3427 | 1457 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1458 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(create_away_mess), event_view); |
3366 | 1459 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3500 | 1460 |
3427 | 1461 gtk_widget_show_all(ret); |
3366 | 1462 return ret; |
1463 } | |
3472 | 1464 |
3500 | 1465 GtkTreeIter *prefs_notebook_add_page(char *text, |
1466 GdkPixbuf *pixbuf, | |
1467 GtkWidget *page, | |
3366 | 1468 GtkTreeIter *iter, |
3500 | 1469 GtkTreeIter *parent, |
3366 | 1470 int ind) { |
1471 GdkPixbuf *icon = NULL; | |
3500 | 1472 |
3366 | 1473 if (pixbuf) |
3500 | 1474 icon = gdk_pixbuf_scale_simple (pixbuf, 18, 18, GDK_INTERP_BILINEAR); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1475 |
3366 | 1476 gtk_tree_store_append (prefstree, iter, parent); |
1477 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
3500 | 1478 |
3366 | 1479 if (pixbuf) |
1480 g_object_unref(pixbuf); | |
1481 if (icon) | |
1482 g_object_unref(icon); | |
1483 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
1484 return iter; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1485 } |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1486 |
3366 | 1487 void prefs_notebook_init() { |
1488 GtkTreeIter p, c; | |
3565 | 1489 #if USE_PLUGINS |
1490 GtkWidget *(*config)(); | |
1491 GList *l = plugins; | |
1492 struct gaim_plugin *plug; | |
1493 #endif | |
1494 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); | |
4288 | 1495 prefs_notebook_add_page(_("Themes"), NULL, theme_page(), &c, &p, notebook_page++); |
3565 | 1496 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); |
1497 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | |
1498 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | |
1499 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
1500 prefs_notebook_add_page(_("IM Window"), NULL, im_page(), &c, &p, notebook_page++); | |
1501 prefs_notebook_add_page(_("Chat Window"), NULL, chat_page(), &c, &p, notebook_page++); | |
1502 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p, notebook_page++); | |
1503 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); | |
1504 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); | |
1130
d31fad9abb32
[gaim-migrate @ 1140]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1125
diff
changeset
|
1505 |
3565 | 1506 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); |
1507 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, notebook_page++); | |
1508 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++); | |
1509 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
1510 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++); | |
3551 | 1511 #if USE_PLUGINS |
3565 | 1512 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); |
1513 while (l) { | |
1514 plug = l->data; | |
1515 if (plug->type == plugin && g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { | |
1516 plug->iter = g_new0(GtkTreeIter, 1); | |
1517 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); | |
1518 } | |
1519 l = l->next; | |
1520 } | |
3551 | 1521 #endif |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1522 } |
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1523 |
3500 | 1524 void show_prefs() |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1525 { |
3366 | 1526 GtkWidget *vbox, *vbox2; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1527 GtkWidget *hbox; |
3366 | 1528 GtkWidget *frame; |
1529 GtkTreeViewColumn *column; | |
1530 GtkCellRenderer *cell; | |
1531 GtkTreeSelection *sel; | |
1532 GtkWidget *notebook; | |
1533 GtkWidget *sep; | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1534 GtkWidget *button; |
3515 | 1535 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); |
3500 | 1536 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1537 if (prefs) { |
3472 | 1538 gtk_window_present(GTK_WINDOW(prefs)); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1539 return; |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1540 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1541 |
3366 | 1542 /* copy the preferences to tmp values... |
1543 * I liked "take affect immediately" Oh well :-( */ | |
3818 | 1544 |
1545 /* Back to instant-apply! I win! BU-HAHAHA! */ | |
3500 | 1546 |
3366 | 1547 /* Create the window */ |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1548 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
4074 | 1549 gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1550 gtk_widget_realize(prefs); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1551 gtk_window_set_title(GTK_WINDOW(prefs), _("Gaim - Preferences")); |
3366 | 1552 gtk_window_set_policy (GTK_WINDOW(prefs), FALSE, FALSE, TRUE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1553 g_signal_connect(GTK_OBJECT(prefs), "destroy", G_CALLBACK(delete_prefs), NULL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1554 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1555 vbox = gtk_vbox_new(FALSE, 5); |
1185 | 1556 gtk_container_border_width(GTK_CONTAINER(vbox), 5); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1557 gtk_container_add(GTK_CONTAINER(prefs), vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1558 gtk_widget_show(vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1559 |
3366 | 1560 hbox = gtk_hbox_new (FALSE, 6); |
1561 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1562 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
1563 gtk_widget_show (hbox); | |
1564 | |
1565 frame = gtk_frame_new (NULL); | |
1566 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1567 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
1568 gtk_widget_show (frame); | |
3500 | 1569 |
3366 | 1570 /* The tree -- much inspired by the Gimp */ |
1571 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
1572 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
1573 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
1574 | |
1575 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
1576 gtk_widget_show(tree_v); | |
1577 /* icons */ | |
1578 cell = gtk_cell_renderer_pixbuf_new (); | |
1579 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
3500 | 1580 |
3366 | 1581 /* text */ |
1582 cell = gtk_cell_renderer_text_new (); | |
1583 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
3500 | 1584 |
3366 | 1585 gtk_tree_view_append_column (GTK_TREE_VIEW (tree_v), column); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1586 |
3472 | 1587 /* The right side */ |
1588 frame = gtk_frame_new (NULL); | |
1589 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1590 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
1591 gtk_widget_show (frame); | |
3500 | 1592 |
3472 | 1593 vbox2 = gtk_vbox_new (FALSE, 4); |
1594 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
1595 gtk_widget_show (vbox2); | |
3500 | 1596 |
3472 | 1597 frame = gtk_frame_new (NULL); |
1598 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
1599 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
1600 gtk_widget_show (frame); | |
3500 | 1601 |
3472 | 1602 hbox = gtk_hbox_new (FALSE, 4); |
1603 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
1604 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
1605 gtk_widget_show (hbox); | |
3500 | 1606 |
3472 | 1607 preflabel = gtk_label_new(NULL); |
1608 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
1609 gtk_widget_show (preflabel); | |
3500 | 1610 |
3472 | 1611 /* The notebook */ |
1612 prefsnotebook = notebook = gtk_notebook_new (); | |
1613 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
1614 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
1615 gtk_box_pack_start (GTK_BOX (vbox2), notebook, FALSE, FALSE, 0); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1616 |
3472 | 1617 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); |
1618 g_signal_connect (G_OBJECT (sel), "changed", | |
1619 G_CALLBACK (pref_nb_select), | |
1620 notebook); | |
3500 | 1621 gtk_widget_show(notebook); |
3472 | 1622 sep = gtk_hseparator_new(); |
1623 gtk_widget_show(sep); | |
1624 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
3500 | 1625 |
3818 | 1626 /* The buttons^H to press! */ |
3472 | 1627 hbox = gtk_hbox_new (FALSE, 6); |
1628 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1629 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
3500 | 1630 gtk_widget_show (hbox); |
3377 | 1631 |
3818 | 1632 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); |
3515 | 1633 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1634 g_signal_connect_swapped(GTK_OBJECT(button), "clicked", G_CALLBACK(gtk_widget_destroy), prefs); |
3515 | 1635 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1636 gtk_widget_show(button); | |
1637 | |
3500 | 1638 prefs_notebook_init(); |
3427 | 1639 |
3472 | 1640 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); |
1641 gtk_widget_show(prefs); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1642 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1643 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1644 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1645 { |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1646 if (debugbutton) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1647 gtk_button_clicked(GTK_BUTTON(debugbutton)); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1648 if (misc_options & OPT_MISC_DEBUG) { |
3818 | 1649 misc_options ^= OPT_MISC_DEBUG; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1650 } |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1651 g_free(dw); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1652 dw = NULL; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1653 return FALSE; |
1 | 1654 |
1655 } | |
1656 | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1657 static void build_debug() |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1658 { |
4005 | 1659 GtkWidget *sw; |
1660 GtkTextBuffer *buffer; | |
1661 GtkTextIter end; | |
1662 | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1663 if (!dw) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1664 dw = g_new0(struct debug_window, 1); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1665 |
2725
f3c094e78609
[gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2676
diff
changeset
|
1666 GAIM_DIALOG(dw->window); |
4005 | 1667 gtk_window_set_default_size(GTK_WINDOW(dw->window), 500, 200); |
1668 gtk_window_set_role(GTK_WINDOW(dw->window), "debug"); | |
1669 gtk_window_set_title(GTK_WINDOW(dw->window), _("Gaim - Debug Window")); | |
1670 g_signal_connect(G_OBJECT(dw->window), "delete_event", G_CALLBACK(debug_delete), NULL); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1671 |
4005 | 1672 sw = gtk_scrolled_window_new(NULL, NULL); |
1673 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
1674 GTK_POLICY_NEVER, | |
1675 GTK_POLICY_ALWAYS); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1676 |
4005 | 1677 dw->entry = gtk_text_view_new(); |
1678 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(dw->entry), FALSE); | |
1679 gtk_text_view_set_editable(GTK_TEXT_VIEW(dw->entry), FALSE); | |
1680 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(dw->entry), GTK_WRAP_WORD); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1681 |
4005 | 1682 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(dw->entry)); |
1683 gtk_text_buffer_get_end_iter(buffer, &end); | |
1684 gtk_text_buffer_create_mark(buffer, "end", &end, FALSE); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1685 |
4005 | 1686 gtk_container_add(GTK_CONTAINER(sw), dw->entry); |
1687 gtk_container_add(GTK_CONTAINER(dw->window), sw); | |
1688 gtk_widget_show_all(dw->window); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1689 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1690 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1691 void show_debug() |
1 | 1692 { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1693 if ((misc_options & OPT_MISC_DEBUG)) { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1694 if (!dw || !dw->window) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1695 build_debug(); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1696 gtk_widget_show(dw->window); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1697 } else { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1698 if (!dw) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1699 return; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1700 gtk_widget_destroy(dw->window); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1701 dw->window = NULL; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1702 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1703 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1704 |
970 | 1705 void debug_printf(char *fmt, ...) |
1706 { | |
1707 va_list ap; | |
1708 gchar *s; | |
1709 | |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1710 va_start(ap, fmt); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1711 s = g_strdup_vprintf(fmt, ap); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1712 va_end(ap); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1713 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1714 if (misc_options & OPT_MISC_DEBUG && dw) { |
4005 | 1715 GtkTextBuffer *buffer; |
1716 GtkTextMark *endmark; | |
1717 GtkTextIter end; | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1718 |
4005 | 1719 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(dw->entry)); |
1720 endmark = gtk_text_buffer_get_mark(buffer, "end"); | |
1721 gtk_text_buffer_get_iter_at_mark(buffer, &end, endmark); | |
1722 gtk_text_buffer_insert(buffer, &end, s, -1); | |
1723 gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(dw->entry), endmark); | |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1724 } |
2823
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1725 if (opt_debug) |
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1726 g_print("%s", s); |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1727 g_free(s); |
970 | 1728 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1729 |
1 | 1730 void set_option(GtkWidget *w, int *option) |
1731 { | |
1732 *option = !(*option); | |
1733 } | |
1734 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1735 static void set_misc_option(GtkWidget *w, int option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1736 { |
3818 | 1737 misc_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1738 |
3818 | 1739 if (option == OPT_MISC_DEBUG) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1740 show_debug(); |
4227 | 1741 else if(option == OPT_MISC_USE_SERVER_ALIAS) { |
1742 redo_buddy_list(); | |
1743 build_edit_tree(); | |
1744 set_convo_titles(); | |
1745 } | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1746 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1747 |
3818 | 1748 static void set_logging_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1749 { |
3818 | 1750 logging_options ^= option; |
3500 | 1751 |
3818 | 1752 if (option == OPT_LOG_CONVOS || option == OPT_LOG_CHATS) |
1753 update_log_convs(); | |
3366 | 1754 } |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1755 |
3818 | 1756 static void set_blist_option(GtkWidget *w, int option) |
3366 | 1757 { |
3818 | 1758 blist_options ^= option; |
3500 | 1759 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1760 if (!blist) |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1761 return; |
3500 | 1762 |
3818 | 1763 if (option == OPT_BLIST_NO_BUTTONS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1764 build_imchat_box(!(blist_options & OPT_BLIST_NO_BUTTONS)); |
696
97b75ed155b0
[gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
683
diff
changeset
|
1765 |
3818 | 1766 if (option == OPT_BLIST_SHOW_GRPNUM) |
1070
b288f17c2fb2
[gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1767 update_num_groups(); |
9 | 1768 |
3818 | 1769 if (option == OPT_BLIST_NO_MT_GRP) |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1770 toggle_show_empty_groups(); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1771 |
3818 | 1772 if ((option == OPT_BLIST_SHOW_BUTTON_XPM) || (option == OPT_BLIST_NO_BUTTONS)) |
1296
11e5b1220028
[gaim-migrate @ 1306]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1269
diff
changeset
|
1773 update_button_pix(); |
11e5b1220028
[gaim-migrate @ 1306]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1269
diff
changeset
|
1774 |
3818 | 1775 if (option == OPT_BLIST_SHOW_PIXMAPS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1776 toggle_buddy_pixmaps(); |
2593
5ba9ef368b8e
[gaim-migrate @ 2606]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2592
diff
changeset
|
1777 |
3818 | 1778 if ((option == OPT_BLIST_GREY_IDLERS) || (option == OPT_BLIST_SHOW_IDLETIME)) |
2594 | 1779 update_idle_times(); |
3032 | 1780 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1781 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1782 |
3818 | 1783 static void set_convo_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1784 { |
3818 | 1785 convo_options ^= option; |
3500 | 1786 |
3818 | 1787 if (option == OPT_CONVO_SHOW_SMILEY) |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1788 toggle_smileys(); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1789 |
3818 | 1790 if (option == OPT_CONVO_SHOW_TIME) |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1791 toggle_timestamps(); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1792 |
3818 | 1793 if (option == OPT_CONVO_CHECK_SPELLING) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1794 toggle_spellchk(); |
3818 | 1795 } |
1796 | |
1797 static void set_im_option(GtkWidget *w, int option) | |
1798 { | |
1799 im_options ^= option; | |
3500 | 1800 |
3818 | 1801 if (option == OPT_IM_ONE_WINDOW) |
1802 im_tabize(); | |
1803 | |
1804 if (option == OPT_IM_HIDE_ICONS) | |
1805 set_hide_icons(); | |
1806 | |
1807 if (option == OPT_IM_ALIAS_TAB) { | |
1808 set_convo_titles(); | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1809 } |
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1810 |
3818 | 1811 if (option == OPT_IM_NO_ANIMATION) |
3013 | 1812 set_anim(); |
1 | 1813 } |
1814 | |
3818 | 1815 static void set_chat_option(GtkWidget *w, int option) |
1 | 1816 { |
3818 | 1817 chat_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1818 |
3818 | 1819 if (option == OPT_CHAT_ONE_WINDOW) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1820 chat_tabize(); |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1821 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1822 |
3818 | 1823 void set_sound_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1824 { |
3818 | 1825 sound_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1826 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1827 |
3818 | 1828 static void set_font_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1829 { |
3818 | 1830 font_options ^= option; |
3500 | 1831 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1832 update_font_buttons(); |
1 | 1833 } |
1834 | |
3818 | 1835 static void set_away_option(GtkWidget *w, int option) |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1836 { |
3818 | 1837 away_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1838 |
3818 | 1839 if (option == OPT_AWAY_QUEUE) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1840 toggle_away_queue(); |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1841 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1842 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1843 GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) |
1 | 1844 { |
1845 GtkWidget *button; | |
3427 | 1846 button = gtk_check_button_new_with_mnemonic(text); |
1 | 1847 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option)); |
1848 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); | |
3366 | 1849 gtk_object_set_user_data(GTK_OBJECT(button), options); |
1 | 1850 |
4064 | 1851 if (options == &misc_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1852 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_misc_option), |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1853 (int *)option); |
4064 | 1854 } else if (options == &logging_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1855 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_logging_option), |
3818 | 1856 (int *)option); |
4064 | 1857 } else if (options == &blist_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1858 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_blist_option), |
3818 | 1859 (int *)option); |
4064 | 1860 } else if (options == &convo_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1861 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_convo_option), |
3818 | 1862 (int *)option); |
4064 | 1863 } else if (options == &im_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1864 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_im_option), |
3818 | 1865 (int *)option); |
4064 | 1866 } else if (options == &chat_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1867 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_chat_option), |
3818 | 1868 (int *)option); |
4064 | 1869 } else if (options == &font_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1870 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_font_option), |
3818 | 1871 (int *)option); |
4064 | 1872 } else if (options == &sound_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1873 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_sound_option), |
3818 | 1874 (int *)option); |
4064 | 1875 } else if (options == &away_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1876 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_away_option), |
4064 | 1877 (int *)option); |
1878 } else { | |
1879 debug_printf("gaim_button: \"%s\" has no signal handler attached to it!\n", text); | |
1880 } | |
1 | 1881 gtk_widget_show(button); |
1882 | |
1883 return button; | |
1884 } | |
1885 | |
3366 | 1886 void away_list_clicked(GtkWidget *widget, struct away_message *a) |
1887 {} | |
1888 void default_away_menu_init(GtkWidget *omenu) | |
3032 | 1889 { |
3366 | 1890 GtkWidget *menu, *opt; |
1891 int index = 0; | |
1892 GSList *awy = away_messages; | |
1893 struct away_message *a; | |
1894 | |
1895 menu = gtk_menu_new(); | |
1896 | |
1897 while (awy) { | |
1898 a = (struct away_message *)awy->data; | |
1899 opt = gtk_menu_item_new_with_label(a->name); | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1900 g_signal_connect(GTK_OBJECT(opt), "activate", G_CALLBACK(set_default_away), |
3366 | 1901 (gpointer)index); |
1902 gtk_widget_show(opt); | |
1903 gtk_menu_append(GTK_MENU(menu), opt); | |
1904 | |
1905 awy = awy->next; | |
1906 index++; | |
1907 } | |
1908 | |
1909 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
1910 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
1911 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
1912 } | |
1913 | |
1914 GtkWidget *pref_fg_picture = NULL; | |
1915 GtkWidget *pref_bg_picture = NULL; | |
1916 | |
1917 void destroy_colorsel(GtkWidget *w, gpointer d) | |
1918 { | |
1919 if (d) { | |
1920 gtk_widget_destroy(fgcseld); | |
1921 fgcseld = NULL; | |
1922 } else { | |
1923 gtk_widget_destroy(bgcseld); | |
1924 bgcseld = NULL; | |
1925 } | |
3032 | 1926 } |
1927 | |
3366 | 1928 void apply_color_dlg(GtkWidget *w, gpointer d) |
3032 | 1929 { |
3366 | 1930 if ((int)d == 1) { |
1931 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 1932 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), |
3818 | 1933 &fgcolor); |
3366 | 1934 destroy_colorsel(NULL, (void *)1); |
1935 update_color(NULL, pref_fg_picture); | |
1936 } else { | |
1937 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 1938 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), |
3818 | 1939 &bgcolor); |
3366 | 1940 destroy_colorsel(NULL, (void *)0); |
1941 update_color(NULL, pref_bg_picture); | |
1942 } | |
3032 | 1943 } |
1944 | |
3366 | 1945 void update_color(GtkWidget *w, GtkWidget *pic) |
1 | 1946 { |
3366 | 1947 GdkColor c; |
1948 GtkStyle *style; | |
1949 c.pixel = 0; | |
3500 | 1950 |
3366 | 1951 if (pic == pref_fg_picture) { |
3818 | 1952 if (font_options & OPT_FONT_FGCOL) { |
1953 c.red = fgcolor.red; | |
1954 c.blue = fgcolor.blue; | |
1955 c.green = fgcolor.green; | |
3366 | 1956 } else { |
1957 c.red = 0; | |
1958 c.blue = 0; | |
1959 c.green = 0; | |
1960 } | |
1961 } else { | |
3818 | 1962 if (font_options & OPT_FONT_BGCOL) { |
1963 c.red = bgcolor.red; | |
1964 c.blue = bgcolor.blue; | |
1965 c.green = bgcolor.green; | |
3366 | 1966 } else { |
1967 c.red = 0xffff; | |
1968 c.blue = 0xffff; | |
1969 c.green = 0xffff; | |
1970 } | |
1971 } | |
1972 | |
1973 style = gtk_style_new(); | |
1974 style->bg[0] = c; | |
1975 gtk_widget_set_style(pic, style); | |
4296 | 1976 g_object_unref(style); |
3366 | 1977 } |
4064 | 1978 |
3366 | 1979 void set_default_away(GtkWidget *w, gpointer i) |
1980 { | |
1981 | |
1982 int length = g_slist_length(away_messages); | |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1983 |
3366 | 1984 if (away_messages == NULL) |
3818 | 1985 default_away = NULL; |
3366 | 1986 else if ((int)i >= length) |
3818 | 1987 default_away = g_slist_nth_data(away_messages, length - 1); |
3366 | 1988 else |
3818 | 1989 default_away = g_slist_nth_data(away_messages, (int)i); |
3366 | 1990 } |
3500 | 1991 |
3366 | 1992 static void update_spin_value(GtkWidget *w, GtkWidget *spin) |
1993 { | |
1994 int *value = gtk_object_get_user_data(GTK_OBJECT(spin)); | |
1995 *value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); | |
1996 } | |
4064 | 1997 |
3427 | 1998 GtkWidget *gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val, int min, int max, GtkSizeGroup *sg) |
3366 | 1999 { |
2000 GtkWidget *hbox; | |
2001 GtkWidget *label; | |
2002 GtkWidget *spin; | |
2003 GtkObject *adjust; | |
901
f168f2c7b357
[gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
893
diff
changeset
|
2004 |
3366 | 2005 hbox = gtk_hbox_new(FALSE, 5); |
2006 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
2007 gtk_widget_show(hbox); | |
2008 | |
3427 | 2009 label = gtk_label_new_with_mnemonic(title); |
3366 | 2010 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
2011 gtk_widget_show(label); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
2012 |
3366 | 2013 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1); |
2014 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); | |
2015 gtk_object_set_user_data(GTK_OBJECT(spin), val); | |
2016 gtk_widget_set_usize(spin, 50, -1); | |
2017 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2018 g_signal_connect(GTK_OBJECT(adjust), "value-changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2019 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
3366 | 2020 gtk_widget_show(spin); |
3500 | 2021 |
3427 | 2022 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); |
2023 | |
2024 if (sg) { | |
2025 gtk_size_group_add_widget(sg, label); | |
2026 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3500 | 2027 |
3427 | 2028 } |
2029 return label; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2030 } |
1 | 2031 |
3366 | 2032 void dropdown_set(GtkObject *w, int *option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2033 { |
3366 | 2034 int opt = (int)gtk_object_get_user_data(w); |
2035 int clear = (int)gtk_object_get_data(w, "clear"); | |
3500 | 2036 |
3366 | 2037 if (clear != -1) { |
2038 *option = *option & ~clear; | |
2039 *option = *option | opt; | |
2040 } else { | |
2041 debug_printf("HELLO %d\n", opt); | |
2042 *option = opt; | |
2043 } | |
3500 | 2044 |
3818 | 2045 if (option == &proxytype) { |
3366 | 2046 if (opt == PROXY_NONE) |
2047 gtk_widget_set_sensitive(prefs_proxy_frame, FALSE); | |
2048 else | |
2049 gtk_widget_set_sensitive(prefs_proxy_frame, TRUE); | |
3818 | 2050 } else if (option == &web_browser) { |
3366 | 2051 if (opt == BROWSER_MANUAL) |
2052 gtk_widget_set_sensitive(browser_entry, TRUE); | |
2053 else | |
2054 gtk_widget_set_sensitive(browser_entry, FALSE); | |
3818 | 2055 } else if (option == (int*)&sound_options) { |
3366 | 2056 if (opt == OPT_SOUND_CMD) |
2057 gtk_widget_set_sensitive(sndcmd, TRUE); | |
2058 else | |
2059 gtk_widget_set_sensitive(sndcmd, FALSE); | |
3818 | 2060 } else if (option == (int*)&im_options) { |
2061 if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) | |
2062 update_im_tabs(); | |
2063 else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) | |
2064 update_im_button_pix(); | |
2065 } else if (option == (int*)&chat_options) { | |
2066 if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) | |
4089
7f4f3aa61069
[gaim-migrate @ 4304]
Christian Hammond <chipx86@chipx86.com>
parents:
4082
diff
changeset
|
2067 update_chat_tabs(); |
3818 | 2068 else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) |
4089
7f4f3aa61069
[gaim-migrate @ 4304]
Christian Hammond <chipx86@chipx86.com>
parents:
4082
diff
changeset
|
2069 update_chat_button_pix(); |
3818 | 2070 } else if (option == (int*)&blist_options) { |
2071 set_blist_tab(); | |
3366 | 2072 } |
1 | 2073 } |
2074 | |
3500 | 2075 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) |
1 | 2076 { |
3366 | 2077 va_list menuitems; |
2078 GtkWidget *dropdown, *opt, *menu; | |
2079 GtkWidget *label; | |
2080 gchar *text; | |
2081 int value; | |
2082 int o = 0; | |
2083 GtkWidget *hbox; | |
1 | 2084 |
3366 | 2085 hbox = gtk_hbox_new(FALSE, 5); |
2086 gtk_container_add (GTK_CONTAINER (box), hbox); | |
2087 gtk_widget_show(hbox); | |
2088 | |
3427 | 2089 label = gtk_label_new_with_mnemonic(title); |
3366 | 2090 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
2091 gtk_widget_show(label); | |
2092 | |
2093 va_start(menuitems, clear); | |
2094 text = va_arg(menuitems, gchar *); | |
2095 | |
2096 if (!text) | |
2097 return NULL; | |
3500 | 2098 |
3366 | 2099 dropdown = gtk_option_menu_new(); |
2100 menu = gtk_menu_new(); | |
3500 | 2101 |
3427 | 2102 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); |
3500 | 2103 |
3366 | 2104 while (text) { |
2105 value = va_arg(menuitems, int); | |
2106 opt = gtk_menu_item_new_with_label(text); | |
2107 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)value); | |
2108 gtk_object_set_data(GTK_OBJECT(opt), "clear", (void *)clear); | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2109 g_signal_connect(GTK_OBJECT(opt), "activate", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2110 G_CALLBACK(dropdown_set), (void *)option); |
3366 | 2111 gtk_widget_show(opt); |
2112 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
1 | 2113 |
3366 | 2114 if (((clear > -1) && ((*option & value) == value)) || *option == value) { |
2115 gtk_menu_set_active(GTK_MENU(menu), o); | |
2116 } | |
2117 text = va_arg(menuitems, gchar *); | |
2118 o++; | |
2119 } | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
2120 |
3366 | 2121 va_end(menuitems); |
1 | 2122 |
3500 | 2123 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
3366 | 2124 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); |
2125 gtk_widget_show(dropdown); | |
3427 | 2126 return label; |
3500 | 2127 } |
2128 | |
3366 | 2129 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) |
1 | 2130 { |
3366 | 2131 /* more stuff stolen from X-Chat */ |
2132 GtkWidget *swid; | |
2133 GdkColor c; | |
2134 GtkStyle *style; | |
2135 c.pixel = 0; | |
2136 if (fgc) { | |
3818 | 2137 if (font_options & OPT_FONT_FGCOL) { |
2138 c.red = fgcolor.red; | |
2139 c.blue = fgcolor.blue; | |
2140 c.green = fgcolor.green; | |
3366 | 2141 } else { |
2142 c.red = 0; | |
2143 c.blue = 0; | |
2144 c.green = 0; | |
2145 } | |
2146 } else { | |
3818 | 2147 if (font_options & OPT_FONT_BGCOL) { |
2148 c.red = bgcolor.red; | |
2149 c.blue = bgcolor.blue; | |
2150 c.green = bgcolor.green; | |
3366 | 2151 } else { |
2152 c.red = 0xffff; | |
2153 c.blue = 0xffff; | |
2154 c.green = 0xffff; | |
2155 } | |
2156 } | |
1 | 2157 |
3366 | 2158 style = gtk_style_new(); |
2159 style->bg[0] = c; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2160 |
3366 | 2161 swid = gtk_event_box_new(); |
2162 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
4296 | 2163 g_object_unref(style); |
3366 | 2164 gtk_widget_set_usize(GTK_WIDGET(swid), 40, -1); |
2165 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); | |
2166 gtk_widget_show(swid); | |
2167 return swid; | |
1 | 2168 } |
4064 | 2169 |
3366 | 2170 void apply_font_dlg(GtkWidget *w, GtkWidget *f) |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2171 { |
3366 | 2172 int i = 0; |
2173 char *fontname; | |
2174 | |
3473 | 2175 fontname = g_strdup(gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f))); |
3366 | 2176 destroy_fontsel(0, 0); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2177 |
3818 | 2178 while(fontname[i] && !isdigit(fontname[i]) && i < sizeof(fontface)) { |
2179 fontface[i] = fontname[i]; | |
3366 | 2180 i++; |
2181 } | |
3818 | 2182 fontface[i] = 0; |
3366 | 2183 g_free(fontname); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2184 } |
3500 | 2185 |