Mercurial > pidgin.yaz
annotate src/gtkprefs.c @ 5541:aee0ee458974
[gaim-migrate @ 5941]
Oops.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Tue, 27 May 2003 22:44:06 +0000 |
parents | de09863bd4b5 |
children | 7a64114641c3 |
rev | line source |
---|---|
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1 /** |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2 * @file gtkprefs.c GTK+ Preferences |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
3 * @ingroup gtkui |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
4 * |
5440 | 5 * gaim |
6 * | |
7 * Copyright (C) 1998-2002, Mark Spencer <markster@marko.net> | |
8 * | |
9 * This program is free software; you can redistribute it and/or modify | |
10 * it under the terms of the GNU General Public License as published by | |
11 * the Free Software Foundation; either version 2 of the License, or | |
12 * (at your option) any later version. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program; if not, write to the Free Software | |
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 * | |
23 */ | |
24 | |
25 #ifdef HAVE_CONFIG_H | |
26 #include <config.h> | |
27 #endif | |
28 #include <string.h> | |
29 #include <sys/time.h> | |
30 | |
31 #include <sys/types.h> | |
32 #include <sys/stat.h> | |
33 | |
34 #include <unistd.h> | |
35 #include <stdio.h> | |
36 #include <stdlib.h> | |
37 #include <stdarg.h> | |
38 #include <ctype.h> | |
39 #include <gtk/gtk.h> | |
40 #include "gtkimhtml.h" | |
41 #include "gaim.h" | |
42 #include "gtkblist.h" | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
43 #include "gtkdebug.h" |
5440 | 44 #include "gtkplugin.h" |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
45 #include "gtkprefs.h" |
5440 | 46 #include "prpl.h" |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
47 #include "prefs.h" |
5440 | 48 #include "proxy.h" |
49 #include "sound.h" | |
50 #include "notify.h" | |
51 | |
52 #ifdef _WIN32 | |
53 #include "win32dep.h" | |
54 #endif | |
55 | |
56 GtkWidget *tree_v = NULL; | |
57 GtkWidget *prefs_away_menu = NULL; | |
58 GtkWidget *fontseld = NULL; | |
59 | |
60 GtkListStore *prefs_away_store = NULL; | |
61 | |
62 static int sound_row_sel = 0; | |
63 static char *last_sound_dir = NULL; | |
64 | |
65 static GtkWidget *sounddialog = NULL; | |
66 static GtkWidget *browser_entry = NULL; | |
67 static GtkWidget *sound_entry = NULL; | |
68 static GtkWidget *away_text = NULL; | |
69 static GtkListStore *smiley_theme_store = NULL; | |
70 GtkWidget *prefs_proxy_frame = NULL; | |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
71 static GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); |
5440 | 72 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int, GtkSizeGroup *); |
73 static GtkWidget *gaim_dropdown(GtkWidget *, const gchar *, int *, int, ...); | |
74 static GtkWidget *gaim_dropdown_from_list(GtkWidget *, const gchar *, int *, int, GList *); | |
75 static GtkWidget *show_color_pref(GtkWidget *, gboolean); | |
76 static void delete_prefs(GtkWidget *, void *); | |
77 void set_default_away(GtkWidget *, gpointer); | |
78 #ifndef _WIN32 | |
79 static gboolean program_is_valid(const char *); | |
80 #endif | |
81 | |
82 static GtkWidget *prefs = NULL; | |
83 GtkWidget *debugbutton = NULL; | |
84 static int notebook_page = 0; | |
85 static GtkTreeIter plugin_iter; | |
86 | |
87 /* | |
88 * PROTOTYPES | |
89 */ | |
90 GtkTreeIter *prefs_notebook_add_page(const char*, GdkPixbuf*, GtkWidget*, GtkTreeIter*, GtkTreeIter*, int); | |
91 | |
92 static void update_plugin_list(void *data); | |
93 | |
94 void delete_prefs(GtkWidget *asdf, void *gdsa) { | |
95 GList *l; | |
96 GaimPlugin *plug; | |
97 | |
98 gaim_plugins_unregister_probe_notify_cb(update_plugin_list); | |
99 | |
100 save_prefs(); | |
101 prefs = NULL; | |
102 tree_v = NULL; | |
103 sound_entry = NULL; | |
104 browser_entry = NULL; | |
105 debugbutton = NULL; | |
106 prefs_away_menu = NULL; | |
107 notebook_page = 0; | |
108 smiley_theme_store = NULL; | |
109 if(sounddialog) | |
110 gtk_widget_destroy(sounddialog); | |
111 g_object_unref(G_OBJECT(prefs_away_store)); | |
112 prefs_away_store = NULL; | |
113 | |
114 for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { | |
115 plug = l->data; | |
116 | |
117 if (GAIM_IS_GTK_PLUGIN(plug)) { | |
118 GaimGtkPluginUiInfo *ui_info; | |
119 | |
120 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
121 | |
122 if (ui_info->iter != NULL) { | |
123 g_free(ui_info->iter); | |
124 ui_info->iter = NULL; | |
125 } | |
126 } | |
127 } | |
128 } | |
129 | |
130 GtkWidget *preflabel; | |
131 GtkWidget *prefsnotebook; | |
132 GtkTreeStore *prefstree; | |
133 | |
134 static void set_misc_option(); | |
135 static void set_logging_option(); | |
136 static void set_blist_option(); | |
137 static void set_convo_option(); | |
138 static void set_im_option(); | |
139 static void set_chat_option(); | |
140 static void set_font_option(); | |
141 static void set_sound_option(); | |
142 static void set_away_option(); | |
143 | |
144 #define PROXYHOST 0 | |
145 #define PROXYPORT 1 | |
146 #define PROXYTYPE 2 | |
147 #define PROXYUSER 3 | |
148 #define PROXYPASS 4 | |
149 static void proxy_print_option(GtkEntry *entry, int entrynum) | |
150 { | |
151 if (entrynum == PROXYHOST) | |
152 g_snprintf(global_proxy_info.proxyhost, sizeof(global_proxy_info.proxyhost), "%s", gtk_entry_get_text(entry)); | |
153 else if (entrynum == PROXYPORT) | |
154 global_proxy_info.proxyport = atoi(gtk_entry_get_text(entry)); | |
155 else if (entrynum == PROXYUSER) | |
156 g_snprintf(global_proxy_info.proxyuser, sizeof(global_proxy_info.proxyuser), "%s", gtk_entry_get_text(entry)); | |
157 else if (entrynum == PROXYPASS) | |
158 g_snprintf(global_proxy_info.proxypass, sizeof(global_proxy_info.proxypass), "%s", gtk_entry_get_text(entry)); | |
159 proxy_info_is_from_gaimrc = 1; /* If the user specifies it, we want | |
160 to save it */ | |
161 } | |
162 | |
163 /* OK, Apply and Cancel */ | |
164 | |
165 static void pref_nb_select(GtkTreeSelection *sel, GtkNotebook *nb) { | |
166 GtkTreeIter iter; | |
167 char text[128]; | |
168 GValue val = { 0, }; | |
169 GtkTreeModel *model = GTK_TREE_MODEL(prefstree); | |
170 | |
171 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
172 return; | |
173 gtk_tree_model_get_value (model, &iter, 1, &val); | |
174 g_snprintf(text, sizeof(text), "<span weight=\"bold\" size=\"larger\">%s</span>", | |
175 g_value_get_string(&val)); | |
176 gtk_label_set_markup (GTK_LABEL(preflabel), text); | |
177 g_value_unset (&val); | |
178 gtk_tree_model_get_value (model, &iter, 2, &val); | |
179 gtk_notebook_set_current_page (GTK_NOTEBOOK (prefsnotebook), g_value_get_int (&val)); | |
180 | |
181 } | |
182 | |
183 /* These are the pages in the preferences notebook */ | |
184 GtkWidget *interface_page() { | |
185 GtkWidget *ret; | |
186 GtkWidget *vbox; | |
187 ret = gtk_vbox_new(FALSE, 18); | |
188 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
189 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
190 vbox = gaim_gtk_make_frame(ret, _("Interface Options")); |
5440 | 191 |
192 gaim_button(_("D_isplay remote nicknames if no alias is set"), &misc_options, OPT_MISC_USE_SERVER_ALIAS, vbox); | |
193 | |
194 | |
195 gtk_widget_show_all(ret); | |
196 return ret; | |
197 } | |
198 | |
199 static void smiley_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
200 GtkTreeIter iter; | |
201 const char *filename; | |
202 GValue val = { 0, }; | |
203 | |
204 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
205 return; | |
206 gtk_tree_model_get_value (model, &iter, 2, &val); | |
207 filename = g_value_get_string(&val); | |
208 load_smiley_theme(filename, TRUE); | |
209 g_value_unset (&val); | |
210 save_prefs(); | |
211 } | |
212 | |
213 GtkTreePath *theme_refresh_theme_list() | |
214 { | |
215 GdkPixbuf *pixbuf; | |
216 GSList *themes; | |
217 GtkTreeIter iter; | |
218 GtkTreePath *path = NULL; | |
219 int ind = 0; | |
220 | |
221 | |
222 smiley_theme_probe(); | |
223 | |
224 if (!smiley_themes) | |
225 return NULL; | |
226 | |
227 themes = smiley_themes; | |
228 | |
229 gtk_list_store_clear(smiley_theme_store); | |
230 | |
231 while (themes) { | |
232 struct smiley_theme *theme = themes->data; | |
233 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" | |
234 "<span size='smaller' foreground='dim grey'>%s</span>", | |
235 theme->name, theme->author, theme->desc); | |
236 gtk_list_store_append (smiley_theme_store, &iter); | |
237 pixbuf = gdk_pixbuf_new_from_file(theme->icon, NULL); | |
238 | |
239 gtk_list_store_set(smiley_theme_store, &iter, | |
240 0, pixbuf, | |
241 1, description, | |
242 2, theme->path, | |
243 -1); | |
244 g_object_unref(G_OBJECT(pixbuf)); | |
245 g_free(description); | |
246 themes = themes->next; | |
247 if (current_smiley_theme && !strcmp(theme->path, current_smiley_theme->path)) { | |
248 /* path = gtk_tree_path_new_from_indices(ind); */ | |
249 char *iwishihadgtk2_2 = g_strdup_printf("%d", ind); | |
250 path = gtk_tree_path_new_from_string(iwishihadgtk2_2); | |
251 g_free(iwishihadgtk2_2); | |
252 } | |
253 ind++; | |
254 } | |
255 | |
256 return path; | |
257 } | |
258 | |
259 void theme_install_theme(char *path, char *extn) { | |
260 #ifndef _WIN32 | |
261 gchar *command; | |
262 #endif | |
263 gchar *destdir; | |
264 gchar *tail; | |
265 | |
266 /* Just to be safe */ | |
267 g_strchomp(path); | |
268 | |
269 /* I dont know what you are, get out of here */ | |
270 if (extn != NULL) | |
271 tail = extn; | |
272 else if ((tail = strrchr(path, '.')) == NULL) | |
273 return; | |
274 | |
275 destdir = g_strconcat(gaim_user_dir(), G_DIR_SEPARATOR_S "smileys", NULL); | |
276 | |
277 /* We'll check this just to make sure. This also lets us do something different on | |
278 * other platforms, if need be */ | |
279 if (!g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz")) { | |
280 #ifndef _WIN32 | |
281 command = g_strdup_printf("tar > /dev/null xzf \"%s\" -C %s", path, destdir); | |
282 #else | |
283 if(!wgaim_gz_untar(path, destdir)) { | |
284 g_free(destdir); | |
285 return; | |
286 } | |
287 #endif | |
288 } | |
289 else { | |
290 g_free(destdir); | |
291 return; | |
292 } | |
293 | |
294 #ifndef _WIN32 | |
295 /* Fire! */ | |
296 system(command); | |
297 | |
298 g_free(command); | |
299 #endif | |
300 g_free(destdir); | |
301 | |
302 theme_refresh_theme_list(); | |
303 } | |
304 | |
305 static void theme_got_url(gpointer data, char *themedata, unsigned long len) { | |
306 FILE *f; | |
307 gchar *path; | |
308 | |
309 f = gaim_mkstemp(&path); | |
310 fwrite(themedata, len, 1, f); | |
311 fclose(f); | |
312 | |
313 theme_install_theme(path, data); | |
314 | |
315 unlink(path); | |
316 g_free(path); | |
317 } | |
318 | |
319 void theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, GtkSelectionData *sd, | |
320 guint info, guint t, gpointer data) { | |
321 gchar *name = sd->data; | |
322 | |
323 if ((sd->length >= 0) && (sd->format == 8)) { | |
324 /* Well, it looks like the drag event was cool. | |
325 * Let's do something with it */ | |
326 | |
327 if (!g_ascii_strncasecmp(name, "file://", 7)) { | |
328 GError *converr = NULL; | |
329 gchar *tmp; | |
330 /* It looks like we're dealing with a local file. Let's | |
331 * just untar it in the right place */ | |
332 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { | |
333 gaim_debug(GAIM_DEBUG_ERROR, "theme dnd", "%s\n", | |
334 (converr ? converr->message : | |
335 "g_filename_from_uri error")); | |
336 return; | |
337 } | |
338 theme_install_theme(tmp, NULL); | |
339 g_free(tmp); | |
340 } else if (!g_ascii_strncasecmp(name, "http://", 7)) { | |
341 /* Oo, a web drag and drop. This is where things | |
342 * will start to get interesting */ | |
343 gchar *tail; | |
344 | |
345 if ((tail = strrchr(name, '.')) == NULL) | |
346 return; | |
347 | |
348 /* We'll check this just to make sure. This also lets us do something different on | |
349 * other platforms, if need be */ | |
350 grab_url(name, TRUE, theme_got_url, ".tgz"); | |
351 } | |
352 | |
353 gtk_drag_finish(dc, TRUE, FALSE, t); | |
354 } | |
355 | |
356 gtk_drag_finish(dc, FALSE, FALSE, t); | |
357 } | |
358 | |
359 GtkWidget *theme_page() { | |
360 GtkWidget *ret; | |
361 GtkWidget *sw; | |
362 GtkWidget *view; | |
363 GtkCellRenderer *rend; | |
364 GtkTreeViewColumn *col; | |
365 GtkTreeSelection *sel; | |
366 GtkTreePath *path = NULL; | |
367 GtkWidget *label; | |
368 GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}}; | |
369 | |
370 ret = gtk_vbox_new(FALSE, 18); | |
371 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
372 | |
373 label = gtk_label_new(_("Select a smiley theme that you would like to use from the list below. New themes can be installed by dragging and dropping them onto the theme list.")); | |
374 | |
375 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
376 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
377 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); | |
378 | |
379 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); | |
380 gtk_widget_show(label); | |
381 | |
382 sw = gtk_scrolled_window_new(NULL,NULL); | |
383 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
384 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
385 | |
386 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
387 smiley_theme_store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
388 | |
389 path = theme_refresh_theme_list(); | |
390 | |
391 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); | |
392 | |
393 gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, | |
394 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); | |
395 | |
396 g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store); | |
397 | |
398 rend = gtk_cell_renderer_pixbuf_new(); | |
399 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); | |
400 | |
401 if(path) { | |
402 gtk_tree_selection_select_path(sel, path); | |
403 gtk_tree_path_free(path); | |
404 } | |
405 | |
406 col = gtk_tree_view_column_new_with_attributes (_("Icon"), | |
407 rend, | |
408 "pixbuf", 0, | |
409 NULL); | |
410 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
411 | |
412 rend = gtk_cell_renderer_text_new(); | |
413 col = gtk_tree_view_column_new_with_attributes (_("Description"), | |
414 rend, | |
415 "markup", 1, | |
416 NULL); | |
417 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
418 g_object_unref(G_OBJECT(smiley_theme_store)); | |
419 gtk_container_add(GTK_CONTAINER(sw), view); | |
420 | |
421 g_signal_connect (G_OBJECT (sel), "changed", | |
422 G_CALLBACK (smiley_sel), | |
423 NULL); | |
424 | |
425 | |
426 gtk_widget_show_all(ret); | |
427 return ret; | |
428 } | |
429 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
430 static void update_color(GtkWidget *w, GtkWidget *pic) |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
431 { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
432 GdkColor c; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
433 GtkStyle *style; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
434 c.pixel = 0; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
435 |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
436 if (pic == pref_fg_picture) { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
437 if (font_options & OPT_FONT_FGCOL) { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
438 c.red = fgcolor.red; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
439 c.blue = fgcolor.blue; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
440 c.green = fgcolor.green; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
441 } else { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
442 c.red = 0; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
443 c.blue = 0; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
444 c.green = 0; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
445 } |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
446 } else { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
447 if (font_options & OPT_FONT_BGCOL) { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
448 c.red = bgcolor.red; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
449 c.blue = bgcolor.blue; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
450 c.green = bgcolor.green; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
451 } else { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
452 c.red = 0xffff; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
453 c.blue = 0xffff; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
454 c.green = 0xffff; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
455 } |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
456 } |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
457 |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
458 style = gtk_style_new(); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
459 style->bg[0] = c; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
460 gtk_widget_set_style(pic, style); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
461 g_object_unref(style); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
462 } |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
463 |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
464 static void |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
465 set_bool_pref(GtkWidget *w, const char *key) |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
466 { |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
467 gaim_prefs_set_bool(key, |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
468 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
469 } |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
470 |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
471 static GtkWidget * |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
472 pref_checkbox(const char *text, char *key, GtkWidget *page) |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
473 { |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
474 GtkWidget *button; |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
475 |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
476 button = gtk_check_button_new_with_mnemonic(text); |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
477 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
478 gaim_prefs_get_bool(key)); |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
479 |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
480 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
481 |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
482 g_signal_connect(G_OBJECT(button), "clicked", |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
483 G_CALLBACK(set_bool_pref), key); |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
484 |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
485 gtk_widget_show(button); |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
486 |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
487 return button; |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
488 } |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
489 |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
490 |
5440 | 491 GtkWidget *font_page() { |
492 GtkWidget *ret; | |
493 GtkWidget *button; | |
494 GtkWidget *vbox, *hbox; | |
495 GtkWidget *select = NULL; | |
496 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
497 | |
498 ret = gtk_vbox_new(FALSE, 18); | |
499 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
500 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
501 vbox = gaim_gtk_make_frame(ret, _("Style")); |
5440 | 502 gaim_button(_("_Bold"), &font_options, OPT_FONT_BOLD, vbox); |
503 gaim_button(_("_Italics"), &font_options, OPT_FONT_ITALIC, vbox); | |
504 gaim_button(_("_Underline"), &font_options, OPT_FONT_UNDERLINE, vbox); | |
505 gaim_button(_("_Strikethrough"), &font_options, OPT_FONT_STRIKE, vbox); | |
506 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
507 vbox = gaim_gtk_make_frame(ret, _("Face")); |
5440 | 508 hbox = gtk_hbox_new(FALSE, 6); |
509 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
510 button = gaim_button(_("Use custo_m face"), &font_options, OPT_FONT_FACE, hbox); | |
511 gtk_size_group_add_widget(sg, button); | |
512 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); | |
513 | |
514 if (!(font_options & OPT_FONT_FACE)) | |
515 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
516 g_signal_connect(G_OBJECT(button), "clicked", | |
517 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
518 g_signal_connect(G_OBJECT(select), "clicked", | |
519 G_CALLBACK(show_font_dialog), NULL); | |
520 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
521 | |
522 hbox = gtk_hbox_new(FALSE, 5); | |
523 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
524 button = gaim_button(_("Use custom si_ze"), &font_options, OPT_FONT_SIZE, hbox); | |
525 gtk_size_group_add_widget(sg, button); | |
526 select = gaim_labeled_spin_button(hbox, NULL, &fontsize, 1, 7, NULL); | |
527 if (!(font_options & OPT_FONT_SIZE)) | |
528 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
529 g_signal_connect(G_OBJECT(button), "clicked", | |
530 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
531 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
532 vbox = gaim_gtk_make_frame(ret, _("Color")); |
5440 | 533 hbox = gtk_hbox_new(FALSE, 5); |
534 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
535 | |
536 | |
537 button = gaim_button(_("_Text color"), &font_options, OPT_FONT_FGCOL, hbox); | |
538 gtk_size_group_add_widget(sg, button); | |
539 | |
540 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
541 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
542 pref_fg_picture = show_color_pref(hbox, TRUE); | |
543 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(update_color), | |
544 pref_fg_picture); | |
545 | |
546 if (!(font_options & OPT_FONT_FGCOL)) | |
547 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
548 g_signal_connect(G_OBJECT(button), "clicked", | |
549 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
550 g_signal_connect(G_OBJECT(select), "clicked", G_CALLBACK(show_fgcolor_dialog), NULL); | |
551 hbox = gtk_hbox_new(FALSE, 5); | |
552 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
553 | |
554 button = gaim_button(_("Bac_kground color"), &font_options, OPT_FONT_BGCOL, hbox); | |
555 gtk_size_group_add_widget(sg, button); | |
556 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
557 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
558 pref_bg_picture = show_color_pref(hbox, FALSE); | |
559 g_signal_connect(G_OBJECT(button), "clicked", | |
560 G_CALLBACK(update_color), pref_bg_picture); | |
561 | |
562 if (!(font_options & OPT_FONT_BGCOL)) | |
563 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
564 g_signal_connect(G_OBJECT(select), "clicked", | |
565 G_CALLBACK(show_bgcolor_dialog), NULL); | |
566 g_signal_connect(G_OBJECT(button), "clicked", | |
567 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
568 | |
569 gtk_widget_show_all(ret); | |
570 return ret; | |
571 } | |
572 | |
573 | |
574 GtkWidget *messages_page() { | |
575 GtkWidget *ret; | |
576 GtkWidget *vbox; | |
577 ret = gtk_vbox_new(FALSE, 18); | |
578 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
579 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
580 vbox = gaim_gtk_make_frame (ret, _("Display")); |
5440 | 581 gaim_button(_("Show graphical _smileys"), &convo_options, OPT_CONVO_SHOW_SMILEY, vbox); |
582 gaim_button(_("Show _timestamp on messages"), &convo_options, OPT_CONVO_SHOW_TIME, vbox); | |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
583 pref_checkbox(_("Show _URLs as links"), |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
584 "/gaim/gtk/conversations/show_urls_as_links", vbox); |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
585 |
5440 | 586 #ifdef USE_GTKSPELL |
587 gaim_button(_("_Highlight misspelled words"), &convo_options, OPT_CONVO_CHECK_SPELLING, vbox); | |
588 #endif | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
589 vbox = gaim_gtk_make_frame (ret, _("Ignore")); |
5440 | 590 gaim_button(_("Ignore c_olors"), &convo_options, OPT_CONVO_IGNORE_COLOUR, vbox); |
591 gaim_button(_("Ignore font _faces"), &convo_options, OPT_CONVO_IGNORE_FONTS, vbox); | |
592 gaim_button(_("Ignore font si_zes"), &convo_options, OPT_CONVO_IGNORE_SIZES, vbox); | |
593 | |
594 gtk_widget_show_all(ret); | |
595 return ret; | |
596 } | |
597 | |
598 GtkWidget *hotkeys_page() { | |
599 GtkWidget *ret; | |
600 GtkWidget *vbox; | |
601 ret = gtk_vbox_new(FALSE, 18); | |
602 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
603 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
604 vbox = gaim_gtk_make_frame(ret, _("Send Message")); |
5440 | 605 gaim_button(_("_Enter sends message"), &convo_options, OPT_CONVO_ENTER_SENDS, vbox); |
606 gaim_button(_("C_ontrol-Enter sends message"), &convo_options, OPT_CONVO_CTL_ENTER, vbox); | |
607 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
608 vbox = gaim_gtk_make_frame (ret, _("Window Closing")); |
5440 | 609 gaim_button(_("E_scape closes window"), &convo_options, OPT_CONVO_ESC_CAN_CLOSE, vbox); |
610 gaim_button(_("Control-_W closes window"), &convo_options, OPT_CONVO_CTL_W_CLOSES, vbox); | |
611 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
612 vbox = gaim_gtk_make_frame(ret, _("Insertions")); |
5440 | 613 gaim_button(_("Control-{B/I/U/S} inserts _HTML tags"), &convo_options, OPT_CONVO_CTL_CHARS, vbox); |
614 gaim_button(_("Control-(number) inserts _smileys"), &convo_options, OPT_CONVO_CTL_SMILEYS, vbox); | |
615 | |
616 gtk_widget_show_all(ret); | |
617 return ret; | |
618 } | |
619 | |
620 GtkWidget *list_page() { | |
621 GtkWidget *ret; | |
622 GtkWidget *vbox; | |
623 GtkWidget *button, *b2; | |
624 int r = 0; | |
625 gboolean fnd = FALSE; | |
626 GList *l= NULL; | |
627 GSList *sl = gaim_gtk_blist_sort_methods; | |
628 ret = gtk_vbox_new(FALSE, 18); | |
629 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
630 | |
631 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
632 vbox = gaim_gtk_make_frame (ret, _("Buddy List Sorting")); |
5440 | 633 while (sl) { |
634 l = g_list_append(l, ((struct gaim_gtk_blist_sort_method*)sl->data)->name); | |
635 l = g_list_append(l, ((struct gaim_gtk_blist_sort_method*)sl->data)->name); | |
636 if (!fnd && !gaim_utf8_strcasecmp(((struct gaim_gtk_blist_sort_method*)sl->data)->name, sort_method)) | |
637 fnd = TRUE; | |
638 sl = sl->next; | |
639 if (!fnd) r++; | |
640 } | |
641 gaim_dropdown_from_list(vbox, _("Sorting:"), | |
642 (int*)&sort_method, r, l); | |
643 | |
644 g_list_free(l); | |
645 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
646 vbox = gaim_gtk_make_frame (ret, _("Buddy List Toolbar")); |
5440 | 647 gaim_dropdown(vbox, _("Show _buttons as:"), &blist_options, OPT_BLIST_SHOW_BUTTON_XPM | OPT_BLIST_NO_BUTTON_TEXT, |
648 _("Pictures"), OPT_BLIST_SHOW_BUTTON_XPM | OPT_BLIST_NO_BUTTON_TEXT, | |
649 _("Text"), 0, | |
650 _("Pictures and text"), OPT_BLIST_SHOW_BUTTON_XPM, | |
651 _("None"), OPT_BLIST_NO_BUTTON_TEXT, NULL); | |
652 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
653 vbox = gaim_gtk_make_frame (ret, _("Buddy List Window")); |
5440 | 654 gaim_button(_("_Raise window on events"), &blist_options, OPT_BLIST_POPUP, vbox); |
655 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
656 vbox = gaim_gtk_make_frame (ret, _("Group Display")); |
5440 | 657 /* gaim_button(_("Hide _groups with no online buddies"), &blist_options, OPT_BLIST_NO_MT_GRP, vbox); */ |
658 gaim_button(_("Show _numbers in groups"), &blist_options, OPT_BLIST_SHOW_GRPNUM, vbox); | |
659 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
660 vbox = gaim_gtk_make_frame (ret, _("Buddy Display")); |
5440 | 661 button = gaim_button(_("Show buddy _icons"), &blist_options, OPT_BLIST_SHOW_ICONS, vbox); |
662 b2 = gaim_button(_("Show _warning levels"), &blist_options, OPT_BLIST_SHOW_WARN, vbox); | |
663 if (blist_options & OPT_BLIST_SHOW_ICONS) | |
664 gtk_widget_set_sensitive(GTK_WIDGET(b2), FALSE); | |
665 g_signal_connect(G_OBJECT(button), "clicked", | |
666 G_CALLBACK(gaim_gtk_toggle_sensitive), b2); | |
667 b2 = gaim_button(_("Show idle _times"), &blist_options, OPT_BLIST_SHOW_IDLETIME, vbox); | |
668 if (blist_options & OPT_BLIST_SHOW_ICONS) | |
669 gtk_widget_set_sensitive(GTK_WIDGET(b2), FALSE); | |
670 g_signal_connect(G_OBJECT(button), "clicked", | |
671 G_CALLBACK(gaim_gtk_toggle_sensitive), b2); | |
672 gaim_button(_("Dim i_dle buddies"), &blist_options, OPT_BLIST_GREY_IDLERS, vbox); | |
673 | |
674 gtk_widget_show_all(ret); | |
675 return ret; | |
676 } | |
677 | |
678 GtkWidget *conv_page() { | |
679 GtkWidget *ret; | |
680 GtkWidget *vbox; | |
681 GtkWidget *label; | |
682 GtkSizeGroup *sg; | |
683 GList *names = NULL; | |
684 int i; | |
685 | |
686 ret = gtk_vbox_new(FALSE, 18); | |
687 gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
688 | |
689 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
690 vbox = gaim_gtk_make_frame(ret, _("Conversations")); |
5440 | 691 |
692 /* Build a list of names. */ | |
693 for (i = 0; i < gaim_conv_placement_get_fnc_count(); i++) { | |
694 names = g_list_append(names, (char *)gaim_conv_placement_get_name(i)); | |
695 names = g_list_append(names, GINT_TO_POINTER(i)); | |
696 } | |
697 | |
698 label = gaim_dropdown_from_list(vbox, _("_Placement:"), | |
699 &conv_placement_option, -1, names); | |
700 | |
701 g_list_free(names); | |
702 | |
703 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
704 gtk_size_group_add_widget(sg, label); | |
705 | |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
706 gaim_button(_("Show IMs and chats in _same tabbed window"), |
5440 | 707 &convo_options, OPT_CONVO_COMBINE, vbox); |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
708 pref_checkbox(_("Send _URLs as Links"), |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
709 "/core/conversations/send_urls_as_links", vbox); |
5440 | 710 |
711 gtk_widget_show_all(ret); | |
712 | |
713 return ret; | |
714 } | |
715 | |
716 GtkWidget *im_page() { | |
717 GtkWidget *ret; | |
718 GtkWidget *vbox; | |
719 GtkWidget *typingbutton, *widge; | |
720 GtkSizeGroup *sg; | |
721 | |
722 ret = gtk_vbox_new(FALSE, 18); | |
723 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
724 | |
725 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
726 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
727 vbox = gaim_gtk_make_frame (ret, _("Window")); |
5440 | 728 widge = gaim_dropdown(vbox, _("Show _buttons as:"), &im_options, OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM, |
729 _("Pictures"), OPT_IM_BUTTON_XPM, | |
730 _("Text"), OPT_IM_BUTTON_TEXT, | |
731 _("Pictures and text"), OPT_IM_BUTTON_XPM | OPT_IM_BUTTON_TEXT, NULL); | |
732 gtk_size_group_add_widget(sg, widge); | |
733 gtk_misc_set_alignment(GTK_MISC(widge), 0, 0); | |
734 gaim_labeled_spin_button(vbox, _("New window _width:"), &conv_size.width, 25, 9999, sg); | |
735 gaim_labeled_spin_button(vbox, _("New window _height:"), &conv_size.height, 25, 9999, sg); | |
736 gaim_labeled_spin_button(vbox, _("_Entry field height:"), &conv_size.entry_height, 25, 9999, sg); | |
737 gaim_button(_("_Raise windows on events"), &im_options, OPT_IM_POPUP, vbox); | |
738 gaim_button(_("Hide window on _send"), &im_options, OPT_IM_POPDOWN, vbox); | |
739 gtk_widget_show (vbox); | |
740 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
741 vbox = gaim_gtk_make_frame (ret, _("Buddy Icons")); |
5440 | 742 gaim_button(_("Hide buddy _icons"), &im_options, OPT_IM_HIDE_ICONS, vbox); |
743 gaim_button(_("Disable buddy icon a_nimation"), &im_options, OPT_IM_NO_ANIMATION, vbox); | |
744 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
745 vbox = gaim_gtk_make_frame (ret, _("Display")); |
5440 | 746 gaim_button(_("Show _logins in window"), &im_options, OPT_IM_LOGON, vbox); |
747 gaim_button(_("Show a_liases in tabs/titles"), &im_options, OPT_IM_ALIAS_TAB, vbox); | |
748 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
749 vbox = gaim_gtk_make_frame (ret, _("Typing Notification")); |
5440 | 750 typingbutton = gaim_button(_("Notify buddies that you are _typing to them"), &misc_options, |
751 OPT_MISC_STEALTH_TYPING, vbox); | |
752 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(typingbutton), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(typingbutton))); | |
753 misc_options ^= OPT_MISC_STEALTH_TYPING; | |
754 | |
755 gtk_widget_show_all(ret); | |
756 return ret; | |
757 } | |
758 | |
759 GtkWidget *chat_page() { | |
760 GtkWidget *ret; | |
761 GtkWidget *vbox; | |
762 GtkWidget *dd; | |
763 GtkSizeGroup *sg; | |
764 | |
765 ret = gtk_vbox_new(FALSE, 18); | |
766 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
767 | |
768 sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); | |
769 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
770 vbox = gaim_gtk_make_frame (ret, _("Window")); |
5440 | 771 dd = gaim_dropdown(vbox, _("Show _buttons as:"), &chat_options, OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM, |
772 _("Pictures"), OPT_CHAT_BUTTON_XPM, | |
773 _("Text"), OPT_CHAT_BUTTON_TEXT, | |
774 _("Pictures and text"), OPT_CHAT_BUTTON_XPM | OPT_CHAT_BUTTON_TEXT, NULL); | |
775 gtk_size_group_add_widget(sg, dd); | |
776 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
777 gaim_labeled_spin_button(vbox, _("New window _width:"), &buddy_chat_size.width, 25, 9999, sg); | |
778 gaim_labeled_spin_button(vbox, _("New window _height:"), &buddy_chat_size.height, 25, 9999, sg); | |
779 gaim_labeled_spin_button(vbox, _("_Entry field height:"), &buddy_chat_size.entry_height, 25, 9999, sg); | |
780 gaim_button(_("_Raise windows on events"), &chat_options, OPT_CHAT_POPUP, vbox); | |
781 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
782 vbox = gaim_gtk_make_frame (ret, _("Tab Completion")); |
5440 | 783 gaim_button(_("_Tab-complete nicks"), &chat_options, OPT_CHAT_TAB_COMPLETE, vbox); |
784 gaim_button(_("_Old-style tab completion"), &chat_options, OPT_CHAT_OLD_STYLE_TAB, vbox); | |
785 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
786 vbox = gaim_gtk_make_frame (ret, _("Display")); |
5440 | 787 gaim_button(_("_Show people joining/leaving in window"), &chat_options, OPT_CHAT_LOGON, vbox); |
788 gaim_button(_("Co_lorize screennames"), &chat_options, OPT_CHAT_COLORIZE, vbox); | |
789 | |
790 gtk_widget_show_all(ret); | |
791 return ret; | |
792 } | |
793 | |
794 GtkWidget *tab_page() { | |
795 GtkWidget *ret; | |
796 GtkWidget *vbox; | |
797 GtkWidget *dd; | |
798 GtkWidget *button; | |
799 GtkSizeGroup *sg; | |
800 ret = gtk_vbox_new(FALSE, 18); | |
801 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
802 | |
803 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
804 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
805 vbox = gaim_gtk_make_frame (ret, _("IM Tabs")); |
5440 | 806 dd = gaim_dropdown(vbox, _("Tab _placement:"), &im_options, OPT_IM_SIDE_TAB | OPT_IM_BR_TAB, |
807 _("Top"), 0, | |
808 _("Bottom"), OPT_IM_BR_TAB, | |
809 _("Left"), OPT_IM_SIDE_TAB, | |
810 _("Right"), OPT_IM_BR_TAB | OPT_IM_SIDE_TAB, NULL); | |
811 gtk_size_group_add_widget(sg, dd); | |
812 gaim_button(_("Show all _instant messages in one tabbed\nwindow"), &im_options, OPT_IM_ONE_WINDOW, vbox); | |
813 | |
814 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
815 vbox = gaim_gtk_make_frame (ret, _("Chat Tabs")); |
5440 | 816 dd = gaim_dropdown(vbox, _("Tab _placement:"), &chat_options, OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, |
817 _("Top"), 0, | |
818 _("Bottom"), OPT_CHAT_BR_TAB, | |
819 _("Left"), OPT_CHAT_SIDE_TAB, | |
820 _("Right"), OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, NULL); | |
821 gtk_size_group_add_widget(sg, dd); | |
822 gaim_button(_("Show all c_hats in one tabbed window"), &chat_options, OPT_CHAT_ONE_WINDOW, | |
823 vbox); | |
824 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
825 vbox = gaim_gtk_make_frame (ret, _("Tab Options")); |
5440 | 826 button = gaim_button(_("Show _close button on tabs."), &convo_options, OPT_CONVO_NO_X_ON_TAB, vbox); |
827 convo_options ^= OPT_CONVO_NO_X_ON_TAB; | |
828 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))); | |
829 | |
830 | |
831 gtk_widget_show_all(ret); | |
832 return ret; | |
833 } | |
834 | |
835 GtkWidget *proxy_page() { | |
836 GtkWidget *ret; | |
837 GtkWidget *vbox; | |
838 GtkWidget *entry; | |
839 GtkWidget *label; | |
840 GtkWidget *hbox; | |
841 GtkWidget *table; | |
842 | |
843 ret = gtk_vbox_new(FALSE, 18); | |
844 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
845 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
846 vbox = gaim_gtk_make_frame (ret, _("Proxy Type")); |
5440 | 847 gaim_dropdown(vbox, _("Proxy _type:"), (int*)&global_proxy_info.proxytype, -1, |
848 _("No proxy"), PROXY_NONE, | |
849 "SOCKS 4", PROXY_SOCKS4, | |
850 "SOCKS 5", PROXY_SOCKS5, | |
851 "HTTP", PROXY_HTTP, NULL); | |
852 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
853 vbox = gaim_gtk_make_frame(ret, _("Proxy Server")); |
5440 | 854 prefs_proxy_frame = vbox; |
855 | |
856 if (global_proxy_info.proxytype == PROXY_NONE) | |
857 gtk_widget_set_sensitive(GTK_WIDGET(vbox), FALSE); | |
858 | |
859 table = gtk_table_new(2, 4, FALSE); | |
860 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
861 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
862 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
863 gtk_container_add(GTK_CONTAINER(vbox), table); | |
864 | |
865 | |
866 label = gtk_label_new_with_mnemonic(_("_Host")); | |
867 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
868 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
869 | |
870 entry = gtk_entry_new(); | |
871 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
872 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); | |
873 g_signal_connect(G_OBJECT(entry), "changed", | |
874 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); | |
875 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxyhost); | |
876 | |
877 hbox = gtk_hbox_new(TRUE, 5); | |
878 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
879 | |
880 label = gtk_label_new_with_mnemonic(_("Port")); | |
881 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
882 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); | |
883 | |
884 entry = gtk_entry_new(); | |
885 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
886 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); | |
887 g_signal_connect(G_OBJECT(entry), "changed", | |
888 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); | |
889 | |
890 if (global_proxy_info.proxyport) { | |
891 char buf[128]; | |
892 g_snprintf(buf, sizeof(buf), "%d", global_proxy_info.proxyport); | |
893 gtk_entry_set_text(GTK_ENTRY(entry), buf); | |
894 } | |
895 | |
896 label = gtk_label_new_with_mnemonic(_("_User")); | |
897 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
898 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); | |
899 | |
900 entry = gtk_entry_new(); | |
901 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
902 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); | |
903 g_signal_connect(G_OBJECT(entry), "changed", | |
904 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); | |
905 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxyuser); | |
906 | |
907 hbox = gtk_hbox_new(TRUE, 5); | |
908 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
909 | |
910 label = gtk_label_new_with_mnemonic(_("Pa_ssword")); | |
911 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
912 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL, 0, 0, 0); | |
913 | |
914 entry = gtk_entry_new(); | |
915 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
916 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, GTK_FILL , 0, 0, 0); | |
917 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); | |
918 g_signal_connect(G_OBJECT(entry), "changed", | |
919 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); | |
920 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxypass); | |
921 | |
922 gtk_widget_show_all(ret); | |
923 return ret; | |
924 } | |
925 | |
926 #ifndef _WIN32 | |
927 static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { | |
928 const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); | |
929 | |
930 if (!program_is_valid(program)) { | |
931 char *error = g_strdup_printf(_("The entered manual browser " | |
932 "'%s' is not valid. Hyperlinks will " | |
933 "not work."), program); | |
934 gaim_notify_warning(NULL, NULL, error, NULL); | |
935 } | |
936 | |
937 g_strlcpy(web_command, program, sizeof(web_command)); | |
938 | |
939 /* carry on normally */ | |
940 return FALSE; | |
941 } | |
942 | |
943 static GList *get_available_browsers() | |
944 { | |
945 struct browser { | |
946 char *name; | |
947 char *command; | |
948 int id; | |
949 }; | |
950 | |
951 static struct browser possible_browsers[] = { | |
952 {N_("Konqueror"), "kfmclient", BROWSER_KONQ}, | |
953 {N_("Opera"), "opera", BROWSER_OPERA}, | |
954 {N_("Galeon"), "galeon", BROWSER_GALEON}, | |
955 {N_("Netscape"), "netscape", BROWSER_NETSCAPE}, | |
956 {N_("Mozilla"), "mozilla", BROWSER_MOZILLA}, | |
957 }; | |
958 static const int num_possible_browsers = 5; | |
959 | |
960 GList *browsers = NULL; | |
961 int i = 0; | |
962 | |
963 browsers = g_list_prepend(browsers, GINT_TO_POINTER(BROWSER_MANUAL)); | |
964 browsers = g_list_prepend(browsers, _("Manual")); | |
965 for (i = 0; i < num_possible_browsers; i++) { | |
966 if (program_is_valid(possible_browsers[i].command)) { | |
967 browsers = g_list_prepend(browsers, | |
968 GINT_TO_POINTER(possible_browsers[i].id)); | |
969 browsers = g_list_prepend(browsers, possible_browsers[i].name); | |
970 } | |
971 } | |
972 | |
973 return browsers; | |
974 } | |
975 | |
976 GtkWidget *browser_page() { | |
977 GtkWidget *ret; | |
978 GtkWidget *vbox; | |
979 GtkWidget *hbox; | |
980 GtkWidget *label; | |
981 GtkSizeGroup *sg; | |
982 GList *browsers = NULL; | |
983 | |
984 ret = gtk_vbox_new(FALSE, 18); | |
985 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
986 | |
987 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
988 vbox = gaim_gtk_make_frame (ret, _("Browser Selection")); |
5440 | 989 |
990 browsers = get_available_browsers(); | |
991 if (browsers != NULL) { | |
992 label = gaim_dropdown_from_list(vbox,_("_Browser"), &web_browser, -1, | |
993 browsers); | |
994 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
995 gtk_size_group_add_widget(sg, label); | |
996 } | |
997 | |
998 hbox = gtk_hbox_new(FALSE, 5); | |
999 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
1000 label = gtk_label_new_with_mnemonic(_("_Manual: ")); | |
1001 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); | |
1002 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1003 gtk_size_group_add_widget(sg, label); | |
1004 | |
1005 browser_entry = gtk_entry_new(); | |
1006 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); | |
1007 if (web_browser != BROWSER_MANUAL) | |
1008 gtk_widget_set_sensitive(hbox, FALSE); | |
1009 gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); | |
1010 | |
1011 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command); | |
1012 g_signal_connect(G_OBJECT(browser_entry), "focus-out-event", G_CALLBACK(manual_browser_set), NULL); | |
1013 | |
1014 if (browsers != NULL) { | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1015 vbox = gaim_gtk_make_frame (ret, _("Browser Options")); |
5440 | 1016 label = gaim_button(_("Open new _window by default"), &misc_options, OPT_MISC_BROWSER_POPUP, vbox); |
1017 } | |
1018 | |
1019 gtk_widget_show_all(ret); | |
1020 return ret; | |
1021 } | |
1022 #endif /*_WIN32*/ | |
1023 | |
1024 GtkWidget *logging_page() { | |
1025 GtkWidget *ret; | |
1026 GtkWidget *vbox; | |
1027 ret = gtk_vbox_new(FALSE, 18); | |
1028 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1029 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1030 vbox = gaim_gtk_make_frame (ret, _("Message Logs")); |
5440 | 1031 gaim_button(_("_Log all instant messages"), &logging_options, OPT_LOG_CONVOS, vbox); |
1032 gaim_button(_("Log all c_hats"), &logging_options, OPT_LOG_CHATS, vbox); | |
1033 gaim_button(_("Strip _HTML from logs"), &logging_options, OPT_LOG_STRIP_HTML, vbox); | |
1034 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1035 vbox = gaim_gtk_make_frame (ret, _("System Logs")); |
5440 | 1036 gaim_button(_("Log when buddies _sign on/sign off"), &logging_options, OPT_LOG_BUDDY_SIGNON, |
1037 vbox); | |
1038 gaim_button(_("Log when buddies become _idle/un-idle"), &logging_options, OPT_LOG_BUDDY_IDLE, | |
1039 vbox); | |
1040 gaim_button(_("Log when buddies go away/come _back"), &logging_options, OPT_LOG_BUDDY_AWAY, vbox); | |
1041 gaim_button(_("Log your _own signons/idleness/awayness"), &logging_options, OPT_LOG_MY_SIGNON, | |
1042 vbox); | |
1043 gaim_button(_("I_ndividual log file for each buddy's signons"), &logging_options, | |
1044 OPT_LOG_INDIVIDUAL, vbox); | |
1045 | |
1046 gtk_widget_show_all(ret); | |
1047 return ret; | |
1048 } | |
1049 | |
1050 static GtkWidget *sndcmd = NULL; | |
1051 | |
1052 #ifndef _WIN32 | |
1053 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) | |
1054 { | |
1055 gaim_sound_set_command(gtk_entry_get_text(GTK_ENTRY(sndcmd))); | |
1056 return TRUE; | |
1057 } | |
1058 #endif | |
1059 | |
1060 GtkWidget *sound_page() { | |
1061 GtkWidget *ret; | |
1062 GtkWidget *vbox; | |
1063 GtkSizeGroup *sg; | |
1064 #ifndef _WIN32 | |
1065 GtkWidget *dd; | |
1066 GtkWidget *hbox; | |
1067 GtkWidget *label; | |
1068 char *cmd; | |
1069 #endif | |
1070 | |
1071 ret = gtk_vbox_new(FALSE, 18); | |
1072 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1073 | |
1074 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
1075 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1076 vbox = gaim_gtk_make_frame (ret, _("Sound Options")); |
5440 | 1077 gaim_button(_("_No sounds when you log in"), &sound_options, OPT_SOUND_SILENT_SIGNON, vbox); |
1078 gaim_button(_("_Sounds while away"), &sound_options, OPT_SOUND_WHEN_AWAY, vbox); | |
1079 | |
1080 #ifndef _WIN32 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1081 vbox = gaim_gtk_make_frame (ret, _("Sound Method")); |
5440 | 1082 dd = gaim_dropdown(vbox, _("_Method"), &sound_options, OPT_SOUND_BEEP | |
1083 OPT_SOUND_ESD | OPT_SOUND_ARTS | OPT_SOUND_NAS | | |
1084 OPT_SOUND_NORMAL | OPT_SOUND_CMD, | |
1085 _("Console beep"), OPT_SOUND_BEEP, | |
1086 #ifdef USE_AO | |
1087 _("Automatic"), OPT_SOUND_NORMAL, | |
1088 "ESD", OPT_SOUND_ESD, | |
1089 "Arts", OPT_SOUND_ARTS, | |
1090 #endif | |
1091 #ifdef USE_NAS_AUDIO | |
1092 "NAS", OPT_SOUND_NAS, | |
1093 #endif | |
1094 _("Command"), OPT_SOUND_CMD, NULL); | |
1095 gtk_size_group_add_widget(sg, dd); | |
1096 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
1097 | |
1098 hbox = gtk_hbox_new(FALSE, 5); | |
1099 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
1100 | |
1101 hbox = gtk_hbox_new(FALSE, 5); | |
1102 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
1103 label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)")); | |
1104 gtk_size_group_add_widget(sg, label); | |
1105 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1106 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
1107 | |
1108 sndcmd = gtk_entry_new(); | |
1109 gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd); | |
1110 | |
1111 gtk_editable_set_editable(GTK_EDITABLE(sndcmd), TRUE); | |
1112 cmd = gaim_sound_get_command(); | |
1113 if(cmd) | |
1114 gtk_entry_set_text(GTK_ENTRY(sndcmd), cmd); | |
1115 gtk_widget_set_size_request(sndcmd, 75, -1); | |
1116 | |
1117 gtk_widget_set_sensitive(sndcmd, (sound_options & OPT_SOUND_CMD)); | |
1118 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); | |
1119 g_signal_connect(G_OBJECT(sndcmd), "changed", | |
1120 G_CALLBACK(sound_cmd_yeah), NULL); | |
1121 #endif /* _WIN32 */ | |
1122 gtk_widget_show_all(ret); | |
1123 return ret; | |
1124 } | |
1125 | |
1126 GtkWidget *away_page() { | |
1127 GtkWidget *ret; | |
1128 GtkWidget *vbox; | |
1129 GtkWidget *hbox; | |
1130 GtkWidget *label; | |
1131 GtkWidget *button; | |
1132 GtkWidget *select; | |
1133 GtkWidget *dd; | |
1134 GtkSizeGroup *sg; | |
1135 | |
1136 ret = gtk_vbox_new(FALSE, 18); | |
1137 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1138 | |
1139 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
1140 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1141 vbox = gaim_gtk_make_frame (ret, _("Away")); |
5440 | 1142 gaim_button(_("_Sending messages removes away status"), &away_options, OPT_AWAY_BACK_ON_IM, vbox); |
1143 gaim_button(_("_Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox); | |
1144 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1145 vbox = gaim_gtk_make_frame (ret, _("Auto-response")); |
5440 | 1146 hbox = gtk_hbox_new(FALSE, 0); |
1147 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
1148 gaim_labeled_spin_button(hbox, _("Seconds before _resending:"), | |
1149 &away_resend, 1, 24 * 60 * 60, sg); | |
1150 gaim_button(_("_Don't send auto-response"), &away_options, OPT_AWAY_NO_AUTO_RESP, vbox); | |
1151 gaim_button(_("_Only send auto-response when idle"), &away_options, OPT_AWAY_IDLE_RESP, vbox); | |
1152 gaim_button(_("Do_n't send auto-response in active conversations"), &away_options, OPT_AWAY_DELAY_IN_USE, vbox); | |
1153 | |
1154 if (away_options & OPT_AWAY_NO_AUTO_RESP) | |
1155 gtk_widget_set_sensitive(hbox, FALSE); | |
1156 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1157 vbox = gaim_gtk_make_frame (ret, _("Idle")); |
5440 | 1158 dd = gaim_dropdown(vbox, _("Idle _time reporting:"), &report_idle, -1, |
1159 _("None"), IDLE_NONE, | |
1160 _("Gaim usage"), IDLE_GAIM, | |
1161 #ifdef USE_SCREENSAVER | |
1162 #ifndef _WIN32 | |
1163 _("X usage"), IDLE_SCREENSAVER, | |
1164 #else | |
1165 _("Windows usage"), IDLE_SCREENSAVER, | |
1166 #endif | |
1167 #endif | |
1168 NULL); | |
1169 gtk_size_group_add_widget(sg, dd); | |
1170 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
1171 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1172 vbox = gaim_gtk_make_frame (ret, _("Auto-away")); |
5440 | 1173 button = gaim_button(_("Set away _when idle"), &away_options, OPT_AWAY_AUTO, vbox); |
1174 select = gaim_labeled_spin_button(vbox, _("_Minutes before setting away:"), &auto_away, 1, 24 * 60, sg); | |
1175 if (!(away_options & OPT_AWAY_AUTO)) | |
1176 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
1177 g_signal_connect(G_OBJECT(button), "clicked", | |
1178 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
1179 | |
1180 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); | |
1181 gtk_size_group_add_widget(sg, label); | |
1182 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1183 hbox = gtk_hbox_new(FALSE, 0); | |
1184 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
1185 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
1186 prefs_away_menu = gtk_option_menu_new(); | |
1187 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); | |
1188 if (!(away_options & OPT_AWAY_AUTO)) | |
1189 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); | |
1190 g_signal_connect(G_OBJECT(button), "clicked", | |
1191 G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu); | |
1192 default_away_menu_init(prefs_away_menu); | |
1193 gtk_widget_show(prefs_away_menu); | |
1194 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
1195 | |
1196 gtk_widget_show_all(ret); | |
1197 return ret; | |
1198 } | |
1199 | |
1200 static GtkWidget *plugin_description=NULL, *plugin_details=NULL; | |
1201 | |
1202 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) | |
1203 { | |
1204 gchar *buf, *pname, *perr, *pdesc, *pauth, *pweb; | |
1205 GtkTreeIter iter; | |
1206 GValue val = { 0, }; | |
1207 GaimPlugin *plug; | |
1208 | |
1209 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1210 return; | |
1211 gtk_tree_model_get_value (model, &iter, 2, &val); | |
1212 plug = g_value_get_pointer(&val); | |
1213 | |
1214 pname = g_markup_escape_text(_(plug->info->name), -1); | |
1215 pdesc = g_markup_escape_text(_(plug->info->description), -1); | |
1216 pauth = g_markup_escape_text(_(plug->info->author), -1); | |
1217 pweb = g_markup_escape_text(_(plug->info->homepage), -1); | |
1218 if (plug->error != NULL) { | |
1219 perr = g_markup_escape_text(_(plug->error), -1); | |
1220 buf = g_strdup_printf( | |
1221 "<span size=\"larger\">%s %s</span>\n\n" | |
1222 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
1223 "%s", | |
1224 pname, plug->info->version, perr, pdesc); | |
1225 g_free(perr); | |
1226 } | |
1227 else { | |
1228 buf = g_strdup_printf( | |
1229 "<span size=\"larger\">%s %s</span>\n\n%s", | |
1230 pname, plug->info->version, pdesc); | |
1231 } | |
1232 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
1233 g_free(buf); | |
1234 | |
1235 buf = g_strdup_printf( | |
1236 #ifndef _WIN32 | |
1237 _("<span size=\"larger\">%s %s</span>\n\n" | |
1238 "<span weight=\"bold\">Written by:</span>\t%s\n" | |
1239 "<span weight=\"bold\">Web site:</span>\t\t%s\n" | |
1240 "<span weight=\"bold\">File name:</span>\t%s"), | |
1241 #else | |
1242 _("<span size=\"larger\">%s %s</span>\n\n" | |
1243 "<span weight=\"bold\">Written by:</span> %s\n" | |
1244 "<span weight=\"bold\">URL:</span> %s\n" | |
1245 "<span weight=\"bold\">File name:</span> %s"), | |
1246 #endif | |
1247 pname, plug->info->version, pauth, pweb, plug->path); | |
1248 | |
1249 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); | |
1250 g_value_unset(&val); | |
1251 g_free(buf); | |
1252 g_free(pname); | |
1253 g_free(pdesc); | |
1254 g_free(pauth); | |
1255 g_free(pweb); | |
1256 } | |
1257 | |
1258 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
1259 { | |
1260 GtkTreeModel *model = (GtkTreeModel *)data; | |
1261 GtkTreeIter iter; | |
1262 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
1263 GaimPlugin *plug; | |
1264 gchar buf[1024]; | |
1265 | |
1266 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); | |
1267 gdk_window_set_cursor(prefs->window, wait); | |
1268 gdk_cursor_unref(wait); | |
1269 | |
1270 gtk_tree_model_get_iter (model, &iter, path); | |
1271 gtk_tree_model_get (model, &iter, 2, &plug, -1); | |
1272 | |
1273 if (!gaim_plugin_is_loaded(plug)) { | |
1274 gaim_plugin_load(plug); | |
1275 | |
1276 /* | |
1277 * NOTE: This is basically the same check as before | |
1278 * (plug->type == plugin), but now there aren't plugin types. | |
1279 * Not yet, anyway. I want to do a V2 of the plugin API. | |
1280 * The thing is, we should have a flag specifying the UI type, | |
1281 * or just whether it's a general plugin or a UI-specific | |
1282 * plugin. We should only load this if it's UI-specific. | |
1283 * | |
1284 * -- ChipX86 | |
1285 */ | |
1286 if (GAIM_IS_GTK_PLUGIN(plug)) | |
1287 { | |
1288 GtkWidget *config_frame; | |
1289 GaimGtkPluginUiInfo *ui_info; | |
1290 | |
1291 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
1292 config_frame = gaim_gtk_plugin_get_config_frame(plug); | |
1293 | |
1294 if (config_frame != NULL) { | |
1295 ui_info->iter = g_new0(GtkTreeIter, 1); | |
1296 prefs_notebook_add_page(_(plug->info->name), NULL, | |
1297 config_frame, ui_info->iter, | |
1298 &plugin_iter, notebook_page++); | |
1299 | |
1300 if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), | |
1301 &plugin_iter) == 1) { | |
1302 | |
1303 /* Expand the tree for the first plugin added */ | |
1304 GtkTreePath *path2; | |
1305 | |
1306 path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), | |
1307 &plugin_iter); | |
1308 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), | |
1309 path2, TRUE); | |
1310 gtk_tree_path_free(path2); | |
1311 } | |
1312 } | |
1313 } | |
1314 } | |
1315 else { | |
1316 if (GAIM_IS_GTK_PLUGIN(plug)) { | |
1317 GaimGtkPluginUiInfo *ui_info; | |
1318 | |
1319 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
1320 | |
1321 if (ui_info != NULL && ui_info->iter != NULL) { | |
1322 gtk_tree_store_remove(GTK_TREE_STORE(prefstree), ui_info->iter); | |
1323 g_free(ui_info->iter); | |
1324 ui_info->iter = NULL; | |
1325 } | |
1326 } | |
1327 | |
1328 gaim_plugin_unload(plug); | |
1329 } | |
1330 | |
1331 gdk_window_set_cursor(prefs->window, NULL); | |
1332 | |
1333 if (plug->error != NULL) { | |
1334 g_snprintf(buf, sizeof(buf), | |
1335 "<span size=\"larger\">%s %s</span>\n\n" | |
1336 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
1337 "%s", | |
1338 g_markup_escape_text(_(plug->info->name), -1), | |
1339 plug->info->version, | |
1340 g_markup_escape_text(plug->error, -1), | |
1341 g_markup_escape_text(_(plug->info->description), -1)); | |
1342 } | |
1343 else { | |
1344 g_snprintf(buf, sizeof(buf), | |
1345 "<span size=\"larger\">%s %s</span>\n\n%s", | |
1346 g_markup_escape_text(_(plug->info->name), -1), | |
1347 plug->info->version, | |
1348 g_markup_escape_text(_(plug->info->description), -1)); | |
1349 } | |
1350 | |
1351 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
1352 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, | |
1353 gaim_plugin_is_loaded(plug), -1); | |
1354 | |
1355 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
1356 gtk_tree_path_free(path); | |
1357 } | |
1358 | |
1359 static void | |
1360 update_plugin_list(void *data) | |
1361 { | |
1362 GtkListStore *ls = GTK_LIST_STORE(data); | |
1363 GtkTreeIter iter; | |
1364 GList *probes; | |
1365 GaimPlugin *plug; | |
1366 | |
1367 gtk_list_store_clear(ls); | |
1368 | |
1369 for (probes = gaim_plugins_get_all(); | |
1370 probes != NULL; | |
1371 probes = probes->next) { | |
1372 | |
1373 plug = probes->data; | |
1374 | |
1375 if (plug->info->type != GAIM_PLUGIN_STANDARD) | |
1376 continue; | |
1377 | |
1378 gtk_list_store_append (ls, &iter); | |
1379 gtk_list_store_set(ls, &iter, | |
1380 0, gaim_plugin_is_loaded(plug), | |
1381 1, plug->info->name ? _(plug->info->name) : plug->path, | |
1382 2, plug, -1); | |
1383 } | |
1384 } | |
1385 | |
1386 static GtkWidget *plugin_page () | |
1387 { | |
1388 GtkWidget *ret; | |
1389 GtkWidget *sw, *vp; | |
1390 GtkWidget *event_view; | |
1391 GtkListStore *ls; | |
1392 GtkCellRenderer *rend, *rendt; | |
1393 GtkTreeViewColumn *col; | |
1394 GtkTreeSelection *sel; | |
1395 GtkTreePath *path; | |
1396 GtkWidget *nb; | |
1397 | |
1398 ret = gtk_vbox_new(FALSE, 18); | |
1399 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1400 | |
1401 sw = gtk_scrolled_window_new(NULL,NULL); | |
1402 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
1403 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1404 | |
1405 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
1406 | |
1407 ls = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); | |
1408 | |
1409 update_plugin_list(ls); | |
1410 | |
1411 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); | |
1412 | |
1413 rend = gtk_cell_renderer_toggle_new(); | |
1414 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1415 | |
1416 | |
1417 col = gtk_tree_view_column_new_with_attributes (_("Load"), | |
1418 rend, | |
1419 "active", 0, | |
1420 NULL); | |
1421 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1422 | |
1423 rendt = gtk_cell_renderer_text_new(); | |
1424 col = gtk_tree_view_column_new_with_attributes (_("Name"), | |
1425 rendt, | |
1426 "text", 1, | |
1427 NULL); | |
1428 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1429 g_object_unref(G_OBJECT(ls)); | |
1430 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
1431 | |
1432 | |
1433 nb = gtk_notebook_new(); | |
1434 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM); | |
1435 gtk_notebook_popup_disable(GTK_NOTEBOOK(nb)); | |
1436 | |
1437 /* Description */ | |
1438 sw = gtk_scrolled_window_new(NULL, NULL); | |
1439 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1440 plugin_description = gtk_label_new(NULL); | |
1441 | |
1442 vp = gtk_viewport_new(NULL, NULL); | |
1443 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); | |
1444 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); | |
1445 | |
1446 gtk_container_add(GTK_CONTAINER(vp), plugin_description); | |
1447 gtk_container_add(GTK_CONTAINER(sw), vp); | |
1448 | |
1449 gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE); | |
1450 gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE); | |
1451 gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0); | |
1452 gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6); | |
1453 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Description"))); | |
1454 | |
1455 /* Details */ | |
1456 sw = gtk_scrolled_window_new(NULL, NULL); | |
1457 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1458 plugin_details = gtk_label_new(NULL); | |
1459 | |
1460 vp = gtk_viewport_new(NULL, NULL); | |
1461 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); | |
1462 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); | |
1463 | |
1464 gtk_container_add(GTK_CONTAINER(vp), plugin_details); | |
1465 gtk_container_add(GTK_CONTAINER(sw), vp); | |
1466 | |
1467 gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE); | |
1468 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); | |
1469 gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0); | |
1470 gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6); | |
1471 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Details"))); | |
1472 gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0); | |
1473 | |
1474 g_signal_connect (G_OBJECT (sel), "changed", | |
1475 G_CALLBACK (prefs_plugin_sel), | |
1476 NULL); | |
1477 g_signal_connect (G_OBJECT(rend), "toggled", | |
1478 G_CALLBACK(plugin_load), ls); | |
1479 | |
1480 path = gtk_tree_path_new_first(); | |
1481 gtk_tree_selection_select_path(sel, path); | |
1482 gtk_tree_path_free(path); | |
1483 | |
1484 gaim_plugins_register_probe_notify_cb(update_plugin_list, ls); | |
1485 | |
1486 gtk_widget_show_all(ret); | |
1487 return ret; | |
1488 } | |
1489 | |
1490 static void event_toggled (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
1491 { | |
1492 GtkTreeModel *model = (GtkTreeModel *)data; | |
1493 GtkTreeIter iter; | |
1494 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
1495 gint soundnum; | |
1496 | |
1497 gtk_tree_model_get_iter (model, &iter, path); | |
1498 gtk_tree_model_get (model, &iter, 2, &soundnum, -1); | |
1499 | |
1500 sound_options ^= gaim_sound_get_event_option(soundnum); | |
1501 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, sound_options & gaim_sound_get_event_option(soundnum), -1); | |
1502 | |
1503 gtk_tree_path_free(path); | |
1504 } | |
1505 | |
1506 static void test_sound(GtkWidget *button, gpointer i_am_NULL) | |
1507 { | |
1508 guint32 tmp_sound = sound_options; | |
1509 if (!(sound_options & OPT_SOUND_WHEN_AWAY)) | |
1510 sound_options ^= OPT_SOUND_WHEN_AWAY; | |
1511 if (!(sound_options & gaim_sound_get_event_option(sound_row_sel))) | |
1512 sound_options ^= gaim_sound_get_event_option(sound_row_sel); | |
1513 gaim_sound_play_event(sound_row_sel); | |
1514 | |
1515 sound_options = tmp_sound; | |
1516 } | |
1517 | |
1518 static void reset_sound(GtkWidget *button, gpointer i_am_also_NULL) | |
1519 { | |
1520 /* This just resets a sound file back to default */ | |
1521 gaim_sound_set_event_file(sound_row_sel, NULL); | |
1522 | |
1523 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); | |
1524 } | |
1525 | |
1526 void close_sounddialog(GtkWidget *w, GtkWidget *w2) | |
1527 { | |
1528 | |
1529 GtkWidget *dest; | |
1530 | |
1531 if (!GTK_IS_WIDGET(w2)) | |
1532 dest = w; | |
1533 else | |
1534 dest = w2; | |
1535 | |
1536 sounddialog = NULL; | |
1537 | |
1538 gtk_widget_destroy(dest); | |
1539 } | |
1540 | |
1541 void do_select_sound(GtkWidget *w, int snd) | |
1542 { | |
1543 const char *file; | |
1544 | |
1545 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); | |
1546 | |
1547 /* If they type in a directory, change there */ | |
1548 if (file_is_dir(file, sounddialog)) | |
1549 return; | |
1550 | |
1551 /* Set it -- and forget it */ | |
1552 gaim_sound_set_event_file(snd, file); | |
1553 | |
1554 /* Set our text entry */ | |
1555 gtk_entry_set_text(GTK_ENTRY(sound_entry), file); | |
1556 | |
1557 /* Close the window! It's getting cold in here! */ | |
1558 close_sounddialog(NULL, sounddialog); | |
1559 | |
1560 if (last_sound_dir) | |
1561 g_free(last_sound_dir); | |
1562 last_sound_dir = g_path_get_dirname(file); | |
1563 } | |
1564 | |
1565 static void sel_sound(GtkWidget *button, gpointer being_NULL_is_fun) | |
1566 { | |
1567 char *buf = g_malloc(BUF_LEN); | |
1568 | |
1569 if (!sounddialog) { | |
1570 sounddialog = gtk_file_selection_new(_("Sound Selection")); | |
1571 | |
1572 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
1573 | |
1574 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S, last_sound_dir ? last_sound_dir : gaim_home_dir()); | |
1575 | |
1576 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
1577 | |
1578 g_signal_connect(G_OBJECT(sounddialog), "destroy", | |
1579 G_CALLBACK(close_sounddialog), sounddialog); | |
1580 | |
1581 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), | |
1582 "clicked", | |
1583 G_CALLBACK(do_select_sound), (int *)sound_row_sel); | |
1584 | |
1585 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button), | |
1586 "clicked", | |
1587 G_CALLBACK(close_sounddialog), sounddialog); | |
1588 } | |
1589 | |
1590 g_free(buf); | |
1591 gtk_widget_show(sounddialog); | |
1592 gdk_window_raise(sounddialog->window); | |
1593 } | |
1594 | |
1595 | |
1596 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
1597 GtkTreeIter iter; | |
1598 GValue val = { 0, }; | |
1599 char *file; | |
1600 | |
1601 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1602 return; | |
1603 gtk_tree_model_get_value (model, &iter, 2, &val); | |
1604 sound_row_sel = g_value_get_uint(&val); | |
1605 file = gaim_sound_get_event_file(sound_row_sel); | |
1606 if (sound_entry) | |
1607 gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)"); | |
1608 g_value_unset (&val); | |
1609 if (sounddialog) | |
1610 gtk_widget_destroy(sounddialog); | |
1611 } | |
1612 | |
1613 GtkWidget *sound_events_page() { | |
1614 | |
1615 GtkWidget *ret; | |
1616 GtkWidget *sw; | |
1617 GtkWidget *button, *hbox; | |
1618 GtkTreeIter iter; | |
1619 GtkWidget *event_view; | |
1620 GtkListStore *event_store; | |
1621 GtkCellRenderer *rend; | |
1622 GtkTreeViewColumn *col; | |
1623 GtkTreeSelection *sel; | |
1624 GtkTreePath *path; | |
1625 int j; | |
1626 char *file; | |
1627 | |
1628 ret = gtk_vbox_new(FALSE, 18); | |
1629 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1630 | |
1631 sw = gtk_scrolled_window_new(NULL,NULL); | |
1632 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
1633 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1634 | |
1635 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
1636 event_store = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT); | |
1637 | |
1638 for (j=0; j < GAIM_NUM_SOUNDS; j++) { | |
1639 guint opt = gaim_sound_get_event_option(j); | |
1640 if (opt == 0) | |
1641 continue; | |
1642 | |
1643 gtk_list_store_append (event_store, &iter); | |
1644 gtk_list_store_set(event_store, &iter, | |
1645 0, sound_options & opt, | |
1646 1, gettext(gaim_sound_get_event_label(j)), | |
1647 2, j, -1); | |
1648 } | |
1649 | |
1650 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
1651 | |
1652 rend = gtk_cell_renderer_toggle_new(); | |
1653 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1654 g_signal_connect (G_OBJECT (sel), "changed", | |
1655 G_CALLBACK (prefs_sound_sel), | |
1656 NULL); | |
1657 g_signal_connect (G_OBJECT(rend), "toggled", | |
1658 G_CALLBACK(event_toggled), event_store); | |
1659 path = gtk_tree_path_new_first(); | |
1660 gtk_tree_selection_select_path(sel, path); | |
1661 gtk_tree_path_free(path); | |
1662 | |
1663 col = gtk_tree_view_column_new_with_attributes (_("Play"), | |
1664 rend, | |
1665 "active", 0, | |
1666 NULL); | |
1667 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1668 | |
1669 rend = gtk_cell_renderer_text_new(); | |
1670 col = gtk_tree_view_column_new_with_attributes (_("Event"), | |
1671 rend, | |
1672 "text", 1, | |
1673 NULL); | |
1674 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1675 g_object_unref(G_OBJECT(event_store)); | |
1676 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
1677 | |
1678 hbox = gtk_hbox_new(FALSE, 6); | |
1679 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
1680 sound_entry = gtk_entry_new(); | |
1681 file = gaim_sound_get_event_file(0); | |
1682 gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)"); | |
1683 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); | |
1684 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5); | |
1685 | |
1686 button = gtk_button_new_with_label(_("Test")); | |
1687 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); | |
1688 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
1689 | |
1690 button = gtk_button_new_with_label(_("Reset")); | |
1691 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); | |
1692 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
1693 | |
1694 button = gtk_button_new_with_label(_("Choose...")); | |
1695 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(sel_sound), NULL); | |
1696 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
1697 | |
1698 gtk_widget_show_all (ret); | |
1699 | |
1700 return ret; | |
1701 } | |
1702 | |
1703 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) | |
1704 { | |
1705 GtkTreeIter iter; | |
1706 GValue val = { 0, }; | |
1707 gchar buffer[BUF_LONG]; | |
1708 char *tmp; | |
1709 struct away_message *am; | |
1710 | |
1711 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1712 return; | |
1713 gtk_tree_model_get_value (model, &iter, 1, &val); | |
1714 am = g_value_get_pointer(&val); | |
1715 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
1716 strncpy(buffer, am->message, BUF_LONG); | |
1717 tmp = stylize(buffer, BUF_LONG); | |
1718 gtk_imhtml_append_text(GTK_IMHTML(away_text), tmp, -1, GTK_IMHTML_NO_TITLE | | |
1719 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); | |
1720 gtk_imhtml_append_text(GTK_IMHTML(away_text), "<BR>", -1, GTK_IMHTML_NO_TITLE | | |
1721 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); | |
1722 g_free(tmp); | |
1723 g_value_unset (&val); | |
1724 | |
1725 } | |
1726 | |
1727 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { | |
1728 struct away_message *am; | |
1729 GtkTreeIter iter; | |
1730 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
1731 GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store); | |
1732 GValue val = { 0, }; | |
1733 | |
1734 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1735 return; | |
1736 gtk_tree_model_get_value (GTK_TREE_MODEL(prefs_away_store), &iter, 1, &val); | |
1737 am = g_value_get_pointer (&val); | |
1738 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
1739 rem_away_mess(NULL, am); | |
1740 } | |
1741 | |
1742 GtkWidget *away_message_page() { | |
1743 GtkWidget *ret; | |
1744 GtkWidget *hbox; | |
1745 GtkWidget *button; | |
1746 GtkWidget *sw; | |
1747 GtkTreeIter iter; | |
1748 GtkWidget *event_view; | |
1749 GtkCellRenderer *rend; | |
1750 GtkTreeViewColumn *col; | |
1751 GtkTreeSelection *sel; | |
1752 GSList *awy = away_messages; | |
1753 struct away_message *a; | |
1754 GtkWidget *sw2; | |
1755 GtkSizeGroup *sg; | |
1756 | |
1757 ret = gtk_vbox_new(FALSE, 18); | |
1758 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1759 | |
1760 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
1761 | |
1762 sw = gtk_scrolled_window_new(NULL,NULL); | |
1763 away_text = gtk_imhtml_new(NULL, NULL); | |
1764 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
1765 /* | |
1766 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1767 */ | |
1768 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
1769 | |
1770 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); | |
1771 while (awy) { | |
1772 a = (struct away_message *)awy->data; | |
1773 gtk_list_store_append (prefs_away_store, &iter); | |
1774 gtk_list_store_set(prefs_away_store, &iter, | |
1775 0, a->name, | |
1776 1, a, -1); | |
1777 awy = awy->next; | |
1778 } | |
1779 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(prefs_away_store)); | |
1780 | |
1781 | |
1782 rend = gtk_cell_renderer_text_new(); | |
1783 col = gtk_tree_view_column_new_with_attributes ("NULL", | |
1784 rend, | |
1785 "text", 0, | |
1786 NULL); | |
1787 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1788 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
1789 gtk_widget_show(event_view); | |
1790 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), event_view); | |
1791 | |
1792 sw2 = gtk_scrolled_window_new(NULL, NULL); | |
1793 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), | |
1794 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); | |
1795 gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); | |
1796 | |
1797 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), away_text); | |
1798 gaim_setup_imhtml(away_text); | |
1799 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1800 g_signal_connect (G_OBJECT (sel), "changed", | |
1801 G_CALLBACK (away_message_sel), | |
1802 NULL); | |
1803 hbox = gtk_hbox_new(TRUE, 5); | |
1804 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
1805 button = gtk_button_new_from_stock (GTK_STOCK_ADD); | |
1806 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1807 gtk_size_group_add_widget(sg, button); | |
1808 g_signal_connect(G_OBJECT(button), "clicked", | |
1809 G_CALLBACK(create_away_mess), NULL); | |
1810 | |
1811 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); | |
1812 gtk_size_group_add_widget(sg, button); | |
1813 g_signal_connect(G_OBJECT(button), "clicked", | |
1814 G_CALLBACK(remove_away_message), event_view); | |
1815 | |
1816 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1817 | |
1818 button = gaim_pixbuf_button_from_stock(_("_Edit"), GAIM_STOCK_EDIT, GAIM_BUTTON_HORIZONTAL); | |
1819 gtk_size_group_add_widget(sg, button); | |
1820 g_signal_connect(G_OBJECT(button), "clicked", | |
1821 G_CALLBACK(create_away_mess), event_view); | |
1822 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1823 | |
1824 gtk_widget_show_all(ret); | |
1825 return ret; | |
1826 } | |
1827 | |
1828 GtkTreeIter *prefs_notebook_add_page(const char *text, | |
1829 GdkPixbuf *pixbuf, | |
1830 GtkWidget *page, | |
1831 GtkTreeIter *iter, | |
1832 GtkTreeIter *parent, | |
1833 int ind) { | |
1834 GdkPixbuf *icon = NULL; | |
1835 | |
1836 if (pixbuf) | |
1837 icon = gdk_pixbuf_scale_simple (pixbuf, 18, 18, GDK_INTERP_BILINEAR); | |
1838 | |
1839 gtk_tree_store_append (prefstree, iter, parent); | |
1840 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
1841 | |
1842 if (pixbuf) | |
1843 g_object_unref(pixbuf); | |
1844 if (icon) | |
1845 g_object_unref(icon); | |
1846 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
1847 return iter; | |
1848 } | |
1849 | |
1850 void prefs_notebook_init() { | |
1851 GtkTreeIter p, p2, c; | |
1852 GList *l; | |
1853 GaimPlugin *plug; | |
1854 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); | |
1855 prefs_notebook_add_page(_("Smiley Themes"), NULL, theme_page(), &c, &p, notebook_page++); | |
1856 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); | |
1857 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | |
1858 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | |
1859 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
1860 prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &p2, NULL, notebook_page++); | |
1861 prefs_notebook_add_page(_("IMs"), NULL, im_page(), &c, &p2, notebook_page++); | |
1862 prefs_notebook_add_page(_("Chats"), NULL, chat_page(), &c, &p2, notebook_page++); | |
1863 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p2, notebook_page++); | |
1864 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); | |
1865 #ifndef _WIN32 | |
1866 /* We use the registered default browser in windows */ | |
1867 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); | |
1868 #endif | |
1869 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); | |
1870 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, notebook_page++); | |
1871 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++); | |
1872 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
1873 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++); | |
1874 | |
1875 if (gaim_plugins_enabled()) { | |
1876 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); | |
1877 | |
1878 for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { | |
1879 plug = l->data; | |
1880 | |
1881 if (GAIM_IS_GTK_PLUGIN(plug)) { | |
1882 GtkWidget *config_frame; | |
1883 GaimGtkPluginUiInfo *ui_info; | |
1884 | |
1885 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
1886 config_frame = gaim_gtk_plugin_get_config_frame(plug); | |
1887 | |
1888 if (config_frame != NULL) { | |
1889 ui_info->iter = g_new0(GtkTreeIter, 1); | |
1890 prefs_notebook_add_page(_(plug->info->name), NULL, | |
1891 config_frame, ui_info->iter, | |
1892 &plugin_iter, notebook_page++); | |
1893 } | |
1894 } | |
1895 } | |
1896 } | |
1897 } | |
1898 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1899 void gaim_gtk_prefs_show(void) |
5440 | 1900 { |
1901 GtkWidget *vbox, *vbox2; | |
1902 GtkWidget *hbox; | |
1903 GtkWidget *frame; | |
1904 GtkTreeViewColumn *column; | |
1905 GtkCellRenderer *cell; | |
1906 GtkTreeSelection *sel; | |
1907 GtkWidget *notebook; | |
1908 GtkWidget *sep; | |
1909 GtkWidget *button; | |
1910 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
1911 | |
1912 if (prefs) { | |
1913 gtk_window_present(GTK_WINDOW(prefs)); | |
1914 return; | |
1915 } | |
1916 | |
1917 /* copy the preferences to tmp values... | |
1918 * I liked "take affect immediately" Oh well :-( */ | |
1919 | |
1920 /* Back to instant-apply! I win! BU-HAHAHA! */ | |
1921 | |
1922 /* Create the window */ | |
1923 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
1924 gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); | |
1925 gtk_widget_realize(prefs); | |
1926 gtk_window_set_title(GTK_WINDOW(prefs), _("Preferences")); | |
1927 gtk_window_set_resizable (GTK_WINDOW(prefs), FALSE); | |
1928 g_signal_connect(G_OBJECT(prefs), "destroy", | |
1929 G_CALLBACK(delete_prefs), NULL); | |
1930 | |
1931 vbox = gtk_vbox_new(FALSE, 5); | |
1932 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); | |
1933 gtk_container_add(GTK_CONTAINER(prefs), vbox); | |
1934 gtk_widget_show(vbox); | |
1935 | |
1936 hbox = gtk_hbox_new (FALSE, 6); | |
1937 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1938 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
1939 gtk_widget_show (hbox); | |
1940 | |
1941 frame = gtk_frame_new (NULL); | |
1942 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1943 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
1944 gtk_widget_show (frame); | |
1945 | |
1946 /* The tree -- much inspired by the Gimp */ | |
1947 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
1948 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
1949 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
1950 | |
1951 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
1952 gtk_widget_show(tree_v); | |
1953 /* icons */ | |
1954 /* XXX: to be used at a later date | |
1955 cell = gtk_cell_renderer_pixbuf_new (); | |
1956 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
1957 */ | |
1958 | |
1959 /* text */ | |
1960 cell = gtk_cell_renderer_text_new (); | |
1961 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
1962 | |
1963 gtk_tree_view_append_column (GTK_TREE_VIEW (tree_v), column); | |
1964 | |
1965 /* The right side */ | |
1966 frame = gtk_frame_new (NULL); | |
1967 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1968 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
1969 gtk_widget_show (frame); | |
1970 | |
1971 vbox2 = gtk_vbox_new (FALSE, 4); | |
1972 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
1973 gtk_widget_show (vbox2); | |
1974 | |
1975 frame = gtk_frame_new (NULL); | |
1976 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
1977 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
1978 gtk_widget_show (frame); | |
1979 | |
1980 hbox = gtk_hbox_new (FALSE, 4); | |
1981 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
1982 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
1983 gtk_widget_show (hbox); | |
1984 | |
1985 preflabel = gtk_label_new(NULL); | |
1986 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
1987 gtk_widget_show (preflabel); | |
1988 | |
1989 /* The notebook */ | |
1990 prefsnotebook = notebook = gtk_notebook_new (); | |
1991 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
1992 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
1993 gtk_box_pack_start (GTK_BOX (vbox2), notebook, FALSE, FALSE, 0); | |
1994 | |
1995 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); | |
1996 g_signal_connect (G_OBJECT (sel), "changed", | |
1997 G_CALLBACK (pref_nb_select), | |
1998 notebook); | |
1999 gtk_widget_show(notebook); | |
2000 sep = gtk_hseparator_new(); | |
2001 gtk_widget_show(sep); | |
2002 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
2003 | |
2004 /* The buttons^H to press! */ | |
2005 hbox = gtk_hbox_new (FALSE, 6); | |
2006 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
2007 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
2008 gtk_widget_show (hbox); | |
2009 | |
2010 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); | |
2011 gtk_size_group_add_widget(sg, button); | |
2012 g_signal_connect_swapped(G_OBJECT(button), "clicked", | |
2013 G_CALLBACK(gtk_widget_destroy), prefs); | |
2014 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
2015 gtk_widget_show(button); | |
2016 | |
2017 prefs_notebook_init(); | |
2018 | |
2019 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); | |
2020 gtk_widget_show(prefs); | |
2021 } | |
2022 | |
2023 static void set_misc_option(GtkWidget *w, int option) | |
2024 { | |
2025 misc_options ^= option; | |
2026 | |
5535 | 2027 if(option == OPT_MISC_USE_SERVER_ALIAS) { |
5440 | 2028 /* XXX blist reset the aliases here */ |
2029 gaim_conversation_foreach(gaim_conversation_autoset_title); | |
2030 } | |
2031 } | |
2032 | |
2033 static void set_logging_option(GtkWidget *w, int option) | |
2034 { | |
2035 logging_options ^= option; | |
2036 | |
2037 if (option == OPT_LOG_CONVOS || option == OPT_LOG_CHATS) | |
2038 update_log_convs(); | |
2039 } | |
2040 | |
2041 static void set_blist_option(GtkWidget *w, int option) | |
2042 { | |
2043 struct gaim_gtk_buddy_list *gtkblist; | |
2044 | |
2045 gtkblist = GAIM_GTK_BLIST(gaim_get_blist()); | |
2046 | |
2047 blist_options ^= option; | |
2048 | |
2049 if (!gtkblist) | |
2050 return; | |
2051 | |
2052 if (option == OPT_BLIST_SHOW_WARN) | |
2053 gaim_gtk_blist_update_columns(); | |
2054 else if (option == OPT_BLIST_SHOW_IDLETIME) { | |
2055 gaim_gtk_blist_update_refresh_timeout(); | |
2056 gaim_gtk_blist_update_columns(); | |
2057 } | |
2058 else if (option == OPT_BLIST_SHOW_ICONS) { | |
2059 gaim_gtk_blist_update_refresh_timeout(); | |
2060 gaim_gtk_blist_refresh(gaim_get_blist()); | |
2061 gaim_gtk_blist_update_columns(); | |
2062 } else | |
2063 gaim_gtk_blist_refresh(gaim_get_blist()); | |
2064 | |
2065 } | |
2066 | |
2067 static void set_convo_option(GtkWidget *w, int option) | |
2068 { | |
2069 convo_options ^= option; | |
2070 | |
2071 if (option == OPT_CONVO_SHOW_SMILEY) | |
2072 gaim_gtkconv_toggle_smileys(); | |
2073 | |
2074 if (option == OPT_CONVO_SHOW_TIME) | |
2075 gaim_gtkconv_toggle_timestamps(); | |
2076 | |
2077 if (option == OPT_CONVO_CHECK_SPELLING) | |
2078 gaim_gtkconv_toggle_spellchk(); | |
2079 | |
2080 if (option == OPT_CONVO_NO_X_ON_TAB) | |
2081 gaim_gtkconv_toggle_close_buttons(); | |
2082 } | |
2083 | |
2084 static void set_im_option(GtkWidget *w, int option) | |
2085 { | |
2086 im_options ^= option; | |
2087 | |
2088 #if 0 | |
2089 if (option == OPT_IM_ONE_WINDOW) | |
2090 im_tabize(); | |
2091 #endif | |
2092 | |
2093 if (option == OPT_IM_HIDE_ICONS) | |
2094 gaim_gtkconv_hide_buddy_icons(); | |
2095 | |
2096 if (option == OPT_IM_ALIAS_TAB) | |
2097 gaim_conversation_foreach(gaim_conversation_autoset_title); | |
2098 | |
2099 if (option == OPT_IM_NO_ANIMATION) | |
2100 gaim_gtkconv_set_anim(); | |
2101 } | |
2102 | |
2103 static void set_chat_option(GtkWidget *w, int option) | |
2104 { | |
2105 chat_options ^= option; | |
2106 | |
2107 #if 0 | |
2108 if (option == OPT_CHAT_ONE_WINDOW) | |
2109 chat_tabize(); | |
2110 #endif | |
2111 } | |
2112 | |
2113 void set_sound_option(GtkWidget *w, int option) | |
2114 { | |
2115 sound_options ^= option; | |
2116 } | |
2117 | |
2118 static void set_font_option(GtkWidget *w, int option) | |
2119 { | |
2120 font_options ^= option; | |
2121 | |
2122 gaim_gtkconv_update_font_buttons(); | |
2123 } | |
2124 | |
2125 static void set_away_option(GtkWidget *w, int option) | |
2126 { | |
2127 away_options ^= option; | |
2128 | |
2129 if (option == OPT_AWAY_QUEUE) | |
2130 toggle_away_queue(); | |
2131 } | |
2132 | |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2133 static GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) |
5440 | 2134 { |
2135 GtkWidget *button; | |
2136 button = gtk_check_button_new_with_mnemonic(text); | |
2137 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), (*options & option)); | |
2138 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); | |
2139 g_object_set_data(G_OBJECT(button), "options", options); | |
2140 | |
2141 if (options == &misc_options) { | |
2142 g_signal_connect(G_OBJECT(button), "clicked", | |
2143 G_CALLBACK(set_misc_option), (int *)option); | |
2144 } else if (options == &logging_options) { | |
2145 g_signal_connect(G_OBJECT(button), "clicked", | |
2146 G_CALLBACK(set_logging_option), (int *)option); | |
2147 } else if (options == &blist_options) { | |
2148 g_signal_connect(G_OBJECT(button), "clicked", | |
2149 G_CALLBACK(set_blist_option), (int *)option); | |
2150 } else if (options == &convo_options) { | |
2151 g_signal_connect(G_OBJECT(button), "clicked", | |
2152 G_CALLBACK(set_convo_option), (int *)option); | |
2153 } else if (options == &im_options) { | |
2154 g_signal_connect(G_OBJECT(button), "clicked", | |
2155 G_CALLBACK(set_im_option), (int *)option); | |
2156 } else if (options == &chat_options) { | |
2157 g_signal_connect(G_OBJECT(button), "clicked", | |
2158 G_CALLBACK(set_chat_option), (int *)option); | |
2159 } else if (options == &font_options) { | |
2160 g_signal_connect(G_OBJECT(button), "clicked", | |
2161 G_CALLBACK(set_font_option), (int *)option); | |
2162 } else if (options == &sound_options) { | |
2163 g_signal_connect(G_OBJECT(button), "clicked", | |
2164 G_CALLBACK(set_sound_option), (int *)option); | |
2165 } else if (options == &away_options) { | |
2166 g_signal_connect(G_OBJECT(button), "clicked", | |
2167 G_CALLBACK(set_away_option), (int *)option); | |
2168 } else { | |
2169 gaim_debug(GAIM_DEBUG_WARNING, "gaim_button", | |
2170 "\"%s\" has no signal handler attached to it!\n", text); | |
2171 } | |
2172 gtk_widget_show(button); | |
2173 | |
2174 return button; | |
2175 } | |
2176 | |
2177 void default_away_menu_init(GtkWidget *omenu) | |
2178 { | |
2179 GtkWidget *menu, *opt; | |
2180 int index = 0; | |
2181 GSList *awy = away_messages; | |
2182 struct away_message *a; | |
2183 | |
2184 menu = gtk_menu_new(); | |
2185 | |
2186 while (awy) { | |
2187 a = (struct away_message *)awy->data; | |
2188 opt = gtk_menu_item_new_with_label(a->name); | |
2189 g_signal_connect(G_OBJECT(opt), "activate", | |
2190 G_CALLBACK(set_default_away), (gpointer)index); | |
2191 gtk_widget_show(opt); | |
2192 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
2193 | |
2194 awy = awy->next; | |
2195 index++; | |
2196 } | |
2197 | |
2198 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
2199 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
2200 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
2201 } | |
2202 | |
2203 GtkWidget *pref_fg_picture = NULL; | |
2204 GtkWidget *pref_bg_picture = NULL; | |
2205 | |
2206 void destroy_colorsel(GtkWidget *w, gpointer d) | |
2207 { | |
2208 if (d) { | |
2209 gtk_widget_destroy(fgcseld); | |
2210 fgcseld = NULL; | |
2211 } else { | |
2212 gtk_widget_destroy(bgcseld); | |
2213 bgcseld = NULL; | |
2214 } | |
2215 } | |
2216 | |
2217 void apply_color_dlg(GtkWidget *w, gpointer d) | |
2218 { | |
2219 if ((int)d == 1) { | |
2220 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
2221 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), | |
2222 &fgcolor); | |
2223 destroy_colorsel(NULL, (void *)1); | |
2224 update_color(NULL, pref_fg_picture); | |
2225 } else { | |
2226 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
2227 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), | |
2228 &bgcolor); | |
2229 destroy_colorsel(NULL, (void *)0); | |
2230 update_color(NULL, pref_bg_picture); | |
2231 } | |
2232 gaim_conversation_foreach(gaim_gtkconv_update_font_colors); | |
2233 } | |
2234 | |
2235 void set_default_away(GtkWidget *w, gpointer i) | |
2236 { | |
2237 | |
2238 int length = g_slist_length(away_messages); | |
2239 | |
2240 if (away_messages == NULL) | |
2241 default_away = NULL; | |
2242 else if ((int)i >= length) | |
2243 default_away = g_slist_nth_data(away_messages, length - 1); | |
2244 else | |
2245 default_away = g_slist_nth_data(away_messages, (int)i); | |
2246 } | |
2247 | |
2248 #ifndef _WIN32 | |
2249 static gboolean program_is_valid(const char *program) | |
2250 { | |
2251 GError *error = NULL; | |
2252 char **argv; | |
2253 gchar *progname; | |
2254 gboolean is_valid = FALSE; | |
2255 | |
2256 if (program == NULL || *program == '\0') { | |
2257 return FALSE; | |
2258 } | |
2259 | |
2260 if (!g_shell_parse_argv(program, NULL, &argv, &error)) { | |
2261 gaim_debug(GAIM_DEBUG_ERROR, "program_is_valid", | |
2262 "Could not parse program '%s': %s\n", | |
2263 program, error->message); | |
2264 g_error_free(error); | |
2265 return FALSE; | |
2266 } | |
2267 | |
2268 if (argv == NULL) { | |
2269 return FALSE; | |
2270 } | |
2271 | |
2272 progname = g_find_program_in_path(argv[0]); | |
2273 is_valid = (progname != NULL); | |
2274 | |
2275 g_strfreev(argv); | |
2276 g_free(progname); | |
2277 | |
2278 return is_valid; | |
2279 } | |
2280 #endif | |
2281 | |
2282 static void update_spin_value(GtkWidget *w, GtkWidget *spin) | |
2283 { | |
2284 int *value = g_object_get_data(G_OBJECT(spin), "val"); | |
2285 *value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); | |
2286 } | |
2287 | |
2288 GtkWidget *gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val, int min, int max, GtkSizeGroup *sg) | |
2289 { | |
2290 GtkWidget *hbox; | |
2291 GtkWidget *label; | |
2292 GtkWidget *spin; | |
2293 GtkObject *adjust; | |
2294 | |
2295 hbox = gtk_hbox_new(FALSE, 5); | |
2296 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
2297 gtk_widget_show(hbox); | |
2298 | |
2299 label = gtk_label_new_with_mnemonic(title); | |
2300 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
2301 gtk_widget_show(label); | |
2302 | |
2303 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1); | |
2304 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); | |
2305 g_object_set_data(G_OBJECT(spin), "val", val); | |
2306 gtk_widget_set_size_request(spin, 50, -1); | |
2307 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); | |
2308 g_signal_connect(G_OBJECT(adjust), "value-changed", | |
2309 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); | |
2310 gtk_widget_show(spin); | |
2311 | |
2312 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); | |
2313 | |
2314 if (sg) { | |
2315 gtk_size_group_add_widget(sg, label); | |
2316 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
2317 | |
2318 } | |
2319 return label; | |
2320 } | |
2321 | |
2322 void dropdown_set(GObject *w, int *option) | |
2323 { | |
2324 int opt = GPOINTER_TO_INT(g_object_get_data(w, "value")); | |
2325 int clear = GPOINTER_TO_INT(g_object_get_data(w, "clear")); | |
2326 | |
2327 if (option == (int*)&sort_method) { | |
2328 /* Hack city -- Population: Sean Egan */ | |
2329 char *name = (char*)opt; | |
2330 gaim_gtk_blist_sort_method_set(name); | |
2331 return; | |
2332 } | |
2333 if (clear != -1) { | |
2334 *option = *option & ~clear; | |
2335 *option = *option | opt; | |
2336 } else { | |
2337 gaim_debug(GAIM_DEBUG_MISC, "dropdown_set", "HELLO %d\n", opt); | |
2338 *option = opt; | |
2339 } | |
2340 | |
2341 if (option == (int*)&global_proxy_info.proxytype) { | |
2342 if (opt == PROXY_NONE) | |
2343 gtk_widget_set_sensitive(prefs_proxy_frame, FALSE); | |
2344 else | |
2345 gtk_widget_set_sensitive(prefs_proxy_frame, TRUE); | |
2346 } else if (option == &web_browser) { | |
2347 if (opt == BROWSER_MANUAL) | |
2348 gtk_widget_set_sensitive(gtk_widget_get_parent(browser_entry), TRUE); | |
2349 else | |
2350 gtk_widget_set_sensitive(gtk_widget_get_parent(browser_entry), FALSE); | |
2351 } else if (option == (int*)&sound_options) { | |
2352 if (opt == OPT_SOUND_CMD) | |
2353 gtk_widget_set_sensitive(sndcmd, TRUE); | |
2354 else | |
2355 gtk_widget_set_sensitive(sndcmd, FALSE); | |
2356 gaim_sound_change_output_method(); | |
2357 } else if (option == (int*)&blist_options) { | |
2358 gaim_gtk_blist_update_toolbar(); | |
2359 } else if (option == (int*)&im_options) { | |
2360 if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) | |
2361 gaim_gtkconv_update_tabs(); | |
2362 else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) | |
2363 gaim_gtkconv_update_im_button_style(); | |
2364 } else if (option == (int*)&chat_options) { | |
2365 if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) | |
2366 gaim_gtkconv_update_tabs(); | |
2367 else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) | |
2368 gaim_gtkconv_update_chat_button_style(); | |
2369 // } else if (option == (int*)&blist_options) { | |
2370 // set_blist_tab(); | |
2371 } else if (option == (int *)&conv_placement_option) { | |
2372 gaim_conv_placement_set_active(conv_placement_option); | |
2373 } | |
2374 } | |
2375 | |
2376 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) | |
2377 { | |
2378 va_list ap; | |
2379 GList *menuitems = NULL; | |
2380 GtkWidget *dropdown = NULL; | |
2381 char *name; | |
2382 int id; | |
2383 | |
2384 va_start(ap, clear); | |
2385 while ((name = va_arg(ap, char *)) != NULL) { | |
2386 id = va_arg(ap, int); | |
2387 | |
2388 menuitems = g_list_prepend(menuitems, name); | |
2389 menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(id)); | |
2390 } | |
2391 va_end(ap); | |
2392 | |
2393 g_return_val_if_fail(menuitems != NULL, NULL); | |
2394 | |
2395 menuitems = g_list_reverse(menuitems); | |
2396 | |
2397 dropdown = gaim_dropdown_from_list(box, title, option, clear, menuitems); | |
2398 | |
2399 g_list_free(menuitems); | |
2400 | |
2401 return dropdown; | |
2402 } | |
2403 | |
2404 static GtkWidget *gaim_dropdown_from_list(GtkWidget *box, const gchar *title, int *option, int clear, GList *menuitems) | |
2405 { | |
2406 GtkWidget *dropdown, *opt, *menu; | |
2407 GtkWidget *label; | |
2408 gchar *text; | |
2409 int value; | |
2410 int o = 0; | |
2411 GtkWidget *hbox; | |
2412 | |
2413 g_return_val_if_fail(menuitems != NULL, NULL); | |
2414 | |
2415 hbox = gtk_hbox_new(FALSE, 5); | |
2416 gtk_container_add (GTK_CONTAINER (box), hbox); | |
2417 gtk_widget_show(hbox); | |
2418 | |
2419 label = gtk_label_new_with_mnemonic(title); | |
2420 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
2421 gtk_widget_show(label); | |
2422 | |
2423 dropdown = gtk_option_menu_new(); | |
2424 menu = gtk_menu_new(); | |
2425 | |
2426 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); | |
2427 | |
2428 while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) { | |
2429 menuitems = g_list_next(menuitems); | |
2430 g_return_val_if_fail(menuitems != NULL, NULL); | |
2431 value = GPOINTER_TO_INT(menuitems->data); | |
2432 menuitems = g_list_next(menuitems); | |
2433 | |
2434 opt = gtk_menu_item_new_with_label(text); | |
2435 g_object_set_data(G_OBJECT(opt), "value", GINT_TO_POINTER(value)); | |
2436 g_object_set_data(G_OBJECT(opt), "clear", GINT_TO_POINTER(clear)); | |
2437 g_signal_connect(G_OBJECT(opt), "activate", | |
2438 G_CALLBACK(dropdown_set), (void *)option); | |
2439 gtk_widget_show(opt); | |
2440 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
2441 | |
2442 if (option == (int*)sort_method) { | |
2443 /* Now Entering Hacksville, Estd. May 17, 2003 */ | |
2444 gtk_menu_set_active(GTK_MENU(menu), clear); | |
2445 } else if (((clear > -1) && ((*option & clear) == value)) || *option == value) { | |
2446 gtk_menu_set_active(GTK_MENU(menu), o); | |
2447 } | |
2448 o++; | |
2449 | |
2450 } | |
2451 | |
2452 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); | |
2453 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); | |
2454 gtk_widget_show(dropdown); | |
2455 return label; | |
2456 } | |
2457 | |
2458 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) | |
2459 { | |
2460 /* more stuff stolen from X-Chat */ | |
2461 GtkWidget *swid; | |
2462 GdkColor c; | |
2463 GtkStyle *style; | |
2464 c.pixel = 0; | |
2465 if (fgc) { | |
2466 if (font_options & OPT_FONT_FGCOL) { | |
2467 c.red = fgcolor.red; | |
2468 c.blue = fgcolor.blue; | |
2469 c.green = fgcolor.green; | |
2470 } else { | |
2471 c.red = 0; | |
2472 c.blue = 0; | |
2473 c.green = 0; | |
2474 } | |
2475 } else { | |
2476 if (font_options & OPT_FONT_BGCOL) { | |
2477 c.red = bgcolor.red; | |
2478 c.blue = bgcolor.blue; | |
2479 c.green = bgcolor.green; | |
2480 } else { | |
2481 c.red = 0xffff; | |
2482 c.blue = 0xffff; | |
2483 c.green = 0xffff; | |
2484 } | |
2485 } | |
2486 | |
2487 style = gtk_style_new(); | |
2488 style->bg[0] = c; | |
2489 | |
2490 swid = gtk_event_box_new(); | |
2491 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
2492 g_object_unref(style); | |
2493 gtk_widget_set_size_request(GTK_WIDGET(swid), 40, -1); | |
2494 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); | |
2495 gtk_widget_show(swid); | |
2496 return swid; | |
2497 } | |
2498 | |
2499 void apply_font_dlg(GtkWidget *w, GtkWidget *f) | |
2500 { | |
2501 int i = 0; | |
2502 char *fontname; | |
2503 | |
2504 fontname = g_strdup(gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f))); | |
2505 destroy_fontsel(0, 0); | |
2506 | |
2507 while(fontname[i] && !isdigit(fontname[i]) && i < sizeof(fontface)) { | |
2508 fontface[i] = fontname[i]; | |
2509 i++; | |
2510 } | |
2511 | |
2512 fontface[i] = 0; | |
2513 g_free(fontname); | |
2514 | |
2515 gaim_conversation_foreach(gaim_gtkconv_update_font_face); | |
2516 } | |
2517 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2518 void |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2519 gaim_gtk_prefs_init(void) |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2520 { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2521 gaim_prefs_add_none("/gaim"); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2522 gaim_prefs_add_none("/gaim/gtk"); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2523 |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2524 /* Debug window preferences. */ |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2525 gaim_prefs_add_none("/gaim/gtk/debug"); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2526 gaim_prefs_add_bool("/gaim/gtk/debug/toolbar", TRUE); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2527 gaim_prefs_add_bool("/gaim/gtk/debug/timestamps", FALSE); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2528 gaim_prefs_add_bool("/gaim/gtk/debug/enabled", FALSE); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2529 gaim_prefs_add_int("/gaim/gtk/debug/width", 400); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2530 gaim_prefs_add_int("/gaim/gtk/debug/height", 150); |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2531 |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2532 /* Conversations */ |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2533 gaim_prefs_add_none("/gaim/gtk/conversations"); |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2534 gaim_prefs_add_bool("/gaim/gtk/conversations/show_urls_as_links", TRUE); |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2535 |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2536 /* Smiley Themes */ |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2537 gaim_prefs_add_none("/gaim/gtk/smilies"); |
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2538 gaim_prefs_add_string("/gaim/gtk/smilies/theme", ""); |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2539 } |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2540 |