Mercurial > pidgin.yaz
comparison src/prefs.c @ 652:4d3285caa191
[gaim-migrate @ 662]
damn i'm smooth
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 10 Aug 2000 00:29:06 +0000 |
parents | faa7603ae02e |
children | b3b5d9d18eea |
comparison
equal
deleted
inserted
replaced
651:650687b7ca0e | 652:4d3285caa191 |
---|---|
39 #include "pixmaps/fontface2.xpm" | 39 #include "pixmaps/fontface2.xpm" |
40 #include "pixmaps/refresh.xpm" | 40 #include "pixmaps/refresh.xpm" |
41 #include "pixmaps/gnome_add.xpm" | 41 #include "pixmaps/gnome_add.xpm" |
42 #include "pixmaps/gnome_remove.xpm" | 42 #include "pixmaps/gnome_remove.xpm" |
43 | 43 |
44 struct prefs_data *pd = NULL; | |
45 struct debug_window *dw = NULL; | 44 struct debug_window *dw = NULL; |
46 | 45 static GtkWidget *prefs = NULL; |
47 GtkWidget *debugbutton; | 46 |
47 static GtkWidget *gaim_button(const char *, int *, int, GtkWidget *); | |
48 static void prefs_build_general(GtkWidget *); | |
49 static void prefs_build_connect(GtkWidget *); | |
50 static void prefs_build_buddy(GtkWidget *); | |
51 static void prefs_build_convo(GtkWidget *); | |
52 static void prefs_build_sound(GtkWidget *); | |
53 static void prefs_build_away(GtkWidget *); | |
54 static void prefs_build_browser(GtkWidget *); | |
55 static gint handle_delete(GtkWidget *, GdkEvent *, void *); | |
56 | |
57 static GtkWidget *prefdialog = NULL; | |
58 static GtkWidget *debugbutton = NULL; | |
59 GtkWidget *prefs_away_list = NULL; | |
60 | |
61 static void general_page() | |
62 { | |
63 GtkWidget *parent; | |
64 GtkWidget *box; | |
65 GtkWidget *label; | |
66 GtkWidget *sep; | |
67 GtkWidget *idle; | |
68 | |
69 parent = prefdialog->parent; | |
70 gtk_widget_destroy(prefdialog); | |
71 debugbutton = NULL; | |
72 prefs_away_list = NULL; | |
73 | |
74 prefdialog = gtk_frame_new(_("General Options")); | |
75 gtk_container_add(GTK_CONTAINER(parent), prefdialog); | |
76 | |
77 box = gtk_vbox_new(FALSE, 5); | |
78 gtk_container_add(GTK_CONTAINER(prefdialog), box); | |
79 gtk_widget_show(box); | |
80 | |
81 label = gtk_label_new(_("All options take effect immediately unless otherwise noted.")); | |
82 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); | |
83 gtk_widget_show(label); | |
84 | |
85 gaim_button(_("Remember password"), &general_options, OPT_GEN_REMEMBER_PASS, box); | |
86 gaim_button(_("Auto-login"), &general_options, OPT_GEN_AUTO_LOGIN, box); | |
87 | |
88 sep = gtk_hseparator_new(); | |
89 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5); | |
90 gtk_widget_show(sep); | |
91 | |
92 gaim_button(_("Show Lagometer"), &general_options, OPT_GEN_SHOW_LAGMETER, box); | |
93 gaim_button(_("Use borderless buttons (requires restart for some buttons)"), &display_options, OPT_DISP_COOL_LOOK, box); | |
94 gaim_button(_("Show Buddy Ticker after restart"), &display_options, OPT_DISP_SHOW_BUDDYTICKER, box); | |
95 if (!dw && (general_options & OPT_GEN_DEBUG)) | |
96 general_options = general_options ^ OPT_GEN_DEBUG; | |
97 debugbutton = gaim_button(_("Show Debug Window"), &general_options, OPT_GEN_DEBUG, box); | |
98 gtk_signal_connect_object(GTK_OBJECT(debugbutton), "clicked", GTK_SIGNAL_FUNC(show_debug), 0); | |
99 | |
100 sep = gtk_hseparator_new(); | |
101 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5); | |
102 gtk_widget_show(sep); | |
103 | |
104 idle = gaim_button(_("Report Idle Times"), &report_idle, 1, box); | |
105 gtk_signal_connect(GTK_OBJECT(idle), "clicked", set_option, &report_idle); | |
106 | |
107 gtk_widget_show(prefdialog); | |
108 } | |
109 | |
110 static GtkWidget *aim_host_entry; | |
111 static GtkWidget *aim_port_entry; | |
112 static GtkWidget *login_host_entry; | |
113 static GtkWidget *login_port_entry; | |
114 static GtkWidget *proxy_host_entry; | |
115 static GtkWidget *proxy_port_entry; | |
116 | |
117 static int connection_key_pressed(GtkWidget *w, GdkEvent *event, void *dummy) | |
118 { | |
119 g_snprintf(aim_host, sizeof(aim_host), "%s", gtk_entry_get_text(GTK_ENTRY(aim_host_entry))); | |
120 sscanf(gtk_entry_get_text(GTK_ENTRY(aim_port_entry)), "%d", &aim_port); | |
121 g_snprintf(login_host, sizeof(login_host), "%s", gtk_entry_get_text(GTK_ENTRY(login_host_entry))); | |
122 sscanf(gtk_entry_get_text(GTK_ENTRY(login_port_entry)), "%d", &login_port); | |
123 if (proxy_type != PROXY_NONE) { | |
124 g_snprintf(proxy_host, sizeof(proxy_host), "%s", gtk_entry_get_text(GTK_ENTRY(proxy_host_entry))); | |
125 sscanf(gtk_entry_get_text(GTK_ENTRY(proxy_port_entry)), "%d", &proxy_port); | |
126 } | |
127 save_prefs(); | |
128 return TRUE; | |
129 } | |
130 | |
131 static void set_connect(GtkWidget *w, int *data) | |
132 { | |
133 proxy_type = (int)data; | |
134 if (proxy_type != PROXY_NONE) { | |
135 if (proxy_host_entry) | |
136 gtk_widget_set_sensitive(proxy_host_entry, TRUE); | |
137 if (proxy_port_entry) | |
138 gtk_widget_set_sensitive(proxy_port_entry, TRUE); | |
139 } else { | |
140 if (proxy_host_entry) | |
141 gtk_widget_set_sensitive(proxy_host_entry, FALSE); | |
142 if (proxy_port_entry) | |
143 gtk_widget_set_sensitive(proxy_port_entry, FALSE); | |
144 } | |
145 | |
146 save_prefs(); | |
147 } | |
148 | |
149 static GtkWidget *connect_radio(char *label, int which, GtkWidget *box, GtkWidget *set) | |
150 { | |
151 GtkWidget *opt; | |
152 | |
153 if (!set) | |
154 opt = gtk_radio_button_new_with_label(NULL, label); | |
155 else | |
156 opt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(set)), label); | |
157 gtk_box_pack_start(GTK_BOX(box), opt, FALSE, FALSE, 0); | |
158 gtk_signal_connect(GTK_OBJECT(opt), "clicked", GTK_SIGNAL_FUNC(set_connect), (void *)which); | |
159 gtk_widget_show(opt); | |
160 if (web_browser == which) | |
161 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); | |
162 | |
163 return opt; | |
164 } | |
165 | |
166 static void connect_page() | |
167 { | |
168 GtkWidget *parent; | |
169 GtkWidget *box; | |
170 GtkWidget *label; | |
171 GtkWidget *sep; | |
172 GtkWidget *hbox; | |
173 GtkWidget *opt; | |
174 char buffer[1024]; | |
175 | |
176 parent = prefdialog->parent; | |
177 gtk_widget_destroy(prefdialog); | |
178 debugbutton = NULL; | |
179 prefs_away_list = NULL; | |
180 | |
181 prefdialog = gtk_frame_new(_("Connection Options")); | |
182 gtk_container_add(GTK_CONTAINER(parent), prefdialog); | |
183 | |
184 box = gtk_vbox_new(FALSE, 5); | |
185 gtk_container_add(GTK_CONTAINER(prefdialog), box); | |
186 gtk_widget_show(box); | |
187 | |
188 label = gtk_label_new(_("All options take effect immediately unless otherwise noted.")); | |
189 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); | |
190 gtk_widget_show(label); | |
191 | |
192 gaim_button(_("Use Oscar Protocol (experimental; only takes effect before signon)"), &general_options, OPT_GEN_USE_OSCAR, box); | |
193 | |
194 sep = gtk_hseparator_new(); | |
195 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5); | |
196 gtk_widget_show(sep); | |
197 | |
198 label = gtk_label_new(_("The following options do not apply if you use Oscar.")); | |
199 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); | |
200 gtk_widget_show(label); | |
201 | |
202 hbox = gtk_hbox_new(FALSE, 0); | |
203 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); | |
204 gtk_widget_show(hbox); | |
205 | |
206 label = gtk_label_new(_("TOC Host:")); | |
207 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
208 gtk_widget_show(label); | |
209 | |
210 aim_host_entry = gtk_entry_new(); | |
211 gtk_box_pack_start(GTK_BOX(hbox), aim_host_entry, FALSE, FALSE, 0); | |
212 gtk_entry_set_text(GTK_ENTRY(aim_host_entry), aim_host); | |
213 gtk_signal_connect(GTK_OBJECT(aim_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
214 gtk_widget_show(aim_host_entry); | |
215 | |
216 label = gtk_label_new(_("Port:")); | |
217 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
218 gtk_widget_show(label); | |
219 | |
220 aim_port_entry = gtk_entry_new(); | |
221 gtk_box_pack_start(GTK_BOX(hbox), aim_port_entry, FALSE, FALSE, 0); | |
222 g_snprintf(buffer, sizeof(buffer), "%d", aim_port); | |
223 gtk_entry_set_text(GTK_ENTRY(aim_port_entry), buffer); | |
224 gtk_signal_connect(GTK_OBJECT(aim_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
225 gtk_widget_show(aim_port_entry); | |
226 | |
227 hbox = gtk_hbox_new(FALSE, 0); | |
228 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); | |
229 gtk_widget_show(hbox); | |
230 | |
231 label = gtk_label_new(_("Login Host:")); | |
232 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
233 gtk_widget_show(label); | |
234 | |
235 login_host_entry = gtk_entry_new(); | |
236 gtk_box_pack_start(GTK_BOX(hbox), login_host_entry, FALSE, FALSE, 0); | |
237 gtk_entry_set_text(GTK_ENTRY(login_host_entry), login_host); | |
238 gtk_signal_connect(GTK_OBJECT(login_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
239 gtk_widget_show(login_host_entry); | |
240 | |
241 label = gtk_label_new(_("Port:")); | |
242 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
243 gtk_widget_show(label); | |
244 | |
245 login_port_entry = gtk_entry_new(); | |
246 gtk_box_pack_start(GTK_BOX(hbox), login_port_entry, FALSE, FALSE, 0); | |
247 g_snprintf(buffer, sizeof(buffer), "%d", login_port); | |
248 gtk_entry_set_text(GTK_ENTRY(login_port_entry), buffer); | |
249 gtk_signal_connect(GTK_OBJECT(login_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
250 gtk_widget_show(login_port_entry); | |
251 | |
252 opt = connect_radio(_("No Proxy"), PROXY_NONE, box, NULL); | |
253 opt = connect_radio(_("HTTP Proxy"), PROXY_HTTP, box, opt); | |
254 opt = connect_radio(_("Socks 4 Proxy"), PROXY_SOCKS4, box, opt); | |
255 opt = connect_radio(_("Socks 5 Proxy"), PROXY_SOCKS5, box, opt); | |
256 | |
257 hbox = gtk_hbox_new(FALSE, 0); | |
258 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); | |
259 gtk_widget_show(hbox); | |
260 | |
261 label = gtk_label_new(_("Proxy Host:")); | |
262 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
263 gtk_widget_show(label); | |
264 | |
265 proxy_host_entry = gtk_entry_new(); | |
266 gtk_box_pack_start(GTK_BOX(hbox), proxy_host_entry, FALSE, FALSE, 0); | |
267 gtk_entry_set_text(GTK_ENTRY(proxy_host_entry), proxy_host); | |
268 gtk_signal_connect(GTK_OBJECT(proxy_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
269 gtk_widget_show(proxy_host_entry); | |
270 | |
271 hbox = gtk_hbox_new(FALSE, 0); | |
272 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); | |
273 gtk_widget_show(hbox); | |
274 | |
275 label = gtk_label_new(_("Port:")); | |
276 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
277 gtk_widget_show(label); | |
278 | |
279 proxy_port_entry = gtk_entry_new(); | |
280 gtk_box_pack_start(GTK_BOX(hbox), proxy_port_entry, FALSE, FALSE, 0); | |
281 g_snprintf(buffer, sizeof(buffer), "%d", proxy_port); | |
282 gtk_entry_set_text(GTK_ENTRY(proxy_port_entry), buffer); | |
283 gtk_signal_connect(GTK_OBJECT(proxy_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
284 gtk_widget_show(proxy_port_entry); | |
285 | |
286 if (proxy_type != PROXY_NONE) { | |
287 gtk_widget_set_sensitive(proxy_host_entry, TRUE); | |
288 gtk_widget_set_sensitive(proxy_port_entry, TRUE); | |
289 } else { | |
290 gtk_widget_set_sensitive(proxy_host_entry, FALSE); | |
291 gtk_widget_set_sensitive(proxy_port_entry, FALSE); | |
292 } | |
293 | |
294 gtk_widget_show(prefdialog); | |
295 } | |
296 | |
297 static void buddy_page() | |
298 { | |
299 GtkWidget *parent; | |
300 GtkWidget *box; | |
301 GtkWidget *label; | |
302 | |
303 parent = prefdialog->parent; | |
304 gtk_widget_destroy(prefdialog); | |
305 debugbutton = NULL; | |
306 prefs_away_list = NULL; | |
307 | |
308 prefdialog = gtk_frame_new(_("Buddy List Options")); | |
309 gtk_container_add(GTK_CONTAINER(parent), prefdialog); | |
310 | |
311 box = gtk_vbox_new(FALSE, 5); | |
312 gtk_container_add(GTK_CONTAINER(prefdialog), box); | |
313 gtk_widget_show(box); | |
314 | |
315 label = gtk_label_new(_("All options take effect immediately unless otherwise noted.")); | |
316 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); | |
317 gtk_widget_show(label); | |
318 | |
319 gaim_button(_("Show numbers in groups"), &display_options, OPT_DISP_SHOW_GRPNUM, box); | |
320 gaim_button(_("Show idle times"), &display_options, OPT_DISP_SHOW_IDLETIME, box); | |
321 gaim_button(_("Show buddy type icons"), &display_options, OPT_DISP_SHOW_PIXMAPS, box); | |
322 gaim_button(_("Show pictures on buttons"), &display_options, OPT_DISP_SHOW_BUTTON_XPM, box); | |
323 gaim_button(_("Use Daemon pictures"), &display_options, OPT_DISP_DEVIL_PIXMAPS, box); | |
324 | |
325 gtk_widget_show(prefdialog); | |
326 } | |
327 | |
328 static void convo_page() | |
329 { | |
330 GtkWidget *parent; | |
331 GtkWidget *box; | |
332 GtkWidget *label; | |
333 GtkWidget *sep; | |
334 | |
335 parent = prefdialog->parent; | |
336 gtk_widget_destroy(prefdialog); | |
337 debugbutton = NULL; | |
338 prefs_away_list = NULL; | |
339 | |
340 prefdialog = gtk_frame_new(_("Conversation Window Options")); | |
341 gtk_container_add(GTK_CONTAINER(parent), prefdialog); | |
342 | |
343 box = gtk_vbox_new(FALSE, 5); | |
344 gtk_container_add(GTK_CONTAINER(prefdialog), box); | |
345 gtk_widget_show(box); | |
346 | |
347 label = gtk_label_new(_("All options take effect immediately unless otherwise noted.")); | |
348 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); | |
349 gtk_widget_show(label); | |
350 | |
351 gaim_button(_("Enter sends message"), &general_options, OPT_GEN_ENTER_SENDS, box); | |
352 gaim_button(_("Control-{B/I/U/S} inserts HTML tags"), &general_options, OPT_GEN_CTL_CHARS, box); | |
353 | |
354 sep = gtk_hseparator_new(); | |
355 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5); | |
356 gtk_widget_show(sep); | |
357 | |
358 gaim_button(_("Show graphical smileys"), &display_options, OPT_DISP_SHOW_SMILEY, box); | |
359 gaim_button(_("Ignore incoming colors"), &display_options, OPT_DISP_IGNORE_COLOUR, box); | |
360 gaim_button(_("Show timestamp on messages"), &display_options, OPT_DISP_SHOW_TIME, box); | |
361 | |
362 sep = gtk_hseparator_new(); | |
363 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5); | |
364 gtk_widget_show(sep); | |
365 | |
366 gaim_button(_("Highlight misspelled words"), &general_options, OPT_GEN_CHECK_SPELLING, box); | |
367 gaim_button(_("Show URLs as links"), &general_options, OPT_GEN_SEND_LINKS, box); | |
368 gaim_button(_("Sending messages removes away status"), &general_options, OPT_GEN_BACK_ON_IM, box); | |
369 | |
370 gtk_widget_show(prefdialog); | |
371 } | |
372 | |
373 static void im_page() | |
374 { | |
375 GtkWidget *parent; | |
376 GtkWidget *box; | |
377 GtkWidget *label; | |
378 | |
379 parent = prefdialog->parent; | |
380 gtk_widget_destroy(prefdialog); | |
381 debugbutton = NULL; | |
382 prefs_away_list = NULL; | |
383 | |
384 prefdialog = gtk_frame_new(_("IM Options")); | |
385 gtk_container_add(GTK_CONTAINER(parent), prefdialog); | |
386 | |
387 box = gtk_vbox_new(FALSE, 5); | |
388 gtk_container_add(GTK_CONTAINER(prefdialog), box); | |
389 gtk_widget_show(box); | |
390 | |
391 label = gtk_label_new(_("All options take effect immediately unless otherwise noted.")); | |
392 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); | |
393 gtk_widget_show(label); | |
394 | |
395 gaim_button(_("Show logins in window"), &display_options, OPT_DISP_SHOW_LOGON, box); | |
396 gaim_button(_("Raise windows on events"), &general_options, OPT_GEN_POPUP_WINDOWS, box); | |
397 gaim_button(_("Ignore new conversations when away"), &general_options, OPT_GEN_DISCARD_WHEN_AWAY, box); | |
398 | |
399 gtk_widget_show(prefdialog); | |
400 } | |
401 | |
402 static void chat_page() | |
403 { | |
404 GtkWidget *parent; | |
405 GtkWidget *box; | |
406 GtkWidget *label; | |
407 | |
408 parent = prefdialog->parent; | |
409 gtk_widget_destroy(prefdialog); | |
410 debugbutton = NULL; | |
411 prefs_away_list = NULL; | |
412 | |
413 prefdialog = gtk_frame_new(_("Chat Options")); | |
414 gtk_container_add(GTK_CONTAINER(parent), prefdialog); | |
415 | |
416 box = gtk_vbox_new(FALSE, 5); | |
417 gtk_container_add(GTK_CONTAINER(prefdialog), box); | |
418 gtk_widget_show(box); | |
419 | |
420 label = gtk_label_new(_("All options take effect immediately unless otherwise noted.")); | |
421 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); | |
422 gtk_widget_show(label); | |
423 | |
424 gaim_button(_("Show people joining/leaving in window"), &display_options, OPT_DISP_CHAT_LOGON, box); | |
425 gaim_button(_("Raise windows on events"), &general_options, OPT_GEN_POPUP_CHAT, box); | |
426 | |
427 gtk_widget_show(prefdialog); | |
428 } | |
48 | 429 |
49 struct chat_page { | 430 struct chat_page { |
50 GtkWidget *list1; | 431 GtkWidget *list1; |
51 GtkWidget *list2; | 432 GtkWidget *list2; |
52 }; | 433 }; |
53 | 434 |
54 | 435 static struct chat_page *cp = NULL; |
55 char debug_buff[BUF_LONG]; | 436 |
56 | 437 static refresh_list(GtkWidget *w, gpointer *m) |
57 void do_chat_page(GtkWidget *page); | 438 { |
58 | 439 char *text = grab_url("http://www.aol.com/community/chat/allchats.html"); |
59 void list_clicked( GtkWidget *widget, struct away_message *a); | 440 char *c; |
60 void list_unclicked( GtkWidget *widget, struct away_message *a); | 441 int len = strlen(text); |
61 | 442 GtkWidget *item; |
62 void show_debug(GtkObject *); | 443 GList *items = GTK_LIST(cp->list1)->children; |
63 | 444 struct chat_room *cr; |
64 void remove_away_message(GtkWidget *widget, void *dummy) | 445 c = text; |
65 { | 446 |
66 GList *i; | 447 while(items) { |
67 struct away_message *a; | 448 g_free(gtk_object_get_user_data(GTK_OBJECT(items->data))); |
68 | 449 items = items->next; |
69 i = GTK_LIST(pd->away_list)->selection; | 450 } |
70 | 451 |
71 a = gtk_object_get_user_data(GTK_OBJECT(i->data)); | 452 items = NULL; |
72 | 453 |
73 rem_away_mess(NULL, a); | 454 gtk_list_clear_items(GTK_LIST(cp->list1), 0, -1); |
74 } | 455 |
75 | 456 item = gtk_list_item_new_with_label(_("Gaim Chat")); |
76 void away_list_clicked( GtkWidget *widget, struct away_message *a) | 457 cr = g_new0(struct chat_room, 1); |
458 strcpy(cr->name, _("Gaim Chat")); | |
459 cr->exchange = 4; | |
460 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
461 gtk_widget_show(item); | |
462 | |
463 items = g_list_append(NULL, item); | |
464 | |
465 while(c) { | |
466 if (c - text > len - 30) | |
467 break; /* assume no chat rooms 30 from end, padding */ | |
468 if (!strncasecmp(AOL_SRCHSTR, c, strlen(AOL_SRCHSTR))) { | |
469 char *t; | |
470 int len=0; | |
471 int exchange; | |
472 char *name = NULL; | |
473 | |
474 c += strlen(AOL_SRCHSTR); | |
475 t = c; | |
476 while(t) { | |
477 len++; | |
478 name = g_realloc(name, len); | |
479 if (*t == '+') | |
480 name[len - 1] = ' '; | |
481 else if (*t == '&') { | |
482 name[len - 1] = 0; | |
483 sscanf(t, "&Exchange=%d", &exchange); | |
484 c = t + strlen("&Exchange=x"); | |
485 break; | |
486 } else | |
487 name[len - 1] = *t; | |
488 t++; | |
489 } | |
490 cr = g_new0(struct chat_room, 1); | |
491 strcpy(cr->name, name); | |
492 cr->exchange = exchange; | |
493 item = gtk_list_item_new_with_label(name); | |
494 gtk_widget_show(item); | |
495 items = g_list_append(items, item); | |
496 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
497 g_free(name); | |
498 } | |
499 c++; | |
500 } | |
501 gtk_list_append_items(GTK_LIST(cp->list1), items); | |
502 g_free(text); | |
503 } | |
504 | |
505 static void add_chat(GtkWidget *w, gpointer *m) | |
506 { | |
507 GList *sel = GTK_LIST(cp->list1)->selection; | |
508 struct chat_room *cr, *cr2; | |
509 GList *crs = chat_rooms; | |
510 GtkWidget *item; | |
511 | |
512 if (sel) { | |
513 cr = (struct chat_room *)gtk_object_get_user_data(GTK_OBJECT(sel->data)); | |
514 } else | |
515 return; | |
516 | |
517 while(crs) { | |
518 cr2 = (struct chat_room *)crs->data; | |
519 if (!strcasecmp(cr->name, cr2->name)) | |
520 return; | |
521 crs = crs->next; | |
522 } | |
523 item = gtk_list_item_new_with_label(cr->name); | |
524 cr2 = g_new0(struct chat_room, 1); | |
525 strcpy(cr2->name, cr->name); | |
526 cr2->exchange = cr->exchange; | |
527 gtk_object_set_user_data(GTK_OBJECT(item), cr2); | |
528 gtk_widget_show(item); | |
529 sel = g_list_append(NULL, item); | |
530 gtk_list_append_items(GTK_LIST(cp->list2), sel); | |
531 chat_rooms = g_list_append(chat_rooms, cr2); | |
532 | |
533 setup_buddy_chats(); | |
534 save_prefs(); | |
535 | |
536 | |
537 } | |
538 | |
539 static void remove_chat(GtkWidget *w, gpointer *m) | |
540 { | |
541 GList *sel = GTK_LIST(cp->list2)->selection; | |
542 struct chat_room *cr; | |
543 GList *crs; | |
544 GtkWidget *item; | |
545 | |
546 if (sel) { | |
547 item = (GtkWidget *)sel->data; | |
548 cr = (struct chat_room *)gtk_object_get_user_data(GTK_OBJECT(item)); | |
549 } else | |
550 return; | |
551 | |
552 chat_rooms = g_list_remove(chat_rooms, cr); | |
553 | |
554 | |
555 gtk_list_clear_items(GTK_LIST(cp->list2), 0, -1); | |
556 | |
557 if (g_list_length(chat_rooms) == 0) | |
558 chat_rooms = NULL; | |
559 | |
560 crs = chat_rooms; | |
561 | |
562 while(crs) { | |
563 cr = (struct chat_room *)crs->data; | |
564 item = gtk_list_item_new_with_label(cr->name); | |
565 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
566 gtk_widget_show(item); | |
567 gtk_list_append_items(GTK_LIST(cp->list2), g_list_append(NULL, item)); | |
568 | |
569 | |
570 crs = crs->next; | |
571 } | |
572 | |
573 setup_buddy_chats(); | |
574 save_prefs(); | |
575 } | |
576 | |
577 static void room_page() | |
578 { | |
579 GtkWidget *table; | |
580 GtkWidget *rem_button, *add_button, *ref_button; | |
581 GtkWidget *list1, *list2; | |
582 GtkWidget *label; | |
583 GtkWidget *sw1, *sw2; | |
584 GtkWidget *item; | |
585 GList *crs = chat_rooms; | |
586 GList *items = NULL; | |
587 struct chat_room *cr; | |
588 | |
589 GtkWidget *parent; | |
590 GtkWidget *box; | |
591 | |
592 if (!cp) | |
593 g_free(cp); | |
594 cp = g_new0(struct chat_page, 1); | |
595 | |
596 parent = prefdialog->parent; | |
597 gtk_widget_destroy(prefdialog); | |
598 debugbutton = NULL; | |
599 prefs_away_list = NULL; | |
600 | |
601 prefdialog = gtk_frame_new(_("Chat Options")); | |
602 gtk_container_add(GTK_CONTAINER(parent), prefdialog); | |
603 | |
604 box = gtk_vbox_new(FALSE, 5); | |
605 gtk_container_add(GTK_CONTAINER(prefdialog), box); | |
606 gtk_widget_show(box); | |
607 | |
608 table = gtk_table_new(4, 2, FALSE); | |
609 gtk_widget_show(table); | |
610 | |
611 gtk_box_pack_start(GTK_BOX(box), table, TRUE, TRUE, 0); | |
612 | |
613 list1 = gtk_list_new(); | |
614 list2 = gtk_list_new(); | |
615 sw1 = gtk_scrolled_window_new(NULL, NULL); | |
616 sw2 = gtk_scrolled_window_new(NULL, NULL); | |
617 | |
618 ref_button = picture_button(prefs, _("Refresh"), refresh_xpm); | |
619 add_button = picture_button(prefs, _("Add"), gnome_add_xpm); | |
620 rem_button = picture_button(prefs, _("Remove"), gnome_remove_xpm); | |
621 gtk_widget_show(list1); | |
622 gtk_widget_show(sw1); | |
623 gtk_widget_show(list2); | |
624 gtk_widget_show(sw2); | |
625 | |
626 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw1), list1); | |
627 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), list2); | |
628 | |
629 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw1), | |
630 GTK_POLICY_AUTOMATIC,GTK_POLICY_ALWAYS); | |
631 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), | |
632 GTK_POLICY_AUTOMATIC,GTK_POLICY_ALWAYS); | |
633 | |
634 cp->list1 = list1; | |
635 cp->list2 = list2; | |
636 | |
637 gtk_signal_connect(GTK_OBJECT(ref_button), "clicked", | |
638 GTK_SIGNAL_FUNC(refresh_list), cp); | |
639 gtk_signal_connect(GTK_OBJECT(rem_button), "clicked", | |
640 GTK_SIGNAL_FUNC(remove_chat), cp); | |
641 gtk_signal_connect(GTK_OBJECT(add_button), "clicked", | |
642 GTK_SIGNAL_FUNC(add_chat), cp); | |
643 | |
644 | |
645 | |
646 label = gtk_label_new(_("List of available chats")); | |
647 gtk_widget_show(label); | |
648 | |
649 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, | |
650 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
651 gtk_table_attach(GTK_TABLE(table), ref_button, 0, 1, 1, 2, | |
652 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
653 gtk_table_attach(GTK_TABLE(table), sw1, 0, 1, 2, 3, | |
654 GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, | |
655 5, 5); | |
656 gtk_table_attach(GTK_TABLE(table), add_button, 0, 1, 3, 4, | |
657 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
658 | |
659 | |
660 label = gtk_label_new(_("List of subscribed chats")); | |
661 gtk_widget_show(label); | |
662 | |
663 gtk_table_attach(GTK_TABLE(table), label, 1, 2, 0, 1, | |
664 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
665 gtk_table_attach(GTK_TABLE(table), sw2, 1, 2, 2, 3, | |
666 GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, | |
667 5, 5); | |
668 gtk_table_attach(GTK_TABLE(table), rem_button, 1, 2, 3, 4, | |
669 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
670 | |
671 | |
672 item = gtk_list_item_new_with_label(_("Gaim Chat")); | |
673 cr = g_new0(struct chat_room, 1); | |
674 strcpy(cr->name, _("Gaim Chat")); | |
675 cr->exchange = 4; | |
676 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
677 gtk_widget_show(item); | |
678 gtk_list_append_items(GTK_LIST(list1), g_list_append(NULL, item)); | |
679 | |
680 | |
681 while(crs) { | |
682 cr = (struct chat_room *)crs->data; | |
683 item = gtk_list_item_new_with_label(cr->name); | |
684 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
685 gtk_widget_show(item); | |
686 items = g_list_append(items, item); | |
687 | |
688 crs = crs->next; | |
689 } | |
690 | |
691 gtk_list_append_items(GTK_LIST(list2), items); | |
692 | |
693 gtk_widget_show(prefdialog); | |
694 } | |
695 | |
696 static void font_page() | |
697 { | |
698 GtkWidget *parent; | |
699 GtkWidget *box; | |
700 GtkWidget *label; | |
701 GtkWidget *sep; | |
702 GtkWidget *hbox; | |
703 GtkWidget *button; | |
704 GtkWidget *select; | |
705 | |
706 parent = prefdialog->parent; | |
707 gtk_widget_destroy(prefdialog); | |
708 debugbutton = NULL; | |
709 prefs_away_list = NULL; | |
710 | |
711 prefdialog = gtk_frame_new(_("Font Options")); | |
712 gtk_container_add(GTK_CONTAINER(parent), prefdialog); | |
713 | |
714 box = gtk_vbox_new(FALSE, 5); | |
715 gtk_container_add(GTK_CONTAINER(prefdialog), box); | |
716 gtk_widget_show(box); | |
717 | |
718 label = gtk_label_new(_("All options take effect immediately unless otherwise noted.")); | |
719 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); | |
720 gtk_widget_show(label); | |
721 | |
722 gaim_button(_("Bold Text"), &font_options, OPT_FONT_BOLD, box); | |
723 gaim_button(_("Italics Text"), &font_options, OPT_FONT_ITALIC, box); | |
724 gaim_button(_("Underlined Text"), &font_options, OPT_FONT_UNDERLINE, box); | |
725 gaim_button(_("Strike Text"), &font_options, OPT_FONT_STRIKE, box); | |
726 | |
727 sep = gtk_hseparator_new(); | |
728 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5); | |
729 gtk_widget_show(sep); | |
730 | |
731 /* | |
732 label = gtk_label_new(_("FIXME : This is where bg/fg color should go")); | |
733 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); | |
734 gtk_widget_show(label); | |
735 | |
736 sep = gtk_hseparator_new(); | |
737 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5); | |
738 gtk_widget_show(sep); | |
739 */ | |
740 | |
741 hbox = gtk_hbox_new(FALSE, 5); | |
742 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
743 gtk_widget_show(hbox); | |
744 | |
745 button = gaim_button(_("Font Face for Text"), &font_options, OPT_FONT_FACE, hbox); | |
746 | |
747 select = picture_button(prefs, _("Select"), fontface2_xpm); | |
748 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
749 if (!(font_options & OPT_FONT_FACE)) | |
750 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
751 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_font_dialog), NULL); | |
752 gtk_widget_show(select); | |
753 | |
754 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
755 | |
756 gtk_widget_show(prefdialog); | |
757 } | |
758 | |
759 static void sound_page() | |
760 { | |
761 GtkWidget *parent; | |
762 GtkWidget *box; | |
763 GtkWidget *label; | |
764 | |
765 parent = prefdialog->parent; | |
766 gtk_widget_destroy(prefdialog); | |
767 debugbutton = NULL; | |
768 prefs_away_list = NULL; | |
769 | |
770 prefdialog = gtk_frame_new(_("Sound Options")); | |
771 gtk_container_add(GTK_CONTAINER(parent), prefdialog); | |
772 | |
773 box = gtk_vbox_new(FALSE, 5); | |
774 gtk_container_add(GTK_CONTAINER(prefdialog), box); | |
775 gtk_widget_show(box); | |
776 | |
777 label = gtk_label_new(_("All options take effect immediately unless otherwise noted.")); | |
778 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); | |
779 gtk_widget_show(label); | |
780 | |
781 #ifdef USE_GNOME | |
782 gaim_button(_("Sounds go through GNOME"), &sound_options, OPT_SOUND_THROUGH_GNOME, box); | |
783 #endif | |
784 gaim_button(_("No sounds when you log in"), &sound_options, OPT_SOUND_SILENT_SIGNON, box); | |
785 gaim_button(_("Sounds while away"), &sound_options, OPT_SOUND_WHEN_AWAY, box); | |
786 | |
787 gtk_widget_show(prefdialog); | |
788 } | |
789 | |
790 static void event_page() | |
791 { | |
792 GtkWidget *parent; | |
793 GtkWidget *box; | |
794 GtkWidget *label; | |
795 GtkWidget *sep; | |
796 | |
797 parent = prefdialog->parent; | |
798 gtk_widget_destroy(prefdialog); | |
799 debugbutton = NULL; | |
800 prefs_away_list = NULL; | |
801 | |
802 prefdialog = gtk_frame_new(_("Sound Events")); | |
803 gtk_container_add(GTK_CONTAINER(parent), prefdialog); | |
804 | |
805 box = gtk_vbox_new(FALSE, 5); | |
806 gtk_container_add(GTK_CONTAINER(prefdialog), box); | |
807 gtk_widget_show(box); | |
808 | |
809 label = gtk_label_new(_("All options take effect immediately unless otherwise noted.")); | |
810 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); | |
811 gtk_widget_show(label); | |
812 | |
813 gaim_button(_("Sound when buddy logs in"), &sound_options, OPT_SOUND_LOGIN, box); | |
814 gaim_button(_("Sound when buddy logs out"), &sound_options, OPT_SOUND_LOGOUT, box); | |
815 gaim_button(_("Sound when message is received"), &sound_options, OPT_SOUND_RECV, box); | |
816 gaim_button(_("Sound when message is first received"), &sound_options, OPT_SOUND_FIRST_RCV, box); | |
817 gaim_button(_("Sound when message is sent"), &sound_options, OPT_SOUND_SEND, box); | |
818 | |
819 sep = gtk_hseparator_new(); | |
820 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5); | |
821 gtk_widget_show(sep); | |
822 | |
823 gaim_button(_("Sound in chat rooms when people enter/leave"), &sound_options, OPT_SOUND_CHAT_JOIN, box); | |
824 gaim_button(_("Sound in chat rooms when people talk"), &sound_options, OPT_SOUND_CHAT_SAY, box); | |
825 | |
826 gtk_widget_show(prefdialog); | |
827 } | |
828 | |
829 static struct away_message *cur_message; | |
830 static char *edited_message; | |
831 static GtkWidget *away_text; | |
832 | |
833 void away_list_clicked(GtkWidget *widget, struct away_message *a) | |
77 { | 834 { |
78 gchar buffer[2048]; | 835 gchar buffer[2048]; |
79 guint text_len; | 836 guint text_len; |
80 | 837 |
81 pd->cur_message = a; | 838 cur_message = a; |
82 | 839 |
83 /* Get proper Length */ | 840 /* Get proper Length */ |
84 text_len = gtk_text_get_length(GTK_TEXT(pd->away_text)); | 841 text_len = gtk_text_get_length(GTK_TEXT(away_text)); |
85 pd->edited_message = gtk_editable_get_chars(GTK_EDITABLE(pd->away_text), 0, text_len); | 842 edited_message = gtk_editable_get_chars(GTK_EDITABLE(away_text), 0, text_len); |
86 | 843 |
87 /* Clear the Box */ | 844 /* Clear the Box */ |
88 gtk_text_set_point(GTK_TEXT(pd->away_text), 0 ); | 845 gtk_text_set_point(GTK_TEXT(away_text), 0 ); |
89 gtk_text_forward_delete (GTK_TEXT(pd->away_text), text_len); | 846 gtk_text_forward_delete (GTK_TEXT(away_text), text_len); |
90 | 847 |
91 /* Fill the text box with new message */ | 848 /* Fill the text box with new message */ |
92 strcpy(buffer, a->message); | 849 strcpy(buffer, a->message); |
93 gtk_text_insert(GTK_TEXT(pd->away_text), NULL, NULL, NULL, buffer, -1); | 850 gtk_text_insert(GTK_TEXT(away_text), NULL, NULL, NULL, buffer, -1); |
94 | 851 } |
95 | 852 |
96 } | 853 void away_list_unclicked(GtkWidget *widget, struct away_message *a) |
97 | 854 { |
98 void away_list_unclicked( GtkWidget *widget, struct away_message *a) | 855 if (prefs_away_list == NULL) |
99 { | 856 return; |
100 if (pd == NULL) | 857 strcpy(a->message, edited_message); |
101 return; | |
102 strcpy(a->message, pd->edited_message); | |
103 save_prefs(); | 858 save_prefs(); |
104 } | 859 } |
105 | 860 |
106 void set_option(GtkWidget *w, int *option) | 861 void remove_away_message(GtkWidget *widget, void *dummy) |
107 { | 862 { |
108 *option = !(*option); | 863 GList *i; |
109 } | 864 struct away_message *a; |
110 | 865 |
111 void set_display_option(GtkWidget *w, int *option) | 866 i = GTK_LIST(prefs_away_list)->selection; |
112 { | 867 |
113 display_options = display_options ^ (int)option; | 868 a = gtk_object_get_user_data(GTK_OBJECT(i->data)); |
114 | 869 |
115 if (blist) update_button_pix(); | 870 rem_away_mess(NULL, a); |
116 | 871 } |
117 #ifdef USE_APPLET | 872 |
118 update_pixmaps(); | 873 static void away_page() |
119 #endif | 874 { |
120 | 875 GtkWidget *parent; |
121 save_prefs(); | 876 GtkWidget *box; |
122 } | 877 GtkWidget *top; |
123 | 878 GtkWidget *bot; |
124 void set_sound_option(GtkWidget *w, int *option) | 879 GtkWidget *sw; |
125 { | 880 GtkWidget *sw2; |
126 sound_options = sound_options ^ (int)option; | 881 GtkWidget *button; |
127 save_prefs(); | 882 GtkWidget *label; |
128 } | 883 GtkWidget *list_item; |
129 | 884 GList *awy = away_messages; |
130 void set_font_option(GtkWidget *w, int *option) | |
131 { | |
132 font_options = font_options ^ (int)option; | |
133 | |
134 update_font_buttons(); | |
135 | |
136 save_prefs(); | |
137 } | |
138 | |
139 void set_general_option(GtkWidget *w, int *option) | |
140 { | |
141 general_options = general_options ^ (int)option; | |
142 | |
143 if ((int)option == OPT_GEN_SHOW_LAGMETER) | |
144 update_lagometer(-1); | |
145 if ((int)option == OPT_GEN_LOG_ALL) | |
146 update_log_convs(); | |
147 save_prefs(); | |
148 | |
149 /* | |
150 if (data == &show_grp_nums) | |
151 update_num_groups(); | |
152 if (data == &showidle || data == &showpix) | |
153 update_show_idlepix(); | |
154 if (data == &button_pix && blist) | |
155 update_button_pix(); | |
156 if (data == &transparent) | |
157 update_transparency(); | |
158 */ | |
159 | |
160 } | |
161 | |
162 | |
163 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy) | |
164 { | |
165 if (debugbutton) | |
166 gtk_button_clicked(GTK_BUTTON(debugbutton)); | |
167 if (general_options & OPT_GEN_DEBUG) | |
168 { | |
169 general_options = general_options ^ (int)OPT_GEN_DEBUG; | |
170 save_prefs(); | |
171 } | |
172 g_free(dw); | |
173 dw=NULL; | |
174 return FALSE; | |
175 | |
176 } | |
177 | |
178 static gint handle_delete(GtkWidget *w, GdkEvent *event, void *dummy) | |
179 { | |
180 guint text_len; | |
181 struct away_message *a; | 885 struct away_message *a; |
182 | 886 char buffer[BUF_LONG]; |
183 | 887 |
184 if (pd->cur_message) { | 888 parent = prefdialog->parent; |
185 | 889 gtk_widget_destroy(prefdialog); |
186 a = pd->cur_message; | 890 debugbutton = NULL; |
187 | 891 prefs_away_list = NULL; |
188 | 892 |
189 /* Get proper Length and grab data */ | 893 prefdialog = gtk_frame_new(_("Away Messages")); |
190 text_len = gtk_text_get_length(GTK_TEXT(pd->away_text)); | 894 gtk_container_add(GTK_CONTAINER(parent), prefdialog); |
191 pd->edited_message = gtk_editable_get_chars(GTK_EDITABLE(pd->away_text), 0, text_len); | 895 |
192 | 896 box = gtk_vbox_new(FALSE, 5); |
193 /* Store the data for later use */ | 897 gtk_container_add(GTK_CONTAINER(prefdialog), box); |
194 strcpy(a->message, pd->edited_message); | 898 gtk_widget_show(box); |
195 | 899 |
196 } | 900 top = gtk_hbox_new(FALSE, 0); |
197 | 901 gtk_box_pack_start(GTK_BOX(box), top, TRUE, TRUE, 0); |
198 save_prefs(); | 902 gtk_widget_show(top); |
199 | 903 |
200 if (event == NULL) | 904 sw = gtk_scrolled_window_new(NULL, NULL); |
201 { | 905 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), |
202 gtk_widget_destroy(pd->window); | 906 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); |
203 debugbutton=NULL; | 907 gtk_box_pack_start(GTK_BOX(top), sw, TRUE, TRUE, 0); |
204 } | 908 gtk_widget_show(sw); |
205 g_free(pd); | 909 |
206 pd = NULL; | 910 prefs_away_list = gtk_list_new(); |
207 | 911 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), prefs_away_list); |
208 | 912 gtk_widget_show(prefs_away_list); |
209 return FALSE; | |
210 } | |
211 | |
212 static int | |
213 manualentry_key_pressed(GtkWidget *w, GdkEvent *event, void *dummy) | |
214 { | |
215 g_snprintf(web_command, sizeof(web_command), "%s", gtk_entry_get_text(GTK_ENTRY(pd->browser_entry))); | |
216 save_prefs(); | |
217 return TRUE; | |
218 } | |
219 | |
220 static int | |
221 connection_key_pressed(GtkWidget *w, GdkEvent *event, void *dummy) | |
222 { | |
223 g_snprintf(aim_host, sizeof(aim_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->aim_host_entry))); | |
224 sscanf(gtk_entry_get_text(GTK_ENTRY(pd->aim_port_entry)), "%d", &aim_port); | |
225 if (proxy_type != PROXY_NONE) { | |
226 g_snprintf(proxy_host, sizeof(proxy_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->proxy_host_entry))); | |
227 sscanf(gtk_entry_get_text(GTK_ENTRY(pd->proxy_port_entry)), "%d", &proxy_port); | |
228 } | |
229 | |
230 g_snprintf(login_host, sizeof(login_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->login_host_entry))); | |
231 sscanf(gtk_entry_get_text(GTK_ENTRY(pd->login_port_entry)), "%d", &login_port); | |
232 save_prefs(); | |
233 return TRUE; | |
234 } | |
235 | |
236 | |
237 | |
238 | |
239 static void set_browser(GtkWidget *w, int *data) | |
240 { | |
241 web_browser = (int)data; | |
242 if (web_browser != BROWSER_MANUAL) { | |
243 if (pd->browser_entry) | |
244 gtk_widget_set_sensitive(pd->browser_entry, FALSE); | |
245 } else { | |
246 if (pd->browser_entry) | |
247 gtk_widget_set_sensitive(pd->browser_entry, TRUE); | |
248 } | |
249 | |
250 if (web_browser != BROWSER_NETSCAPE) { | |
251 if (pd->nwbutton) | |
252 gtk_widget_set_sensitive(pd->nwbutton, FALSE); | |
253 } else { | |
254 if (pd->nwbutton) | |
255 gtk_widget_set_sensitive(pd->nwbutton, TRUE); | |
256 } | |
257 | |
258 | |
259 save_prefs(); | |
260 } | |
261 | |
262 static void set_connect(GtkWidget *w, int *data) | |
263 { | |
264 proxy_type = (int)data; | |
265 if (proxy_type != PROXY_NONE) { | |
266 if (pd->proxy_host_entry) | |
267 gtk_widget_set_sensitive(pd->proxy_host_entry, TRUE); | |
268 if (pd->proxy_port_entry) | |
269 gtk_widget_set_sensitive(pd->proxy_port_entry, TRUE); | |
270 } else { | |
271 if (pd->proxy_host_entry) | |
272 gtk_widget_set_sensitive(pd->proxy_host_entry, FALSE); | |
273 if (pd->proxy_port_entry) | |
274 gtk_widget_set_sensitive(pd->proxy_port_entry, FALSE); | |
275 } | |
276 | |
277 save_prefs(); | |
278 } | |
279 | |
280 static void set_idle(GtkWidget *w, int *data) | |
281 { | |
282 report_idle = (int)data; | |
283 save_prefs(); | |
284 } | |
285 | |
286 | |
287 GtkWidget *gaim_button(const char *text, int *options, int option, GtkWidget *page) | |
288 { | |
289 GtkWidget *button; | |
290 button = gtk_check_button_new_with_label(text); | |
291 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option)); | |
292 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); | |
293 | |
294 if (options == &font_options) | |
295 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_font_option), (int *)option); | |
296 | |
297 if (options == &sound_options) | |
298 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_sound_option), (int *)option); | |
299 if (options == &display_options) | |
300 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_display_option), (int *)option); | |
301 | |
302 if (options == &general_options) | |
303 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_general_option), (int *)option); | |
304 gtk_widget_show(button); | |
305 | |
306 return button; | |
307 } | |
308 | |
309 | |
310 void build_prefs() | |
311 { | |
312 GtkWidget *bbox; | |
313 GtkWidget *vbox; | |
314 GtkWidget *idlebox; | |
315 GtkWidget *idleframe; | |
316 GtkWidget *genbox; | |
317 GtkWidget *fontbox; | |
318 GtkWidget *fontframe; | |
319 GtkWidget *appbox; | |
320 GtkWidget *away_topbox; | |
321 GtkWidget *away_botbox; | |
322 GtkWidget *add_away; | |
323 GtkWidget *remove_away; | |
324 GtkWidget *close; | |
325 GtkWidget *notebook; | |
326 GtkWidget *sound_page; | |
327 /* GtkWidget *debug_page; */ | |
328 GtkWidget *general_page; | |
329 GtkWidget *appearance_page; | |
330 GtkWidget *chat_page; | |
331 GtkWidget *browser_page; | |
332 GtkWidget *connection_page; | |
333 GtkWidget *connectopt; | |
334 GtkWidget *hbox; | |
335 GtkWidget *hbox2; | |
336 #ifdef USE_APPLET | |
337 GtkWidget *applet_page; | |
338 GtkWidget *appletbox; | |
339 #endif | |
340 GtkWidget *label; | |
341 GtkWidget *browseropt; | |
342 GtkWidget *idleopt; | |
343 | |
344 GList *awy = away_messages; | |
345 struct away_message *a; | |
346 GtkWidget *sw; | |
347 GtkWidget *sw2; | |
348 GtkWidget *away_page; | |
349 GtkWidget *select_font; | |
350 GtkWidget *font_face_for_text; | |
351 GtkWidget *list_item; | |
352 gchar buffer[64]; | |
353 | |
354 if (!pd) | |
355 pd = g_new0(struct prefs_data, 1); | |
356 | |
357 pd->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
358 gtk_widget_realize(pd->window); | |
359 aol_icon(pd->window->window); | |
360 gtk_container_border_width(GTK_CONTAINER(pd->window), 10); | |
361 gtk_window_set_title(GTK_WINDOW(pd->window), _("Gaim - Preferences")); | |
362 | |
363 vbox = gtk_vbox_new(FALSE, 5); | |
364 gtk_container_add(GTK_CONTAINER(pd->window), vbox); | |
365 | |
366 /* Notebooks */ | |
367 notebook = gtk_notebook_new(); | |
368 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 5); | |
369 | |
370 | |
371 /* General page */ | |
372 general_page = gtk_hbox_new(FALSE, 0); | |
373 label = gtk_label_new(_("General")); | |
374 gtk_widget_show(label); | |
375 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), general_page, label); | |
376 | |
377 genbox = gtk_vbox_new(FALSE, 5); | |
378 idleframe = gtk_frame_new(_("Idle")); | |
379 idlebox = gtk_vbox_new(FALSE, 5); | |
380 | |
381 gtk_box_pack_start(GTK_BOX(general_page), genbox, TRUE, TRUE, 5); | |
382 gtk_box_pack_start(GTK_BOX(general_page), idleframe, TRUE, TRUE, 5); | |
383 gtk_container_add(GTK_CONTAINER(idleframe), idlebox); | |
384 | |
385 | |
386 gaim_button(_("Enter sends message"), &general_options, OPT_GEN_ENTER_SENDS, genbox); | |
387 gaim_button(_("Control characters for HTML (e.g. Ctrl-I for italics)"), &general_options, OPT_GEN_CTL_CHARS, genbox); | |
388 gaim_button(_("Auto-login"), &general_options, OPT_GEN_AUTO_LOGIN, genbox); | |
389 gaim_button(_("Log All Conversations"), &general_options, OPT_GEN_LOG_ALL, genbox); | |
390 gaim_button(_("Strip HTML from log files"), &general_options, OPT_GEN_STRIP_HTML, genbox); | |
391 gaim_button(_("Raise windows when message recieved"), &general_options, OPT_GEN_POPUP_WINDOWS, genbox); | |
392 gaim_button(_("Raise chat windows when people speak"), &general_options, OPT_GEN_POPUP_CHAT, genbox); | |
393 gaim_button(_("Show URLs as links"), &general_options, OPT_GEN_SEND_LINKS, genbox); | |
394 gaim_button(_("Show Lag-O-Meter"), &general_options, OPT_GEN_SHOW_LAGMETER, genbox); | |
395 gaim_button(_("Save some window size/positions"), &general_options, OPT_GEN_SAVED_WINDOWS, genbox); | |
396 gaim_button(_("Ignore new conversations when away"), &general_options, OPT_GEN_DISCARD_WHEN_AWAY, genbox); | |
397 gaim_button(_("Automagically highlight misspelled words"), &general_options, OPT_GEN_CHECK_SPELLING, genbox); | |
398 gaim_button(_("Sending messages removes away status"), &general_options, OPT_GEN_BACK_ON_IM, genbox); | |
399 if (!dw && (general_options & OPT_GEN_DEBUG)) | |
400 general_options = general_options ^ OPT_GEN_DEBUG; | |
401 debugbutton = gaim_button(_("Enable debug mode"), &general_options, OPT_GEN_DEBUG, genbox); | |
402 | |
403 | |
404 idleopt = gtk_radio_button_new_with_label(NULL, _("No Idle")); | |
405 gtk_box_pack_start(GTK_BOX(idlebox), idleopt, FALSE, FALSE, 0); | |
406 gtk_signal_connect(GTK_OBJECT(idleopt), "clicked", GTK_SIGNAL_FUNC(set_idle), (void *)IDLE_NONE); | |
407 gtk_widget_show(idleopt); | |
408 if (report_idle == IDLE_NONE) | |
409 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(idleopt), TRUE); | |
410 | |
411 idleopt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(idleopt)), _("GAIM Use")); | |
412 gtk_box_pack_start(GTK_BOX(idlebox), idleopt, FALSE, FALSE, 0); | |
413 gtk_signal_connect(GTK_OBJECT(idleopt), "clicked", GTK_SIGNAL_FUNC(set_idle), (void *)IDLE_GAIM); | |
414 gtk_widget_show(idleopt); | |
415 if (report_idle == IDLE_GAIM) | |
416 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(idleopt), TRUE); | |
417 | |
418 /* idleopt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(idleopt)), "X Use"); | |
419 gtk_box_pack_start(GTK_BOX(idlebox), idleopt, FALSE, FALSE, 0); | |
420 gtk_signal_connect(GTK_OBJECT(idleopt), "clicked", GTK_SIGNAL_FUNC(set_idle), (void *)IDLE_SYSTEM); | |
421 gtk_widget_show(idleopt); | |
422 if (report_idle == IDLE_SYSTEM) | |
423 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(idleopt), TRUE); | |
424 */ | |
425 | |
426 gtk_widget_show(general_page); | |
427 gtk_widget_show(genbox); | |
428 gtk_widget_show(idlebox); | |
429 gtk_widget_show(idleframe); | |
430 | |
431 | |
432 gtk_signal_connect_object( GTK_OBJECT(debugbutton), "clicked", GTK_SIGNAL_FUNC(show_debug), NULL); | |
433 | |
434 | |
435 /* Applet */ | |
436 #ifdef USE_APPLET | |
437 | |
438 applet_page = gtk_vbox_new(FALSE, 0); | |
439 label = gtk_label_new(_("Applet")); | |
440 gtk_widget_show(label); | |
441 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), applet_page, label); | |
442 | |
443 appletbox = gtk_vbox_new(FALSE, 5); | |
444 gtk_box_pack_start(GTK_BOX(applet_page), appletbox, TRUE, TRUE, 5); | |
445 | |
446 gaim_button(_("Automatically Show Buddy List"), &general_options, OPT_GEN_APP_BUDDY_SHOW, appletbox); | |
447 gaim_button(_("Buddy list displays near the applet"), &general_options, OPT_GEN_NEAR_APPLET, appletbox); | |
448 | |
449 gtk_widget_show(appletbox); | |
450 gtk_widget_show(applet_page); | |
451 | |
452 #endif | |
453 | |
454 | |
455 /* Connection */ | |
456 | |
457 connection_page = gtk_vbox_new(FALSE, 0); | |
458 label = gtk_label_new(_("Connection")); | |
459 gtk_widget_show(label); | |
460 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), connection_page, label); | |
461 | |
462 gaim_button(_("Use Oscar Protocol (experimental; only takes effect before signon)"), &general_options, OPT_GEN_USE_OSCAR, connection_page); | |
463 label = gtk_label_new(_("The following options do not apply if you use Oscar.")); | |
464 gtk_box_pack_start(GTK_BOX(connection_page), label, FALSE, FALSE, 10); | |
465 gtk_widget_show(label); | |
466 hbox = gtk_hbox_new(FALSE, 0); | |
467 label = gtk_label_new(_("TOC Host:")); | |
468 gtk_widget_show(label); | |
469 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
470 pd->aim_host_entry = gtk_entry_new(); | |
471 gtk_widget_show(pd->aim_host_entry); | |
472 gtk_box_pack_start(GTK_BOX(hbox), pd->aim_host_entry, FALSE, FALSE, 0); | |
473 | |
474 label = gtk_label_new(_("Port:")); | |
475 gtk_widget_show(label); | |
476 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
477 pd->aim_port_entry = gtk_entry_new(); | |
478 gtk_widget_show(pd->aim_port_entry); | |
479 gtk_box_pack_start(GTK_BOX(hbox), pd->aim_port_entry, FALSE, FALSE, 0); | |
480 gtk_widget_show(hbox); | |
481 | |
482 gtk_box_pack_start(GTK_BOX(connection_page), hbox, FALSE, FALSE, 0); | |
483 gtk_entry_set_text(GTK_ENTRY(pd->aim_host_entry), aim_host); | |
484 | |
485 g_snprintf(buffer, sizeof(buffer), "%d", aim_port); | |
486 gtk_entry_set_text(GTK_ENTRY(pd->aim_port_entry), buffer); | |
487 | |
488 hbox2 = gtk_hbox_new(FALSE, 0); | |
489 label = gtk_label_new(_("Login Host:")); | |
490 gtk_widget_show(label); | |
491 gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 5); | |
492 pd->login_host_entry = gtk_entry_new(); | |
493 gtk_widget_show(pd->login_host_entry); | |
494 gtk_box_pack_start(GTK_BOX(hbox2), pd->login_host_entry, FALSE, FALSE, 0); | |
495 | |
496 label = gtk_label_new(_("Port:")); | |
497 gtk_widget_show(label); | |
498 gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 5); | |
499 pd->login_port_entry = gtk_entry_new(); | |
500 gtk_widget_show(pd->login_port_entry); | |
501 gtk_box_pack_start(GTK_BOX(hbox2), pd->login_port_entry, FALSE, FALSE, 0); | |
502 gtk_widget_show(hbox2); | |
503 | |
504 gtk_box_pack_start(GTK_BOX(connection_page), hbox2, FALSE, FALSE, 0); | |
505 gtk_entry_set_text(GTK_ENTRY(pd->login_host_entry), login_host); | |
506 | |
507 g_snprintf(buffer, sizeof(buffer), "%d", login_port); | |
508 gtk_entry_set_text(GTK_ENTRY(pd->login_port_entry), buffer); | |
509 | |
510 connectopt = gtk_radio_button_new_with_label(NULL, _("No Proxy")); | |
511 gtk_box_pack_start(GTK_BOX(connection_page), connectopt, FALSE, FALSE, 0); | |
512 gtk_signal_connect(GTK_OBJECT(connectopt), "clicked", GTK_SIGNAL_FUNC(set_connect), (void *)PROXY_NONE); | |
513 gtk_widget_show(connectopt); | |
514 if (proxy_type == PROXY_NONE) | |
515 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(connectopt), TRUE); | |
516 | |
517 connectopt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(connectopt)), _("HTTP Proxy")); | |
518 gtk_box_pack_start(GTK_BOX(connection_page), connectopt, FALSE, FALSE, 0); | |
519 gtk_signal_connect(GTK_OBJECT(connectopt), "clicked", GTK_SIGNAL_FUNC(set_connect), (void *)PROXY_HTTP); | |
520 gtk_widget_show(connectopt); | |
521 if (proxy_type == PROXY_HTTP) | |
522 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(connectopt), TRUE); | |
523 | |
524 | |
525 connectopt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(connectopt)), _("SOCKS v4 Proxy")); | |
526 gtk_box_pack_start(GTK_BOX(connection_page), connectopt, FALSE, FALSE, 0); | |
527 gtk_signal_connect(GTK_OBJECT(connectopt), "clicked", GTK_SIGNAL_FUNC(set_connect), (void *)PROXY_SOCKS4); | |
528 gtk_widget_show(connectopt); | |
529 if (proxy_type == PROXY_SOCKS4) | |
530 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(connectopt), TRUE); | |
531 | |
532 | |
533 connectopt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(connectopt)), _("SOCKS v5 Proxy (DOES NOT WORK!)")); | |
534 gtk_box_pack_start(GTK_BOX(connection_page), connectopt, FALSE, FALSE, 0); | |
535 gtk_signal_connect(GTK_OBJECT(connectopt), "clicked", GTK_SIGNAL_FUNC(set_connect), (void *)PROXY_SOCKS5); | |
536 gtk_widget_show(connectopt); | |
537 if (proxy_type == PROXY_SOCKS5) | |
538 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(connectopt), TRUE); | |
539 | |
540 | |
541 hbox = gtk_hbox_new(FALSE, 0); | |
542 label = gtk_label_new(_("Proxy Host:")); | |
543 gtk_widget_show(label); | |
544 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
545 pd->proxy_host_entry = gtk_entry_new(); | |
546 gtk_widget_show(pd->proxy_host_entry); | |
547 gtk_box_pack_start(GTK_BOX(hbox), pd->proxy_host_entry, FALSE, FALSE, 0); | |
548 | |
549 label = gtk_label_new(_("Port:")); | |
550 gtk_widget_show(label); | |
551 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
552 pd->proxy_port_entry = gtk_entry_new(); | |
553 gtk_widget_show(pd->proxy_port_entry); | |
554 gtk_box_pack_start(GTK_BOX(hbox), pd->proxy_port_entry, FALSE, FALSE, 0); | |
555 gtk_widget_show(hbox); | |
556 | |
557 gtk_box_pack_start(GTK_BOX(connection_page), hbox, FALSE, FALSE, 0); | |
558 gtk_entry_set_text(GTK_ENTRY(pd->proxy_host_entry), proxy_host); | |
559 | |
560 g_snprintf(buffer, sizeof(buffer), "%d", proxy_port); | |
561 gtk_entry_set_text(GTK_ENTRY(pd->proxy_port_entry), buffer); | |
562 | |
563 | |
564 gtk_widget_show(connection_page); | |
565 | |
566 | |
567 if (proxy_type != PROXY_NONE) { | |
568 if (pd->proxy_host_entry) | |
569 gtk_widget_set_sensitive(pd->proxy_host_entry, TRUE); | |
570 if (pd->proxy_port_entry) | |
571 gtk_widget_set_sensitive(pd->proxy_port_entry, TRUE); | |
572 } else { | |
573 if (pd->proxy_host_entry) | |
574 gtk_widget_set_sensitive(pd->proxy_host_entry, FALSE); | |
575 if (pd->proxy_port_entry) | |
576 gtk_widget_set_sensitive(pd->proxy_port_entry, FALSE); | |
577 } | |
578 | |
579 | |
580 | |
581 gtk_signal_connect(GTK_OBJECT(pd->aim_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
582 gtk_signal_connect(GTK_OBJECT(pd->aim_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
583 gtk_signal_connect(GTK_OBJECT(pd->login_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
584 gtk_signal_connect(GTK_OBJECT(pd->login_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
585 gtk_signal_connect(GTK_OBJECT(pd->proxy_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
586 gtk_signal_connect(GTK_OBJECT(pd->proxy_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
587 | |
588 | |
589 /* Away */ | |
590 | |
591 a = awaymessage; | |
592 pd->cur_message = NULL; | |
593 pd->nwbutton = NULL; | |
594 pd->browser_entry = NULL; | |
595 | |
596 away_page = gtk_vbox_new(FALSE, 0); | |
597 away_topbox = gtk_hbox_new(FALSE, 0); | |
598 away_botbox = gtk_hbox_new(FALSE, 0); | |
599 | |
600 label = gtk_label_new(_("Away")); | |
601 gtk_widget_show(label); | |
602 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), away_page, label); | |
603 gtk_widget_show(away_page); | |
604 | 913 |
605 sw2 = gtk_scrolled_window_new(NULL, NULL); | 914 sw2 = gtk_scrolled_window_new(NULL, NULL); |
606 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), | 915 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), |
607 GTK_POLICY_AUTOMATIC, | 916 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); |
608 GTK_POLICY_AUTOMATIC); | 917 gtk_box_pack_start(GTK_BOX(top), sw2, TRUE, TRUE, 0); |
609 gtk_widget_show(sw2); | 918 gtk_widget_show(sw2); |
610 | 919 |
611 pd->away_list = gtk_list_new(); | 920 away_text = gtk_text_new(NULL, NULL); |
612 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), pd->away_list); | 921 gtk_container_add(GTK_CONTAINER(sw2), away_text); |
613 gtk_box_pack_start(GTK_BOX(away_topbox), sw2, TRUE, TRUE, 0); | 922 gtk_text_set_word_wrap(GTK_TEXT(away_text), TRUE); |
614 | 923 gtk_text_set_editable(GTK_TEXT(away_text), TRUE); |
615 sw = gtk_scrolled_window_new(NULL, NULL); | 924 gtk_widget_show(away_text); |
616 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | 925 |
617 GTK_POLICY_AUTOMATIC, | 926 bot = gtk_hbox_new(FALSE, 0); |
618 GTK_POLICY_AUTOMATIC); | 927 gtk_box_pack_start(GTK_BOX(box), bot, FALSE, FALSE, 0); |
619 gtk_widget_show(sw); | 928 gtk_widget_show(bot); |
620 | 929 |
621 pd->away_text = gtk_text_new(NULL, NULL); | 930 button = picture_button(prefs, _("Add"), gnome_add_xpm); |
622 gtk_container_add(GTK_CONTAINER(sw), pd->away_text); | 931 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), NULL); |
623 gtk_box_pack_start(GTK_BOX(away_topbox), sw, TRUE, TRUE, 0); | 932 gtk_box_pack_start(GTK_BOX(bot), button, TRUE, FALSE, 5); |
624 gtk_text_set_word_wrap(GTK_TEXT(pd->away_text), TRUE); | 933 |
625 gtk_text_set_editable(GTK_TEXT(pd->away_text), TRUE ); | 934 button = picture_button(prefs, _("Remove"), gnome_remove_xpm); |
626 | 935 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(remove_away_message), NULL); |
627 add_away = picture_button(pd->window, _("Add Message"), gnome_add_xpm); | 936 gtk_box_pack_start(GTK_BOX(bot), button, TRUE, FALSE, 5); |
628 gtk_signal_connect(GTK_OBJECT(add_away), "clicked", GTK_SIGNAL_FUNC(create_away_mess), NULL); | 937 |
629 gtk_box_pack_start(GTK_BOX(away_botbox), add_away, TRUE, FALSE, 5); | |
630 | |
631 remove_away = picture_button(pd->window, _("Remove Message"), gnome_remove_xpm); | |
632 gtk_signal_connect(GTK_OBJECT(remove_away), "clicked", GTK_SIGNAL_FUNC(remove_away_message), NULL); | |
633 gtk_box_pack_start(GTK_BOX(away_botbox), remove_away, TRUE, FALSE, 5); | |
634 | |
635 if (display_options & OPT_DISP_COOL_LOOK) | |
636 { | |
637 gtk_button_set_relief(GTK_BUTTON(remove_away), GTK_RELIEF_NONE); | |
638 gtk_button_set_relief(GTK_BUTTON(add_away), GTK_RELIEF_NONE); | |
639 } | |
640 | |
641 gtk_box_pack_start(GTK_BOX(away_page), away_topbox, TRUE, TRUE, 0); | |
642 gtk_box_pack_start(GTK_BOX(away_page), away_botbox, FALSE, FALSE, 0); | |
643 | |
644 gtk_widget_show(add_away); | |
645 gtk_widget_show(remove_away); | |
646 gtk_widget_show(pd->away_list); | |
647 gtk_widget_show(pd->away_text); | |
648 gtk_widget_show(away_topbox); | |
649 gtk_widget_show(away_botbox); | |
650 | |
651 if (awy != NULL) { | 938 if (awy != NULL) { |
652 a = (struct away_message *)awy->data; | 939 a = (struct away_message *)awy->data; |
653 g_snprintf(buffer, sizeof(buffer), "%s", a->message); | 940 g_snprintf(buffer, sizeof(buffer), "%s", a->message); |
654 gtk_text_insert(GTK_TEXT(pd->away_text), NULL, NULL, NULL, buffer, -1); | 941 gtk_text_insert(GTK_TEXT(away_text), NULL, NULL, NULL, buffer, -1); |
655 } | 942 } |
656 | 943 |
657 while(awy) { | 944 while (awy) { |
658 a = (struct away_message *)awy->data; | 945 a = (struct away_message *)awy->data; |
659 label = gtk_label_new(a->name); | 946 label = gtk_label_new(a->name); |
660 list_item = gtk_list_item_new(); | 947 list_item = gtk_list_item_new(); |
661 gtk_container_add(GTK_CONTAINER(list_item), label); | 948 gtk_container_add(GTK_CONTAINER(list_item), label); |
662 gtk_signal_connect(GTK_OBJECT(list_item), "select", GTK_SIGNAL_FUNC(away_list_clicked), a); | 949 gtk_signal_connect(GTK_OBJECT(list_item), "select", GTK_SIGNAL_FUNC(away_list_clicked), a); |
663 gtk_signal_connect(GTK_OBJECT(list_item), "deselect", GTK_SIGNAL_FUNC(away_list_unclicked), a); | 950 gtk_signal_connect(GTK_OBJECT(list_item), "deselect", GTK_SIGNAL_FUNC(away_list_unclicked), a); |
664 gtk_object_set_user_data(GTK_OBJECT(list_item), a); | 951 gtk_object_set_user_data(GTK_OBJECT(list_item), a); |
665 | 952 |
666 gtk_widget_show(label); | 953 gtk_widget_show(label); |
667 gtk_container_add(GTK_CONTAINER(pd->away_list), list_item); | 954 gtk_container_add(GTK_CONTAINER(prefs_away_list), list_item); |
668 gtk_widget_show(list_item); | 955 gtk_widget_show(list_item); |
956 | |
957 awy = awy->next; | |
958 } | |
959 | |
960 gtk_widget_show(prefdialog); | |
961 } | |
962 | |
963 static GtkWidget *browser_entry = NULL; | |
964 static GtkWidget *new_window = NULL; | |
965 | |
966 static void set_browser(GtkWidget *w, int *data) | |
967 { | |
968 web_browser = (int)data; | |
969 if (web_browser != BROWSER_MANUAL) { | |
970 if (browser_entry) | |
971 gtk_widget_set_sensitive(browser_entry, FALSE); | |
972 } else { | |
973 if (browser_entry) | |
974 gtk_widget_set_sensitive(browser_entry, TRUE); | |
975 } | |
976 | |
977 if (web_browser != BROWSER_NETSCAPE) { | |
978 if (new_window) | |
979 gtk_widget_set_sensitive(new_window, FALSE); | |
980 } else { | |
981 if (new_window) | |
982 gtk_widget_set_sensitive(new_window, TRUE); | |
983 } | |
984 | |
985 | |
986 save_prefs(); | |
987 } | |
988 | |
989 static int manualentry_key_pressed(GtkWidget *w, GdkEvent *event, void *dummy) | |
990 { | |
991 g_snprintf(web_command, sizeof(web_command), "%s", gtk_entry_get_text(GTK_ENTRY(browser_entry))); | |
992 save_prefs(); | |
993 return TRUE; | |
994 } | |
995 | |
996 static GtkWidget *browser_radio(char *label, int which, GtkWidget *box, GtkWidget *set) | |
997 { | |
998 GtkWidget *opt; | |
999 | |
1000 if (!set) | |
1001 opt = gtk_radio_button_new_with_label(NULL, label); | |
1002 else | |
1003 opt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(set)), label); | |
1004 gtk_box_pack_start(GTK_BOX(box), opt, FALSE, FALSE, 0); | |
1005 gtk_signal_connect(GTK_OBJECT(opt), "clicked", GTK_SIGNAL_FUNC(set_browser), (void *)which); | |
1006 gtk_widget_show(opt); | |
1007 if (web_browser == which) | |
1008 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); | |
1009 | |
1010 return opt; | |
1011 } | |
1012 | |
1013 static void browser_page() | |
1014 { | |
1015 GtkWidget *parent; | |
1016 GtkWidget *box; | |
1017 GtkWidget *label; | |
1018 GtkWidget *opt; | |
1019 | |
1020 parent = prefdialog->parent; | |
1021 gtk_widget_destroy(prefdialog); | |
1022 debugbutton = NULL; | |
1023 prefs_away_list = NULL; | |
1024 | |
1025 prefdialog = gtk_frame_new(_("Browser Options")); | |
1026 gtk_container_add(GTK_CONTAINER(parent), prefdialog); | |
1027 | |
1028 box = gtk_vbox_new(FALSE, 5); | |
1029 gtk_container_add(GTK_CONTAINER(prefdialog), box); | |
1030 gtk_widget_show(box); | |
1031 | |
1032 label = gtk_label_new(_("All options take effect immediately unless otherwise noted.")); | |
1033 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); | |
1034 gtk_widget_show(label); | |
1035 | |
1036 opt = browser_radio(_("Netscape"), BROWSER_NETSCAPE, box, NULL); | |
1037 opt = browser_radio(_("KFM"), BROWSER_KFM, box, opt); | |
1038 opt = browser_radio(_("Internal HTML Widget (Quite likely a bad idea!)"), BROWSER_INTERNAL, box, opt); | |
1039 opt = browser_radio(_("Manual"), BROWSER_MANUAL, box, opt); | |
1040 | |
1041 browser_entry = gtk_entry_new(); | |
1042 gtk_box_pack_start(GTK_BOX(box), browser_entry, FALSE, FALSE, 0); | |
1043 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command); | |
1044 gtk_signal_connect(GTK_OBJECT(browser_entry), "focus_out_event", GTK_SIGNAL_FUNC(manualentry_key_pressed), NULL); | |
1045 gtk_widget_show(browser_entry); | |
1046 | |
1047 new_window = gaim_button(_("Pop up new window by default"), &general_options, OPT_GEN_BROWSER_POPUP, box); | |
1048 | |
1049 if (web_browser != BROWSER_MANUAL) { | |
1050 gtk_widget_set_sensitive(browser_entry, FALSE); | |
1051 } else { | |
1052 gtk_widget_set_sensitive(browser_entry, TRUE); | |
1053 } | |
1054 | |
1055 if (web_browser != BROWSER_NETSCAPE) { | |
1056 gtk_widget_set_sensitive(new_window, FALSE); | |
1057 } else { | |
1058 gtk_widget_set_sensitive(new_window, TRUE); | |
1059 } | |
1060 | |
1061 gtk_widget_show(prefdialog); | |
1062 } | |
1063 | |
1064 static void try_me(GtkCTree *ctree, GtkCTreeNode *node) | |
1065 { | |
1066 /* this is a hack */ | |
1067 void (*func)(); | |
1068 func = gtk_ctree_node_get_row_data(ctree, node); | |
1069 (*func)(); | |
1070 } | |
1071 | |
1072 void show_prefs() | |
1073 { | |
1074 GtkWidget *vbox; | |
1075 GtkWidget *hpaned; | |
1076 GtkWidget *scroll; | |
1077 GtkWidget *preftree; | |
1078 GtkWidget *container; | |
1079 GtkWidget *hbox; | |
1080 GtkWidget *close; | |
1081 | |
1082 if (prefs) { | |
1083 gtk_widget_show(prefs); | |
1084 return; | |
1085 } | |
1086 | |
1087 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
1088 gtk_widget_realize(prefs); | |
1089 aol_icon(prefs->window); | |
1090 gtk_container_border_width(GTK_CONTAINER(prefs), 10); | |
1091 gtk_window_set_title(GTK_WINDOW(prefs), _("Gaim - Preferences")); | |
1092 gtk_widget_set_usize(prefs, 600, 400); | |
1093 | |
1094 vbox = gtk_vbox_new(FALSE, 5); | |
1095 gtk_container_add(GTK_CONTAINER(prefs), vbox); | |
1096 gtk_widget_show(vbox); | |
1097 | |
1098 hpaned = gtk_hpaned_new(); | |
1099 gtk_box_pack_start(GTK_BOX(vbox), hpaned, TRUE, TRUE, 5); | |
1100 gtk_widget_show(hpaned); | |
669 | 1101 |
670 awy = awy->next; | 1102 scroll = gtk_scrolled_window_new(NULL, NULL); |
671 | 1103 gtk_paned_pack1(GTK_PANED(hpaned), scroll, TRUE, TRUE); |
672 } | 1104 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll), |
673 | 1105 GTK_POLICY_NEVER, GTK_POLICY_NEVER); |
674 /* Sound */ | 1106 gtk_widget_set_usize(scroll, 125, -1); |
675 sound_page = gtk_vbox_new(FALSE, 0); | 1107 gtk_widget_show(scroll); |
676 label = gtk_label_new(_("Sounds")); | 1108 |
677 gtk_widget_show(label); | 1109 preftree = gtk_ctree_new(1, 0); |
678 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), sound_page, label); | 1110 gtk_ctree_set_line_style (GTK_CTREE(preftree), GTK_CTREE_LINES_SOLID); |
679 gaim_button(_("Sounds go through GNOME"), &sound_options, OPT_SOUND_THROUGH_GNOME, sound_page); | 1111 gtk_ctree_set_expander_style(GTK_CTREE(preftree), GTK_CTREE_EXPANDER_TRIANGLE); |
680 gaim_button(_("Sound when buddy logs in"), &sound_options, OPT_SOUND_LOGIN, sound_page); | 1112 gtk_clist_set_reorderable(GTK_CLIST(preftree), FALSE); |
681 gaim_button(_("Sound when buddy logs out"), &sound_options, OPT_SOUND_LOGOUT, sound_page); | 1113 gtk_container_add(GTK_CONTAINER(scroll), preftree); |
682 gaim_button(_("Sound when message is received"), &sound_options, OPT_SOUND_RECV, sound_page); | 1114 gtk_signal_connect(GTK_OBJECT(preftree), "tree_select_row", GTK_SIGNAL_FUNC(try_me), NULL); |
683 gaim_button(_("Sound when message is sent"), &sound_options, OPT_SOUND_SEND, sound_page); | 1115 gtk_widget_show(preftree); |
684 gaim_button(_("Sound when first message is received"), &sound_options, OPT_SOUND_FIRST_RCV, sound_page); | 1116 |
685 gaim_button(_("Sound when message is received if away"), &sound_options, OPT_SOUND_WHEN_AWAY, sound_page); | 1117 prefs_build_general(preftree); |
686 gaim_button(_("No sound for buddies signed on when you log in"), &sound_options, OPT_SOUND_SILENT_SIGNON, sound_page); | 1118 prefs_build_connect(preftree); |
687 gaim_button(_("Sounds in chat rooms when people enter/leave"), &sound_options, OPT_SOUND_CHAT_JOIN, sound_page); | 1119 prefs_build_buddy(preftree); |
688 gaim_button(_("Sounds in chat rooms when people talk"), &sound_options, OPT_SOUND_CHAT_SAY, sound_page); | 1120 prefs_build_convo(preftree); |
689 gtk_widget_show(sound_page); | 1121 prefs_build_sound(preftree); |
690 | 1122 prefs_build_away(preftree); |
691 | 1123 prefs_build_browser(preftree); |
692 /* Browser */ | 1124 |
693 browser_page = gtk_vbox_new(FALSE, 0); | 1125 container = gtk_frame_new(NULL); |
694 | 1126 gtk_container_set_border_width(GTK_CONTAINER(container), 0); |
695 label = gtk_label_new(_("Browser")); | 1127 gtk_frame_set_shadow_type(GTK_FRAME(container), GTK_SHADOW_NONE); |
696 gtk_widget_show(label); | 1128 gtk_paned_pack2(GTK_PANED(hpaned), container, TRUE, TRUE); |
697 | 1129 gtk_widget_show(container); |
698 | 1130 |
699 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), browser_page, label); | 1131 prefdialog = gtk_vbox_new(FALSE, 5); |
700 browseropt = gtk_radio_button_new_with_label(NULL, _("Netscape")); | 1132 gtk_container_add(GTK_CONTAINER(container), prefdialog); |
701 gtk_box_pack_start(GTK_BOX(browser_page), browseropt, FALSE, FALSE, 0); | 1133 gtk_widget_show(prefdialog); |
702 gtk_signal_connect(GTK_OBJECT(browseropt), "clicked", GTK_SIGNAL_FUNC(set_browser), (void *)BROWSER_NETSCAPE); | 1134 |
703 gtk_widget_show(browseropt); | 1135 general_page(); |
704 if (web_browser == BROWSER_NETSCAPE) | 1136 |
705 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(browseropt), TRUE); | 1137 hbox = gtk_hbox_new(FALSE, 5); |
706 | 1138 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
707 browseropt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(browseropt)), _("KFM (The KDE browser)")); | 1139 gtk_widget_show(hbox); |
708 gtk_box_pack_start(GTK_BOX(browser_page), browseropt, FALSE, FALSE, 0); | 1140 |
709 gtk_signal_connect(GTK_OBJECT(browseropt), "clicked", GTK_SIGNAL_FUNC(set_browser), (void *)BROWSER_KFM); | 1141 close = picture_button(prefs, _("Close"), cancel_xpm); |
710 gtk_widget_show(browseropt); | 1142 gtk_box_pack_end(GTK_BOX(hbox), close, FALSE, FALSE, 5); |
711 if (web_browser == BROWSER_KFM) | 1143 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(handle_delete), NULL); |
712 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(browseropt), TRUE); | 1144 |
713 | 1145 gtk_widget_show(prefs); |
714 | 1146 } |
715 browseropt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(browseropt)), _("Internal HTML widget (Quite likely a bad idea!)")); | 1147 |
716 gtk_box_pack_start(GTK_BOX(browser_page), browseropt, FALSE, FALSE, 0); | 1148 char debug_buff[BUF_LONG]; |
717 gtk_signal_connect(GTK_OBJECT(browseropt), "clicked", GTK_SIGNAL_FUNC(set_browser), (void *)BROWSER_INTERNAL); | 1149 |
718 gtk_widget_show(browseropt); | 1150 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy) |
719 if (web_browser == BROWSER_INTERNAL) | 1151 { |
720 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(browseropt), TRUE); | 1152 if (debugbutton) |
721 | 1153 gtk_button_clicked(GTK_BUTTON(debugbutton)); |
722 | 1154 if (general_options & OPT_GEN_DEBUG) |
723 browseropt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(browseropt)), _("Manual")); | 1155 { |
724 gtk_box_pack_start(GTK_BOX(browser_page), browseropt, FALSE, FALSE, 0); | 1156 general_options = general_options ^ (int)OPT_GEN_DEBUG; |
725 gtk_signal_connect(GTK_OBJECT(browseropt), "clicked", GTK_SIGNAL_FUNC(set_browser), (void *)BROWSER_MANUAL); | 1157 save_prefs(); |
726 gtk_widget_show(browseropt); | |
727 if (web_browser == BROWSER_MANUAL) | |
728 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(browseropt), TRUE); | |
729 | |
730 | |
731 pd->browser_entry = gtk_entry_new(); | |
732 gtk_widget_show(pd->browser_entry); | |
733 | |
734 gtk_box_pack_start(GTK_BOX(browser_page), pd->browser_entry, FALSE, FALSE, 0); | |
735 gtk_entry_set_text(GTK_ENTRY(pd->browser_entry), web_command); | |
736 | |
737 pd->nwbutton = gaim_button(_("Pop up new window by default"), &general_options, OPT_GEN_BROWSER_POPUP, browser_page); | |
738 gtk_widget_show(browser_page); | |
739 | |
740 gtk_signal_connect(GTK_OBJECT(pd->browser_entry), "focus_out_event", GTK_SIGNAL_FUNC(manualentry_key_pressed), NULL); | |
741 | |
742 | |
743 | |
744 if (web_browser != BROWSER_MANUAL) { | |
745 gtk_widget_set_sensitive(pd->browser_entry, FALSE); | |
746 } else { | |
747 gtk_widget_set_sensitive(pd->browser_entry, TRUE); | |
748 } | 1158 } |
749 | 1159 g_free(dw); |
750 if (web_browser != BROWSER_NETSCAPE) { | 1160 dw=NULL; |
751 gtk_widget_set_sensitive(pd->nwbutton, FALSE); | 1161 return FALSE; |
752 } else { | 1162 |
753 gtk_widget_set_sensitive(pd->nwbutton, TRUE); | 1163 } |
754 } | 1164 |
755 | 1165 static void build_debug() |
756 | |
757 | |
758 | |
759 /* Appearance */ | |
760 appearance_page = gtk_hbox_new(FALSE, 0); | |
761 label = gtk_label_new(_("Appearance")); | |
762 gtk_widget_show(label); | |
763 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), appearance_page, label); | |
764 appbox = gtk_vbox_new(FALSE, 5); | |
765 fontframe = gtk_frame_new(_("Font Properties")); | |
766 fontbox = gtk_vbox_new(FALSE, 5); | |
767 | |
768 gtk_box_pack_start(GTK_BOX(appearance_page), appbox, TRUE, TRUE, 5); | |
769 gtk_box_pack_start(GTK_BOX(appearance_page), fontframe, TRUE, TRUE, 5); | |
770 gtk_container_add(GTK_CONTAINER(fontframe), fontbox); | |
771 | |
772 gaim_button(_("Show time on messages"), &display_options, OPT_DISP_SHOW_TIME, appbox); | |
773 gaim_button(_("Show numbers in groups"), &display_options, OPT_DISP_SHOW_GRPNUM, appbox ); | |
774 gaim_button(_("Show buddy-type pixmaps"), &display_options, OPT_DISP_SHOW_PIXMAPS, appbox ); | |
775 gaim_button(_("Show idle times"), &display_options, OPT_DISP_SHOW_IDLETIME, appbox ); | |
776 gaim_button(_("Show button pixmaps"), &display_options, OPT_DISP_SHOW_BUTTON_XPM, appbox ); | |
777 gaim_button(_("Ignore incoming colours"), &display_options, OPT_DISP_IGNORE_COLOUR, appbox ); | |
778 #if 0 | |
779 gaim_button("Transparent text window (experimental)", &transparent, appbox ); | |
780 #endif | |
781 gaim_button(_("Show logon/logoffs in conversation windows"), &display_options, OPT_DISP_SHOW_LOGON, appbox ); | |
782 gaim_button(_("Show people joining/leaving in chat windows"), &display_options, OPT_DISP_CHAT_LOGON, appbox ); | |
783 gaim_button(_("Use devil icons"), &display_options, OPT_DISP_DEVIL_PIXMAPS, appbox ); | |
784 gaim_button(_("Show graphical smileys (experimental)"), &display_options, OPT_DISP_SHOW_SMILEY, appbox ); | |
785 gaim_button(_("Show Buddy Ticker after restart"), &display_options, OPT_DISP_SHOW_BUDDYTICKER, appbox ); | |
786 gaim_button(_("Use borderless buttons (requires restart for some buttons)"), &display_options, OPT_DISP_COOL_LOOK, appbox); | |
787 | |
788 | |
789 gaim_button(_("Bold Text"), &font_options, OPT_FONT_BOLD, fontbox); | |
790 gaim_button(_("Italics Text"), &font_options, OPT_FONT_ITALIC, fontbox); | |
791 gaim_button(_("Underlined Text"), &font_options, OPT_FONT_UNDERLINE, fontbox); | |
792 gaim_button(_("Strike Text"), &font_options, OPT_FONT_STRIKE, fontbox); | |
793 font_face_for_text = gaim_button(_("Font Face for Text"), &font_options, OPT_FONT_FACE, fontbox); | |
794 | |
795 /* Build font button */ | |
796 select_font = picture_button(pd->window, _("Select Font"), fontface2_xpm); | |
797 gtk_box_pack_start(GTK_BOX(fontbox), select_font, FALSE, FALSE, 0); | |
798 gtk_signal_connect(GTK_OBJECT(select_font), "clicked", GTK_SIGNAL_FUNC(show_font_dialog), NULL); | |
799 if (display_options & OPT_DISP_COOL_LOOK) | |
800 gtk_button_set_relief(GTK_BUTTON(select_font), GTK_RELIEF_NONE); | |
801 if (!(font_options & OPT_FONT_FACE)) | |
802 gtk_widget_set_sensitive(GTK_WIDGET(select_font), FALSE); | |
803 gtk_widget_show(select_font); | |
804 gtk_signal_connect(GTK_OBJECT(font_face_for_text), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select_font); | |
805 | |
806 gtk_widget_show(appearance_page); | |
807 gtk_widget_show(fontbox); | |
808 gtk_widget_show(fontframe); | |
809 gtk_widget_show(appbox); | |
810 | |
811 | |
812 /* Buddy Chats */ | |
813 chat_page = gtk_vbox_new(FALSE, 0); | |
814 label = gtk_label_new(_("Buddy Chats")); | |
815 | |
816 gtk_widget_show(label); | |
817 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), chat_page, label); | |
818 | |
819 do_chat_page(chat_page); | |
820 gtk_widget_show(chat_page); | |
821 | |
822 bbox = gtk_hbox_new(FALSE, 5); | |
823 | |
824 /* Build close button */ | |
825 close = picture_button(pd->window, _("Close"), cancel_xpm); | |
826 gtk_widget_set_usize(close, 75, 30); | |
827 /* End of close button */ | |
828 | |
829 | |
830 if (display_options & OPT_DISP_COOL_LOOK) | |
831 gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE); | |
832 | |
833 /* Pack the button(s) in the button box */ | |
834 gtk_box_pack_end(GTK_BOX(bbox), close, FALSE, FALSE, 5); | |
835 gtk_box_pack_start(GTK_BOX(vbox),bbox, FALSE, FALSE, 5); | |
836 | |
837 gtk_widget_show(notebook); | |
838 gtk_widget_show(close); | |
839 | |
840 gtk_widget_show(bbox); | |
841 gtk_widget_show(vbox); | |
842 | |
843 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(handle_delete), NULL); | |
844 gtk_signal_connect(GTK_OBJECT(pd->window),"delete_event", GTK_SIGNAL_FUNC(handle_delete), NULL); | |
845 | |
846 } | |
847 | |
848 void show_prefs() | |
849 { | |
850 if (!pd || !pd->window) | |
851 build_prefs(); | |
852 gtk_widget_show(pd->window); | |
853 } | |
854 void add_chat(GtkWidget *w, struct chat_page *cp) | |
855 { | |
856 GList *sel = GTK_LIST(cp->list1)->selection; | |
857 struct chat_room *cr, *cr2; | |
858 GList *crs = chat_rooms; | |
859 GtkWidget *item; | |
860 | |
861 if (sel) { | |
862 cr = (struct chat_room *)gtk_object_get_user_data(GTK_OBJECT(sel->data)); | |
863 } else | |
864 return; | |
865 | |
866 while(crs) { | |
867 cr2 = (struct chat_room *)crs->data; | |
868 if (!strcasecmp(cr->name, cr2->name)) | |
869 return; | |
870 crs = crs->next; | |
871 } | |
872 item = gtk_list_item_new_with_label(cr->name); | |
873 cr2 = g_new0(struct chat_room, 1); | |
874 strcpy(cr2->name, cr->name); | |
875 cr2->exchange = cr->exchange; | |
876 gtk_object_set_user_data(GTK_OBJECT(item), cr2); | |
877 gtk_widget_show(item); | |
878 sel = g_list_append(NULL, item); | |
879 gtk_list_append_items(GTK_LIST(cp->list2), sel); | |
880 chat_rooms = g_list_append(chat_rooms, cr2); | |
881 | |
882 setup_buddy_chats(); | |
883 save_prefs(); | |
884 | |
885 | |
886 } | |
887 | |
888 void remove_chat(GtkWidget *w, struct chat_page *cp) | |
889 { | |
890 GList *sel = GTK_LIST(cp->list2)->selection; | |
891 struct chat_room *cr; | |
892 GList *crs; | |
893 GtkWidget *item; | |
894 | |
895 if (sel) { | |
896 item = (GtkWidget *)sel->data; | |
897 cr = (struct chat_room *)gtk_object_get_user_data(GTK_OBJECT(item)); | |
898 } else | |
899 return; | |
900 | |
901 chat_rooms = g_list_remove(chat_rooms, cr); | |
902 | |
903 | |
904 gtk_list_clear_items(GTK_LIST(cp->list2), 0, -1); | |
905 | |
906 if (g_list_length(chat_rooms) == 0) | |
907 chat_rooms = NULL; | |
908 | |
909 crs = chat_rooms; | |
910 | |
911 while(crs) { | |
912 cr = (struct chat_room *)crs->data; | |
913 item = gtk_list_item_new_with_label(cr->name); | |
914 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
915 gtk_widget_show(item); | |
916 gtk_list_append_items(GTK_LIST(cp->list2), g_list_append(NULL, item)); | |
917 | |
918 | |
919 crs = crs->next; | |
920 } | |
921 | |
922 setup_buddy_chats(); | |
923 save_prefs(); | |
924 } | |
925 | |
926 void refresh_list(GtkWidget *w, struct chat_page *cp) | |
927 { | |
928 char *text = grab_url("http://www.aol.com/community/chat/allchats.html"); | |
929 char *c; | |
930 int len = strlen(text); | |
931 GtkWidget *item; | |
932 GList *items = GTK_LIST(cp->list1)->children; | |
933 struct chat_room *cr; | |
934 c = text; | |
935 | |
936 while(items) { | |
937 g_free(gtk_object_get_user_data(GTK_OBJECT(items->data))); | |
938 items = items->next; | |
939 } | |
940 | |
941 items = NULL; | |
942 | |
943 gtk_list_clear_items(GTK_LIST(cp->list1), 0, -1); | |
944 | |
945 item = gtk_list_item_new_with_label(_("Gaim Chat")); | |
946 cr = g_new0(struct chat_room, 1); | |
947 strcpy(cr->name, _("Gaim Chat")); | |
948 cr->exchange = 4; | |
949 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
950 gtk_widget_show(item); | |
951 | |
952 items = g_list_append(NULL, item); | |
953 | |
954 while(c) { | |
955 if (c - text > len - 30) | |
956 break; /* assume no chat rooms 30 from end, padding */ | |
957 if (!strncasecmp(AOL_SRCHSTR, c, strlen(AOL_SRCHSTR))) { | |
958 char *t; | |
959 int len=0; | |
960 int exchange; | |
961 char *name = NULL; | |
962 | |
963 c += strlen(AOL_SRCHSTR); | |
964 t = c; | |
965 while(t) { | |
966 len++; | |
967 name = g_realloc(name, len); | |
968 if (*t == '+') | |
969 name[len - 1] = ' '; | |
970 else if (*t == '&') { | |
971 name[len - 1] = 0; | |
972 sscanf(t, "&Exchange=%d", &exchange); | |
973 c = t + strlen("&Exchange=x"); | |
974 break; | |
975 } else | |
976 name[len - 1] = *t; | |
977 t++; | |
978 } | |
979 cr = g_new0(struct chat_room, 1); | |
980 strcpy(cr->name, name); | |
981 cr->exchange = exchange; | |
982 item = gtk_list_item_new_with_label(name); | |
983 gtk_widget_show(item); | |
984 items = g_list_append(items, item); | |
985 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
986 g_free(name); | |
987 } | |
988 c++; | |
989 } | |
990 gtk_list_append_items(GTK_LIST(cp->list1), items); | |
991 g_free(text); | |
992 } | |
993 | |
994 | |
995 | |
996 void do_chat_page(GtkWidget *page) | |
997 { | |
998 GtkWidget *table; | |
999 GtkWidget *rem_button, *add_button, *ref_button; | |
1000 GtkWidget *list1, *list2; | |
1001 GtkWidget *label; | |
1002 GtkWidget *sw1, *sw2; | |
1003 GtkWidget *item; | |
1004 struct chat_page *cp = g_new0(struct chat_page, 1); | |
1005 GList *crs = chat_rooms; | |
1006 GList *items = NULL; | |
1007 struct chat_room *cr; | |
1008 | |
1009 table = gtk_table_new(4, 2, FALSE); | |
1010 gtk_widget_show(table); | |
1011 | |
1012 gtk_box_pack_start(GTK_BOX(page), table, TRUE, TRUE, 0); | |
1013 | |
1014 list1 = gtk_list_new(); | |
1015 list2 = gtk_list_new(); | |
1016 sw1 = gtk_scrolled_window_new(NULL, NULL); | |
1017 sw2 = gtk_scrolled_window_new(NULL, NULL); | |
1018 | |
1019 ref_button = picture_button(pd->window, _("Refresh"), refresh_xpm); | |
1020 add_button = picture_button(pd->window, _("Add"), gnome_add_xpm); | |
1021 rem_button = picture_button(pd->window, _("Remove"), gnome_remove_xpm); | |
1022 if (display_options & OPT_DISP_COOL_LOOK) | |
1023 { | |
1024 gtk_button_set_relief(GTK_BUTTON(ref_button), GTK_RELIEF_NONE); | |
1025 gtk_button_set_relief(GTK_BUTTON(add_button), GTK_RELIEF_NONE); | |
1026 gtk_button_set_relief(GTK_BUTTON(rem_button), GTK_RELIEF_NONE); | |
1027 } | |
1028 gtk_widget_show(list1); | |
1029 gtk_widget_show(sw1); | |
1030 gtk_widget_show(list2); | |
1031 gtk_widget_show(sw2); | |
1032 gtk_widget_show(ref_button); | |
1033 gtk_widget_show(add_button); | |
1034 gtk_widget_show(rem_button); | |
1035 | |
1036 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw1), list1); | |
1037 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), list2); | |
1038 | |
1039 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw1), | |
1040 GTK_POLICY_AUTOMATIC,GTK_POLICY_ALWAYS); | |
1041 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), | |
1042 GTK_POLICY_AUTOMATIC,GTK_POLICY_ALWAYS); | |
1043 | |
1044 cp->list1 = list1; | |
1045 cp->list2 = list2; | |
1046 | |
1047 gtk_signal_connect(GTK_OBJECT(ref_button), "clicked", | |
1048 GTK_SIGNAL_FUNC(refresh_list), cp); | |
1049 gtk_signal_connect(GTK_OBJECT(rem_button), "clicked", | |
1050 GTK_SIGNAL_FUNC(remove_chat), cp); | |
1051 gtk_signal_connect(GTK_OBJECT(add_button), "clicked", | |
1052 GTK_SIGNAL_FUNC(add_chat), cp); | |
1053 | |
1054 | |
1055 | |
1056 label = gtk_label_new(_("List of available chats")); | |
1057 gtk_widget_show(label); | |
1058 | |
1059 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, | |
1060 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
1061 gtk_table_attach(GTK_TABLE(table), ref_button, 0, 1, 1, 2, | |
1062 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
1063 gtk_table_attach(GTK_TABLE(table), sw1, 0, 1, 2, 3, | |
1064 GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, | |
1065 5, 5); | |
1066 gtk_table_attach(GTK_TABLE(table), add_button, 0, 1, 3, 4, | |
1067 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
1068 | |
1069 | |
1070 label = gtk_label_new(_("List of subscribed chats")); | |
1071 gtk_widget_show(label); | |
1072 | |
1073 gtk_table_attach(GTK_TABLE(table), label, 1, 2, 0, 1, | |
1074 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
1075 gtk_table_attach(GTK_TABLE(table), sw2, 1, 2, 2, 3, | |
1076 GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, | |
1077 5, 5); | |
1078 gtk_table_attach(GTK_TABLE(table), rem_button, 1, 2, 3, 4, | |
1079 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
1080 | |
1081 | |
1082 item = gtk_list_item_new_with_label(_("Gaim Chat")); | |
1083 cr = g_new0(struct chat_room, 1); | |
1084 strcpy(cr->name, _("Gaim Chat")); | |
1085 cr->exchange = 4; | |
1086 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
1087 gtk_widget_show(item); | |
1088 gtk_list_append_items(GTK_LIST(list1), g_list_append(NULL, item)); | |
1089 | |
1090 | |
1091 while(crs) { | |
1092 cr = (struct chat_room *)crs->data; | |
1093 item = gtk_list_item_new_with_label(cr->name); | |
1094 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
1095 gtk_widget_show(item); | |
1096 items = g_list_append(items, item); | |
1097 | |
1098 crs = crs->next; | |
1099 } | |
1100 | |
1101 gtk_list_append_items(GTK_LIST(list2), items); | |
1102 } | |
1103 | |
1104 | |
1105 | |
1106 | |
1107 | |
1108 void debug_print(char *chars) | |
1109 { | |
1110 if(general_options & OPT_GEN_DEBUG && dw) | |
1111 gtk_text_insert(GTK_TEXT(dw->entry),NULL, NULL, NULL, chars, strlen(chars)); | |
1112 #ifdef DEBUG | |
1113 printf("%s\n", chars); | |
1114 #endif | |
1115 } | |
1116 | |
1117 | |
1118 void build_debug() | |
1119 { | 1166 { |
1120 GtkWidget *scroll; | 1167 GtkWidget *scroll; |
1121 GtkWidget *box; | 1168 GtkWidget *box; |
1122 if (!dw) | 1169 if (!dw) |
1123 dw = g_new0(struct debug_window, 1); | 1170 dw = g_new0(struct debug_window, 1); |
1136 gtk_widget_show(box); | 1183 gtk_widget_show(box); |
1137 gtk_signal_connect(GTK_OBJECT(dw->window),"delete_event", GTK_SIGNAL_FUNC(debug_delete), NULL); | 1184 gtk_signal_connect(GTK_OBJECT(dw->window),"delete_event", GTK_SIGNAL_FUNC(debug_delete), NULL); |
1138 gtk_widget_show(dw->window); | 1185 gtk_widget_show(dw->window); |
1139 } | 1186 } |
1140 | 1187 |
1141 | 1188 void show_debug(GtkObject *obj) |
1142 | |
1143 void show_debug(GtkObject * object) | |
1144 { | 1189 { |
1145 if((general_options & OPT_GEN_DEBUG)) { | 1190 if((general_options & OPT_GEN_DEBUG)) { |
1146 if(!dw || !dw->window) | 1191 if(!dw || !dw->window) |
1147 build_debug(); | 1192 build_debug(); |
1148 gtk_widget_show(dw->window); | 1193 gtk_widget_show(dw->window); |
1151 gtk_widget_destroy(dw->window); | 1196 gtk_widget_destroy(dw->window); |
1152 dw->window = NULL; | 1197 dw->window = NULL; |
1153 } | 1198 } |
1154 } | 1199 } |
1155 | 1200 |
1201 void debug_print(char *chars) | |
1202 { | |
1203 if (general_options & OPT_GEN_DEBUG && dw) | |
1204 gtk_text_insert(GTK_TEXT(dw->entry), NULL, NULL, NULL, chars, strlen(chars)); | |
1205 #ifdef DEBUG | |
1206 printf("%s\n", chars); | |
1207 #endif | |
1208 } | |
1209 | |
1210 static gint handle_delete(GtkWidget *w, GdkEvent *event, void *dummy) | |
1211 { | |
1212 save_prefs(); | |
1213 | |
1214 if (cp) | |
1215 g_free(cp); | |
1216 cp = NULL; | |
1217 | |
1218 if (event == NULL) | |
1219 gtk_widget_destroy(prefs); | |
1220 prefs = NULL; | |
1221 prefdialog = NULL; | |
1222 debugbutton = NULL; | |
1223 | |
1224 return FALSE; | |
1225 } | |
1226 | |
1227 void set_option(GtkWidget *w, int *option) | |
1228 { | |
1229 *option = !(*option); | |
1230 } | |
1231 | |
1232 void set_general_option(GtkWidget *w, int *option) | |
1233 { | |
1234 general_options = general_options ^ (int)option; | |
1235 | |
1236 if ((int)option == OPT_GEN_SHOW_LAGMETER) | |
1237 update_lagometer(-1); | |
1238 if ((int)option == OPT_GEN_LOG_ALL) | |
1239 update_log_convs(); | |
1240 save_prefs(); | |
1241 } | |
1242 | |
1243 void set_display_option(GtkWidget *w, int *option) | |
1244 { | |
1245 display_options = display_options ^ (int)option; | |
1246 | |
1247 if (blist) update_button_pix(); | |
1248 | |
1249 #ifdef USE_APPLET | |
1250 update_pixmaps(); | |
1251 #endif | |
1252 | |
1253 save_prefs(); | |
1254 } | |
1255 | |
1256 void set_sound_option(GtkWidget *w, int *option) | |
1257 { | |
1258 sound_options = sound_options ^ (int)option; | |
1259 save_prefs(); | |
1260 } | |
1261 | |
1262 void set_font_option(GtkWidget *w, int *option) | |
1263 { | |
1264 font_options = font_options ^ (int)option; | |
1265 | |
1266 update_font_buttons(); | |
1267 | |
1268 save_prefs(); | |
1269 } | |
1270 | |
1271 GtkWidget *gaim_button(const char *text, int *options, int option, GtkWidget *page) | |
1272 { | |
1273 GtkWidget *button; | |
1274 button = gtk_check_button_new_with_label(text); | |
1275 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option)); | |
1276 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); | |
1277 | |
1278 if (options == &font_options) | |
1279 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_font_option), (int *)option); | |
1280 | |
1281 if (options == &sound_options) | |
1282 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_sound_option), (int *)option); | |
1283 if (options == &display_options) | |
1284 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_display_option), (int *)option); | |
1285 | |
1286 if (options == &general_options) | |
1287 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_general_option), (int *)option); | |
1288 gtk_widget_show(button); | |
1289 | |
1290 return button; | |
1291 } | |
1292 | |
1293 void prefs_build_general(GtkWidget *preftree) | |
1294 { | |
1295 GtkCTreeNode *parent; | |
1296 char *text[1]; | |
1297 | |
1298 text[0] = _("General"); | |
1299 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL, | |
1300 text, 5, NULL, NULL, NULL, NULL, 0, 1); | |
1301 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, general_page); | |
1302 } | |
1303 | |
1304 void prefs_build_connect(GtkWidget *preftree) | |
1305 { | |
1306 GtkCTreeNode *parent; | |
1307 char *text[1]; | |
1308 | |
1309 text[0] = _("Connection"); | |
1310 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL, | |
1311 text, 5, NULL, NULL, NULL, NULL, 0, 1); | |
1312 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, connect_page); | |
1313 } | |
1314 | |
1315 void prefs_build_buddy(GtkWidget *preftree) | |
1316 { | |
1317 GtkCTreeNode *parent; | |
1318 char *text[1]; | |
1319 | |
1320 text[0] = _("Buddy List"); | |
1321 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL, | |
1322 text, 5, NULL, NULL, NULL, NULL, 0, 1); | |
1323 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, buddy_page); | |
1324 } | |
1325 | |
1326 void prefs_build_convo(GtkWidget *preftree) | |
1327 { | |
1328 GtkCTreeNode *parent, *node, *node2; | |
1329 char *text[1]; | |
1330 | |
1331 text[0] = _("Conversations"); | |
1332 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL, | |
1333 text, 5, NULL, NULL, NULL, NULL, 0, 1); | |
1334 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, convo_page); | |
1335 | |
1336 text[0] = _("IM Window"); | |
1337 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL, | |
1338 text, 5, NULL, NULL, NULL, NULL, 0, 1); | |
1339 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node, im_page); | |
1340 | |
1341 text[0] = _("Chat Window"); | |
1342 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL, | |
1343 text, 5, NULL, NULL, NULL, NULL, 0, 1); | |
1344 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node, chat_page); | |
1345 | |
1346 text[0] = _("Chat Rooms"); | |
1347 node2 = gtk_ctree_insert_node(GTK_CTREE(preftree), node, NULL, | |
1348 text, 5, NULL, NULL, NULL, NULL, 1, 0); | |
1349 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node2, room_page); | |
1350 | |
1351 text[0] = _("Font Options"); | |
1352 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL, | |
1353 text, 5, NULL, NULL, NULL, NULL, 0, 1); | |
1354 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node, font_page); | |
1355 } | |
1356 | |
1357 void prefs_build_sound(GtkWidget *preftree) | |
1358 { | |
1359 GtkCTreeNode *parent, *node; | |
1360 char *text[1]; | |
1361 | |
1362 text[0] = _("Sounds"); | |
1363 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL, | |
1364 text, 5, NULL, NULL, NULL, NULL, 0, 1); | |
1365 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, sound_page); | |
1366 | |
1367 text[0] = _("Events"); | |
1368 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL, | |
1369 text, 5, NULL, NULL, NULL, NULL, 0, 1); | |
1370 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node, event_page); | |
1371 } | |
1372 | |
1373 void prefs_build_away(GtkWidget *preftree) | |
1374 { | |
1375 GtkCTreeNode *parent; | |
1376 char *text[1]; | |
1377 | |
1378 text[0] = _("Away Messages"); | |
1379 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL, | |
1380 text, 5, NULL, NULL, NULL, NULL, 0, 1); | |
1381 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, away_page); | |
1382 } | |
1383 | |
1384 void prefs_build_browser(GtkWidget *preftree) | |
1385 { | |
1386 GtkCTreeNode *parent; | |
1387 char *text[1]; | |
1388 | |
1389 text[0] = _("Browser"); | |
1390 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL, | |
1391 text, 5, NULL, NULL, NULL, NULL, 0, 1); | |
1392 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, browser_page); | |
1393 } |