Mercurial > pidgin
annotate src/prefs.c @ 277:bba300ed4fab
[gaim-migrate @ 287]
mmm mmm good
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sun, 28 May 2000 22:09:30 +0000 |
parents | 5b28ef2b550e |
children | a88b889b692b |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
22 #include <string.h> | |
23 #include <sys/time.h> | |
24 | |
25 #include <sys/types.h> | |
26 #include <sys/stat.h> | |
27 | |
28 #include <unistd.h> | |
29 #include <stdio.h> | |
30 #include <stdlib.h> | |
31 #include <gtk/gtk.h> | |
32 #include "gaim.h" | |
33 #include "proxy.h" | |
34 | |
35 struct prefs_data *pd = NULL; | |
36 struct debug_window *dw = NULL; | |
37 | |
38 GtkWidget *debugbutton; | |
39 | |
40 struct chat_page { | |
41 GtkWidget *list1; | |
42 GtkWidget *list2; | |
43 }; | |
44 | |
45 | |
46 char debug_buff[BUF_LONG]; | |
47 | |
48 void do_chat_page(GtkWidget *page); | |
49 | |
50 void list_clicked( GtkWidget *widget, struct away_message *a); | |
51 void list_unclicked( GtkWidget *widget, struct away_message *a); | |
52 | |
171
789c792ed14b
[gaim-migrate @ 181]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
150
diff
changeset
|
53 void show_debug(GtkObject *); |
1 | 54 |
55 void remove_away_message(GtkWidget *widget, void *dummy) | |
56 { | |
57 GList *i; | |
58 struct away_message *a; | |
59 | |
60 i = GTK_LIST(pd->away_list)->selection; | |
61 | |
62 a = gtk_object_get_user_data(GTK_OBJECT(i->data)); | |
63 | |
64 rem_away_mess(NULL, a); | |
65 } | |
66 | |
67 void away_list_clicked( GtkWidget *widget, struct away_message *a) | |
68 { | |
69 gchar buffer[2048]; | |
70 guint text_len; | |
71 | |
72 pd->cur_message = a; | |
73 | |
74 /* Get proper Length */ | |
75 text_len = gtk_text_get_length(GTK_TEXT(pd->away_text)); | |
76 pd->edited_message = gtk_editable_get_chars(GTK_EDITABLE(pd->away_text), 0, text_len); | |
77 | |
78 /* Clear the Box */ | |
79 gtk_text_set_point(GTK_TEXT(pd->away_text), 0 ); | |
80 gtk_text_forward_delete (GTK_TEXT(pd->away_text), text_len); | |
81 | |
82 /* Fill the text box with new message */ | |
83 strcpy(buffer, a->message); | |
84 gtk_text_insert(GTK_TEXT(pd->away_text), NULL, NULL, NULL, buffer, -1); | |
85 | |
86 | |
87 } | |
88 | |
89 void away_list_unclicked( GtkWidget *widget, struct away_message *a) | |
90 { | |
91 if (pd == NULL) | |
92 return; | |
93 strcpy(a->message, pd->edited_message); | |
94 save_prefs(); | |
95 } | |
96 | |
97 void set_option(GtkWidget *w, int *option) | |
98 { | |
99 *option = !(*option); | |
100 } | |
101 | |
102 void set_display_option(GtkWidget *w, int *option) | |
103 { | |
104 display_options = display_options ^ (int)option; | |
9 | 105 |
18 | 106 if (blist) update_button_pix(); |
9 | 107 |
84 | 108 #ifdef USE_APPLET |
82 | 109 update_pixmaps(); |
110 #endif | |
111 | |
1 | 112 save_prefs(); |
113 } | |
114 | |
115 void set_sound_option(GtkWidget *w, int *option) | |
116 { | |
117 sound_options = sound_options ^ (int)option; | |
118 save_prefs(); | |
119 } | |
120 | |
121 void set_font_option(GtkWidget *w, int *option) | |
122 { | |
123 font_options = font_options ^ (int)option; | |
124 | |
125 update_font_buttons(); | |
126 | |
127 save_prefs(); | |
128 } | |
129 | |
130 void set_general_option(GtkWidget *w, int *option) | |
131 { | |
132 general_options = general_options ^ (int)option; | |
133 | |
134 if ((int)option == OPT_GEN_SHOW_LAGMETER) | |
135 update_lagometer(-1); | |
136 if ((int)option == OPT_GEN_LOG_ALL) | |
137 update_log_convs(); | |
138 save_prefs(); | |
139 | |
140 /* | |
141 if (data == &show_grp_nums) | |
142 update_num_groups(); | |
143 if (data == &showidle || data == &showpix) | |
144 update_show_idlepix(); | |
18 | 145 if (data == &button_pix && blist) |
1 | 146 update_button_pix(); |
147 if (data == &transparent) | |
148 update_transparency(); | |
149 */ | |
150 | |
151 } | |
152 | |
153 | |
154 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy) | |
155 { | |
171
789c792ed14b
[gaim-migrate @ 181]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
150
diff
changeset
|
156 if (debugbutton) |
789c792ed14b
[gaim-migrate @ 181]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
150
diff
changeset
|
157 gtk_button_clicked(GTK_BUTTON(debugbutton)); |
789c792ed14b
[gaim-migrate @ 181]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
150
diff
changeset
|
158 if (general_options & OPT_GEN_DEBUG) |
1 | 159 { |
171
789c792ed14b
[gaim-migrate @ 181]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
150
diff
changeset
|
160 general_options = general_options ^ (int)OPT_GEN_DEBUG; |
789c792ed14b
[gaim-migrate @ 181]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
150
diff
changeset
|
161 save_prefs(); |
1 | 162 } |
163 g_free(dw); | |
164 dw=NULL; | |
165 return FALSE; | |
166 | |
167 } | |
168 | |
169 static gint handle_delete(GtkWidget *w, GdkEvent *event, void *dummy) | |
170 { | |
171 guint text_len; | |
172 struct away_message *a; | |
173 | |
174 | |
175 if (pd->cur_message) { | |
176 | |
177 a = pd->cur_message; | |
178 | |
179 | |
180 /* Get proper Length and grab data */ | |
181 text_len = gtk_text_get_length(GTK_TEXT(pd->away_text)); | |
182 pd->edited_message = gtk_editable_get_chars(GTK_EDITABLE(pd->away_text), 0, text_len); | |
183 | |
184 /* Store the data for later use */ | |
185 strcpy(a->message, pd->edited_message); | |
186 | |
187 } | |
188 | |
189 save_prefs(); | |
190 | |
191 if (event == NULL) | |
192 { | |
193 gtk_widget_destroy(pd->window); | |
194 debugbutton=NULL; | |
195 } | |
196 g_free(pd); | |
197 pd = NULL; | |
198 | |
199 | |
200 return FALSE; | |
201 } | |
202 | |
203 static int | |
204 manualentry_key_pressed(GtkWidget *w, GdkEvent *event, void *dummy) | |
205 { | |
206 g_snprintf(web_command, sizeof(web_command), "%s", gtk_entry_get_text(GTK_ENTRY(pd->browser_entry))); | |
207 save_prefs(); | |
208 return TRUE; | |
209 } | |
210 | |
211 static int | |
212 connection_key_pressed(GtkWidget *w, GdkEvent *event, void *dummy) | |
213 { | |
214 g_snprintf(aim_host, sizeof(aim_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->aim_host_entry))); | |
215 sscanf(gtk_entry_get_text(GTK_ENTRY(pd->aim_port_entry)), "%d", &aim_port); | |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
216 if (proxy_type == PROXY_HTTP) { |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
217 g_snprintf(proxy_host, sizeof(proxy_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->http_proxy_host_entry))); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
218 sscanf(gtk_entry_get_text(GTK_ENTRY(pd->http_proxy_port_entry)), "%d", &proxy_port); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
219 } else if (proxy_type == PROXY_SOCKS) { |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
220 g_snprintf(proxy_host, sizeof(proxy_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->socks_proxy_host_entry))); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
221 sscanf(gtk_entry_get_text(GTK_ENTRY(pd->socks_proxy_port_entry)), "%d", &proxy_port); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
222 } |
1 | 223 |
224 g_snprintf(login_host, sizeof(login_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->login_host_entry))); | |
225 sscanf(gtk_entry_get_text(GTK_ENTRY(pd->login_port_entry)), "%d", &login_port); | |
226 save_prefs(); | |
227 return TRUE; | |
228 } | |
229 | |
230 | |
231 | |
232 | |
233 static void set_browser(GtkWidget *w, int *data) | |
234 { | |
235 web_browser = (int)data; | |
236 if (web_browser != BROWSER_MANUAL) { | |
237 if (pd->browser_entry) | |
238 gtk_widget_set_sensitive(pd->browser_entry, FALSE); | |
239 } else { | |
240 if (pd->browser_entry) | |
241 gtk_widget_set_sensitive(pd->browser_entry, TRUE); | |
242 } | |
243 | |
244 if (web_browser != BROWSER_NETSCAPE) { | |
245 if (pd->nwbutton) | |
246 gtk_widget_set_sensitive(pd->nwbutton, FALSE); | |
247 } else { | |
248 if (pd->nwbutton) | |
249 gtk_widget_set_sensitive(pd->nwbutton, TRUE); | |
250 } | |
251 | |
252 | |
253 save_prefs(); | |
254 } | |
255 | |
256 static void set_connect(GtkWidget *w, int *data) | |
257 { | |
258 proxy_type = (int)data; | |
259 if (proxy_type == PROXY_HTTP) { | |
260 if (pd->http_proxy_host_entry) | |
261 gtk_widget_set_sensitive(pd->http_proxy_host_entry, TRUE); | |
262 if (pd->http_proxy_port_entry) | |
263 gtk_widget_set_sensitive(pd->http_proxy_port_entry, TRUE); | |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
264 if (pd->socks_proxy_host_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
265 gtk_widget_set_sensitive(pd->socks_proxy_host_entry, FALSE); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
266 if (pd->socks_proxy_port_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
267 gtk_widget_set_sensitive(pd->socks_proxy_port_entry, FALSE); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
268 } else if (proxy_type == PROXY_SOCKS) { |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
269 if (pd->socks_proxy_host_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
270 gtk_widget_set_sensitive(pd->socks_proxy_host_entry, TRUE); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
271 if (pd->socks_proxy_port_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
272 gtk_widget_set_sensitive(pd->socks_proxy_port_entry, TRUE); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
273 if (pd->http_proxy_host_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
274 gtk_widget_set_sensitive(pd->http_proxy_host_entry, FALSE); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
275 if (pd->http_proxy_port_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
276 gtk_widget_set_sensitive(pd->http_proxy_port_entry, FALSE); |
1 | 277 } else { |
278 if (pd->http_proxy_host_entry) | |
279 gtk_widget_set_sensitive(pd->http_proxy_host_entry, FALSE); | |
280 if (pd->http_proxy_port_entry) | |
281 gtk_widget_set_sensitive(pd->http_proxy_port_entry, FALSE); | |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
282 if (pd->socks_proxy_host_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
283 gtk_widget_set_sensitive(pd->socks_proxy_host_entry, FALSE); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
284 if (pd->socks_proxy_port_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
285 gtk_widget_set_sensitive(pd->socks_proxy_port_entry, FALSE); |
1 | 286 } |
287 | |
288 save_prefs(); | |
289 } | |
290 | |
291 static void set_idle(GtkWidget *w, int *data) | |
292 { | |
293 report_idle = (int)data; | |
294 save_prefs(); | |
295 } | |
296 | |
297 | |
298 GtkWidget *gaim_button(const char *text, int *options, int option, GtkWidget *page) | |
299 { | |
300 GtkWidget *button; | |
301 button = gtk_check_button_new_with_label(text); | |
302 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option)); | |
303 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); | |
304 | |
305 if (options == &font_options) | |
306 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_font_option), (int *)option); | |
307 | |
308 if (options == &sound_options) | |
309 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_sound_option), (int *)option); | |
310 if (options == &display_options) | |
311 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_display_option), (int *)option); | |
312 | |
313 if (options == &general_options) | |
314 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_general_option), (int *)option); | |
315 gtk_widget_show(button); | |
316 | |
317 return button; | |
318 } | |
319 | |
320 | |
321 void build_prefs() | |
322 { | |
323 GtkWidget *bbox; | |
324 GtkWidget *vbox; | |
325 GtkWidget *hbox; | |
326 GtkWidget *hbox2; | |
327 GtkWidget *idlebox; | |
328 GtkWidget *idleframe; | |
329 GtkWidget *genbox; | |
330 GtkWidget *fontbox; | |
331 GtkWidget *fontframe; | |
332 GtkWidget *appbox; | |
333 GtkWidget *away_topbox; | |
334 GtkWidget *away_botbox; | |
335 GtkWidget *add_away; | |
336 GtkWidget *remove_away; | |
337 GtkWidget *close; | |
338 GtkWidget *notebook; | |
339 GtkWidget *sound_page; | |
340 /* GtkWidget *debug_page; */ | |
341 GtkWidget *general_page; | |
342 GtkWidget *appearance_page; | |
343 GtkWidget *chat_page; | |
344 GtkWidget *browser_page; | |
345 GtkWidget *connection_page; | |
346 GtkWidget *label; | |
347 GtkWidget *browseropt; | |
348 GtkWidget *connectopt; | |
349 GtkWidget *idleopt; | |
350 | |
351 GList *awy = away_messages; | |
352 struct away_message *a; | |
353 GtkWidget *sw; | |
354 GtkWidget *sw2; | |
355 GtkWidget *away_page; | |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
206
diff
changeset
|
356 GtkWidget *select_font; |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
357 GtkWidget *font_face_for_text; |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
206
diff
changeset
|
358 |
1 | 359 GtkWidget *list_item; |
360 | |
361 gchar buffer[64]; | |
362 | |
363 if (!pd) | |
364 pd = g_new0(struct prefs_data, 1); | |
365 | |
366 pd->window = gtk_window_new(GTK_WINDOW_DIALOG); | |
367 gtk_widget_realize(pd->window); | |
368 aol_icon(pd->window->window); | |
369 gtk_container_border_width(GTK_CONTAINER(pd->window), 10); | |
370 gtk_window_set_title(GTK_WINDOW(pd->window), "Gaim - Preferences"); | |
371 | |
372 vbox = gtk_vbox_new(FALSE, 5); | |
373 gtk_container_add(GTK_CONTAINER(pd->window), vbox); | |
374 | |
375 /* Notebooks */ | |
376 notebook = gtk_notebook_new(); | |
377 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 5); | |
378 | |
379 | |
380 /* General page */ | |
381 general_page = gtk_hbox_new(FALSE, 0); | |
382 label = gtk_label_new("General"); | |
383 gtk_widget_show(label); | |
384 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), general_page, label); | |
385 | |
386 genbox = gtk_vbox_new(FALSE, 5); | |
387 idleframe = gtk_frame_new("Idle"); | |
388 idlebox = gtk_vbox_new(FALSE, 5); | |
389 | |
390 gtk_box_pack_start(GTK_BOX(general_page), genbox, TRUE, TRUE, 5); | |
391 gtk_box_pack_start(GTK_BOX(general_page), idleframe, TRUE, TRUE, 5); | |
392 gtk_container_add(GTK_CONTAINER(idleframe), idlebox); | |
393 | |
394 | |
395 gaim_button("Enter sends message", &general_options, OPT_GEN_ENTER_SENDS, genbox); | |
396 gaim_button("Auto-login", &general_options, OPT_GEN_AUTO_LOGIN, genbox); | |
397 gaim_button("Log All Conversations", &general_options, OPT_GEN_LOG_ALL, genbox); | |
398 gaim_button("Strip HTML from log files", &general_options, OPT_GEN_STRIP_HTML, genbox); | |
399 #ifdef USE_APPLET | |
10 | 400 gaim_button("Automatically Show Buddy List", &general_options, OPT_GEN_APP_BUDDY_SHOW, genbox); |
1 | 401 #endif |
402 gaim_button("Raise windows when message recieved", &general_options, OPT_GEN_POPUP_WINDOWS, genbox); | |
403 gaim_button("Send URLs as links", &general_options, OPT_GEN_SEND_LINKS, genbox); | |
404 gaim_button("Show Lag-O-Meter", &general_options, OPT_GEN_SHOW_LAGMETER, genbox); | |
405 gaim_button("Save some window size/positions", &general_options, OPT_GEN_SAVED_WINDOWS, genbox); | |
406 gaim_button("Ignore new conversations when away", &general_options, OPT_GEN_DISCARD_WHEN_AWAY, genbox); | |
180 | 407 gaim_button("Automagically check for new releases", &general_options, OPT_GEN_CHECK_VERSIONS, genbox); |
206 | 408 gaim_button("Automagically highlight misspelled words", &general_options, OPT_GEN_CHECK_SPELLING, genbox); |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
171
diff
changeset
|
409 if (!dw && (general_options & OPT_GEN_DEBUG)) |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
171
diff
changeset
|
410 general_options = general_options ^ OPT_GEN_DEBUG; |
1 | 411 debugbutton = gaim_button("Enable debug mode", &general_options, OPT_GEN_DEBUG, genbox); |
412 | |
413 | |
414 idleopt = gtk_radio_button_new_with_label(NULL, "No Idle"); | |
415 gtk_box_pack_start(GTK_BOX(idlebox), idleopt, FALSE, FALSE, 0); | |
416 gtk_signal_connect(GTK_OBJECT(idleopt), "clicked", GTK_SIGNAL_FUNC(set_idle), (void *)IDLE_NONE); | |
417 gtk_widget_show(idleopt); | |
418 if (report_idle == IDLE_NONE) | |
419 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(idleopt), TRUE); | |
420 | |
421 idleopt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(idleopt)), "GAIM Use"); | |
422 gtk_box_pack_start(GTK_BOX(idlebox), idleopt, FALSE, FALSE, 0); | |
423 gtk_signal_connect(GTK_OBJECT(idleopt), "clicked", GTK_SIGNAL_FUNC(set_idle), (void *)IDLE_GAIM); | |
424 gtk_widget_show(idleopt); | |
425 if (report_idle == IDLE_GAIM) | |
426 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(idleopt), TRUE); | |
427 | |
428 /* idleopt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(idleopt)), "X Use"); | |
429 gtk_box_pack_start(GTK_BOX(idlebox), idleopt, FALSE, FALSE, 0); | |
430 gtk_signal_connect(GTK_OBJECT(idleopt), "clicked", GTK_SIGNAL_FUNC(set_idle), (void *)IDLE_SYSTEM); | |
431 gtk_widget_show(idleopt); | |
432 if (report_idle == IDLE_SYSTEM) | |
433 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(idleopt), TRUE); | |
434 */ | |
435 | |
436 gtk_widget_show(general_page); | |
437 gtk_widget_show(genbox); | |
438 gtk_widget_show(idlebox); | |
439 gtk_widget_show(idleframe); | |
440 | |
441 | |
171
789c792ed14b
[gaim-migrate @ 181]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
150
diff
changeset
|
442 gtk_signal_connect_object( GTK_OBJECT(debugbutton), "clicked", GTK_SIGNAL_FUNC(show_debug), NULL); |
1 | 443 |
444 /* Connection */ | |
445 | |
446 connection_page = gtk_vbox_new(FALSE, 0); | |
447 label = gtk_label_new("Connection"); | |
448 gtk_widget_show(label); | |
449 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), connection_page, label); | |
450 | |
451 hbox = gtk_hbox_new(FALSE, 0); | |
452 label = gtk_label_new("TOC Host:"); | |
453 gtk_widget_show(label); | |
454 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
455 pd->aim_host_entry = gtk_entry_new(); | |
456 gtk_widget_show(pd->aim_host_entry); | |
457 gtk_box_pack_start(GTK_BOX(hbox), pd->aim_host_entry, FALSE, FALSE, 0); | |
458 | |
459 label = gtk_label_new("Port:"); | |
460 gtk_widget_show(label); | |
461 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
462 pd->aim_port_entry = gtk_entry_new(); | |
463 gtk_widget_show(pd->aim_port_entry); | |
464 gtk_box_pack_start(GTK_BOX(hbox), pd->aim_port_entry, FALSE, FALSE, 0); | |
465 gtk_widget_show(hbox); | |
466 | |
467 gtk_box_pack_start(GTK_BOX(connection_page), hbox, FALSE, FALSE, 0); | |
468 gtk_entry_set_text(GTK_ENTRY(pd->aim_host_entry), aim_host); | |
469 | |
470 g_snprintf(buffer, sizeof(buffer), "%d", aim_port); | |
471 gtk_entry_set_text(GTK_ENTRY(pd->aim_port_entry), buffer); | |
472 | |
473 hbox2 = gtk_hbox_new(FALSE, 0); | |
474 label = gtk_label_new("Login Host:"); | |
475 gtk_widget_show(label); | |
476 gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 5); | |
477 pd->login_host_entry = gtk_entry_new(); | |
478 gtk_widget_show(pd->login_host_entry); | |
479 gtk_box_pack_start(GTK_BOX(hbox2), pd->login_host_entry, FALSE, FALSE, 0); | |
480 | |
481 label = gtk_label_new("Port:"); | |
482 gtk_widget_show(label); | |
483 gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 5); | |
484 pd->login_port_entry = gtk_entry_new(); | |
485 gtk_widget_show(pd->login_port_entry); | |
486 gtk_box_pack_start(GTK_BOX(hbox2), pd->login_port_entry, FALSE, FALSE, 0); | |
487 gtk_widget_show(hbox2); | |
488 | |
489 gtk_box_pack_start(GTK_BOX(connection_page), hbox2, FALSE, FALSE, 0); | |
490 gtk_entry_set_text(GTK_ENTRY(pd->login_host_entry), login_host); | |
491 | |
492 g_snprintf(buffer, sizeof(buffer), "%d", login_port); | |
493 gtk_entry_set_text(GTK_ENTRY(pd->login_port_entry), buffer); | |
494 | |
495 connectopt = gtk_radio_button_new_with_label(NULL, "No Proxy"); | |
496 gtk_box_pack_start(GTK_BOX(connection_page), connectopt, FALSE, FALSE, 0); | |
497 gtk_signal_connect(GTK_OBJECT(connectopt), "clicked", GTK_SIGNAL_FUNC(set_connect), (void *)PROXY_NONE); | |
498 gtk_widget_show(connectopt); | |
499 if (proxy_type == PROXY_NONE) | |
500 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(connectopt), TRUE); | |
501 | |
502 connectopt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(connectopt)), "HTTP Proxy"); | |
503 gtk_box_pack_start(GTK_BOX(connection_page), connectopt, FALSE, FALSE, 0); | |
504 gtk_signal_connect(GTK_OBJECT(connectopt), "clicked", GTK_SIGNAL_FUNC(set_connect), (void *)PROXY_HTTP); | |
505 gtk_widget_show(connectopt); | |
506 if (proxy_type == PROXY_HTTP) | |
507 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(connectopt), TRUE); | |
508 | |
509 | |
510 hbox = gtk_hbox_new(FALSE, 0); | |
511 label = gtk_label_new("Proxy Host:"); | |
512 gtk_widget_show(label); | |
513 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
514 pd->http_proxy_host_entry = gtk_entry_new(); | |
515 gtk_widget_show(pd->http_proxy_host_entry); | |
516 gtk_box_pack_start(GTK_BOX(hbox), pd->http_proxy_host_entry, FALSE, FALSE, 0); | |
517 | |
518 label = gtk_label_new("Port:"); | |
519 gtk_widget_show(label); | |
520 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
521 pd->http_proxy_port_entry = gtk_entry_new(); | |
522 gtk_widget_show(pd->http_proxy_port_entry); | |
523 gtk_box_pack_start(GTK_BOX(hbox), pd->http_proxy_port_entry, FALSE, FALSE, 0); | |
524 gtk_widget_show(hbox); | |
525 | |
526 gtk_box_pack_start(GTK_BOX(connection_page), hbox, FALSE, FALSE, 0); | |
527 gtk_entry_set_text(GTK_ENTRY(pd->http_proxy_host_entry), proxy_host); | |
528 | |
529 g_snprintf(buffer, sizeof(buffer), "%d", proxy_port); | |
530 gtk_entry_set_text(GTK_ENTRY(pd->http_proxy_port_entry), buffer); | |
531 | |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
532 connectopt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(connectopt)), "SOCKS v4 Proxy"); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
533 gtk_box_pack_start(GTK_BOX(connection_page), connectopt, FALSE, FALSE, 0); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
534 gtk_signal_connect(GTK_OBJECT(connectopt), "clicked", GTK_SIGNAL_FUNC(set_connect), (void *)PROXY_SOCKS); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
535 gtk_widget_show(connectopt); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
536 if (proxy_type == PROXY_SOCKS) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
537 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(connectopt), TRUE); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
538 |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
539 |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
540 hbox = gtk_hbox_new(FALSE, 0); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
541 label = gtk_label_new("Proxy Host:"); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
542 gtk_widget_show(label); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
543 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
544 pd->socks_proxy_host_entry = gtk_entry_new(); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
545 gtk_widget_show(pd->socks_proxy_host_entry); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
546 gtk_box_pack_start(GTK_BOX(hbox), pd->socks_proxy_host_entry, FALSE, FALSE, 0); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
547 |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
548 label = gtk_label_new("Port:"); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
549 gtk_widget_show(label); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
550 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
551 pd->socks_proxy_port_entry = gtk_entry_new(); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
552 gtk_widget_show(pd->socks_proxy_port_entry); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
553 gtk_box_pack_start(GTK_BOX(hbox), pd->socks_proxy_port_entry, FALSE, FALSE, 0); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
554 gtk_widget_show(hbox); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
555 |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
556 gtk_box_pack_start(GTK_BOX(connection_page), hbox, FALSE, FALSE, 0); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
557 gtk_entry_set_text(GTK_ENTRY(pd->socks_proxy_host_entry), proxy_host); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
558 |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
559 g_snprintf(buffer, sizeof(buffer), "%d", proxy_port); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
560 gtk_entry_set_text(GTK_ENTRY(pd->socks_proxy_port_entry), buffer); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
561 |
1 | 562 |
563 gtk_widget_show(connection_page); | |
564 | |
565 | |
566 if (proxy_type == PROXY_HTTP) { | |
567 if (pd->http_proxy_host_entry) | |
568 gtk_widget_set_sensitive(pd->http_proxy_host_entry, TRUE); | |
569 if (pd->http_proxy_port_entry) | |
570 gtk_widget_set_sensitive(pd->http_proxy_port_entry, TRUE); | |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
571 if (pd->socks_proxy_host_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
572 gtk_widget_set_sensitive(pd->socks_proxy_host_entry, FALSE); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
573 if (pd->socks_proxy_port_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
574 gtk_widget_set_sensitive(pd->socks_proxy_port_entry, FALSE); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
575 } else if (proxy_type == PROXY_SOCKS) { |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
576 if (pd->socks_proxy_host_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
577 gtk_widget_set_sensitive(pd->socks_proxy_host_entry, TRUE); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
578 if (pd->socks_proxy_port_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
579 gtk_widget_set_sensitive(pd->socks_proxy_port_entry, TRUE); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
580 if (pd->http_proxy_host_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
581 gtk_widget_set_sensitive(pd->http_proxy_host_entry, FALSE); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
582 if (pd->http_proxy_port_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
583 gtk_widget_set_sensitive(pd->http_proxy_port_entry, FALSE); |
1 | 584 } else { |
585 if (pd->http_proxy_host_entry) | |
586 gtk_widget_set_sensitive(pd->http_proxy_host_entry, FALSE); | |
587 if (pd->http_proxy_port_entry) | |
588 gtk_widget_set_sensitive(pd->http_proxy_port_entry, FALSE); | |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
589 if (pd->socks_proxy_host_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
590 gtk_widget_set_sensitive(pd->socks_proxy_host_entry, FALSE); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
591 if (pd->socks_proxy_port_entry) |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
592 gtk_widget_set_sensitive(pd->socks_proxy_port_entry, FALSE); |
1 | 593 } |
594 | |
595 | |
596 | |
597 gtk_signal_connect(GTK_OBJECT(pd->aim_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
598 gtk_signal_connect(GTK_OBJECT(pd->aim_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
599 gtk_signal_connect(GTK_OBJECT(pd->login_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
600 gtk_signal_connect(GTK_OBJECT(pd->login_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
601 gtk_signal_connect(GTK_OBJECT(pd->socks_proxy_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
602 gtk_signal_connect(GTK_OBJECT(pd->socks_proxy_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
603 gtk_signal_connect(GTK_OBJECT(pd->socks_proxy_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
604 gtk_signal_connect(GTK_OBJECT(pd->socks_proxy_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); |
1 | 605 |
606 | |
607 /* Away */ | |
608 | |
609 a = awaymessage; | |
610 pd->cur_message = NULL; | |
611 pd->nwbutton = NULL; | |
612 pd->browser_entry = NULL; | |
613 | |
614 away_page = gtk_vbox_new(FALSE, 0); | |
615 away_topbox = gtk_hbox_new(FALSE, 0); | |
616 away_botbox = gtk_hbox_new(FALSE, 0); | |
617 | |
618 label = gtk_label_new("Away"); | |
619 gtk_widget_show(label); | |
620 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), away_page, label); | |
621 gtk_widget_show(away_page); | |
622 | |
623 sw2 = gtk_scrolled_window_new(NULL, NULL); | |
624 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), | |
625 GTK_POLICY_AUTOMATIC, | |
626 GTK_POLICY_AUTOMATIC); | |
627 gtk_widget_show(sw2); | |
628 | |
629 pd->away_list = gtk_list_new(); | |
630 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), pd->away_list); | |
631 gtk_box_pack_start(GTK_BOX(away_topbox), sw2, TRUE, TRUE, 0); | |
632 | |
633 sw = gtk_scrolled_window_new(NULL, NULL); | |
634 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
635 GTK_POLICY_AUTOMATIC, | |
636 GTK_POLICY_AUTOMATIC); | |
637 gtk_widget_show(sw); | |
638 | |
639 pd->away_text = gtk_text_new(NULL, NULL); | |
640 gtk_container_add(GTK_CONTAINER(sw), pd->away_text); | |
641 gtk_box_pack_start(GTK_BOX(away_topbox), sw, TRUE, TRUE, 0); | |
642 gtk_text_set_word_wrap(GTK_TEXT(pd->away_text), TRUE); | |
643 gtk_text_set_editable(GTK_TEXT(pd->away_text), TRUE ); | |
644 | |
645 add_away = gtk_button_new_with_label("Create Message"); | |
646 gtk_signal_connect(GTK_OBJECT(add_away), "clicked", GTK_SIGNAL_FUNC(create_away_mess), NULL); | |
647 gtk_box_pack_start(GTK_BOX(away_botbox), add_away, TRUE, FALSE, 5); | |
648 | |
649 remove_away = gtk_button_new_with_label("Remove Message"); | |
650 gtk_signal_connect(GTK_OBJECT(remove_away), "clicked", GTK_SIGNAL_FUNC(remove_away_message), NULL); | |
651 gtk_box_pack_start(GTK_BOX(away_botbox), remove_away, TRUE, FALSE, 5); | |
652 | |
653 gtk_box_pack_start(GTK_BOX(away_page), away_topbox, TRUE, TRUE, 0); | |
654 gtk_box_pack_start(GTK_BOX(away_page), away_botbox, FALSE, FALSE, 0); | |
655 | |
656 gtk_widget_show(add_away); | |
657 gtk_widget_show(remove_away); | |
658 gtk_widget_show(pd->away_list); | |
659 gtk_widget_show(pd->away_text); | |
660 gtk_widget_show(away_topbox); | |
661 gtk_widget_show(away_botbox); | |
662 | |
663 if (awy != NULL) { | |
664 a = (struct away_message *)awy->data; | |
665 g_snprintf(buffer, sizeof(buffer), "%s", a->message); | |
666 gtk_text_insert(GTK_TEXT(pd->away_text), NULL, NULL, NULL, buffer, -1); | |
667 } | |
668 | |
669 while(awy) { | |
670 a = (struct away_message *)awy->data; | |
671 label = gtk_label_new(a->name); | |
672 list_item = gtk_list_item_new(); | |
673 gtk_container_add(GTK_CONTAINER(list_item), label); | |
674 gtk_signal_connect(GTK_OBJECT(list_item), "select", GTK_SIGNAL_FUNC(away_list_clicked), a); | |
675 gtk_signal_connect(GTK_OBJECT(list_item), "deselect", GTK_SIGNAL_FUNC(away_list_unclicked), a); | |
676 gtk_object_set_user_data(GTK_OBJECT(list_item), a); | |
677 | |
678 gtk_widget_show(label); | |
679 gtk_container_add(GTK_CONTAINER(pd->away_list), list_item); | |
680 gtk_widget_show(list_item); | |
681 | |
682 awy = awy->next; | |
683 | |
684 } | |
685 | |
686 /* Sound */ | |
687 sound_page = gtk_vbox_new(FALSE, 0); | |
688 label = gtk_label_new("Sounds"); | |
689 gtk_widget_show(label); | |
690 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), sound_page, label); | |
691 gaim_button("Sound when buddy logs in", &sound_options, OPT_SOUND_LOGIN, sound_page); | |
692 gaim_button("Sound when buddy logs out", &sound_options, OPT_SOUND_LOGOUT, sound_page); | |
693 gaim_button("Sound when message is received", &sound_options, OPT_SOUND_RECV, sound_page); | |
694 gaim_button("Sound when message is sent", &sound_options, OPT_SOUND_SEND, sound_page); | |
695 gaim_button("Sound when first message is received", &sound_options, OPT_SOUND_FIRST_RCV, sound_page); | |
696 gaim_button("Sound when message is received if away", &sound_options, OPT_SOUND_WHEN_AWAY, sound_page); | |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
84
diff
changeset
|
697 gaim_button("No sound for buddies signed on when you log in", &sound_options, OPT_SOUND_SILENT_SIGNON, sound_page); |
1 | 698 gtk_widget_show(sound_page); |
699 | |
700 | |
701 /* Browser */ | |
702 browser_page = gtk_vbox_new(FALSE, 0); | |
703 | |
704 label = gtk_label_new("Browser"); | |
705 gtk_widget_show(label); | |
706 | |
707 | |
708 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), browser_page, label); | |
709 browseropt = gtk_radio_button_new_with_label(NULL, "Netscape"); | |
710 gtk_box_pack_start(GTK_BOX(browser_page), browseropt, FALSE, FALSE, 0); | |
711 gtk_signal_connect(GTK_OBJECT(browseropt), "clicked", GTK_SIGNAL_FUNC(set_browser), (void *)BROWSER_NETSCAPE); | |
712 gtk_widget_show(browseropt); | |
713 if (web_browser == BROWSER_NETSCAPE) | |
714 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(browseropt), TRUE); | |
715 | |
716 browseropt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(browseropt)), "KFM (The KDE browser)"); | |
717 gtk_box_pack_start(GTK_BOX(browser_page), browseropt, FALSE, FALSE, 0); | |
718 gtk_signal_connect(GTK_OBJECT(browseropt), "clicked", GTK_SIGNAL_FUNC(set_browser), (void *)BROWSER_KFM); | |
719 gtk_widget_show(browseropt); | |
720 if (web_browser == BROWSER_KFM) | |
721 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(browseropt), TRUE); | |
722 | |
723 | |
724 browseropt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(browseropt)), "Internal HTML widget (Quite likely a bad idea!)"); | |
725 gtk_box_pack_start(GTK_BOX(browser_page), browseropt, FALSE, FALSE, 0); | |
726 gtk_signal_connect(GTK_OBJECT(browseropt), "clicked", GTK_SIGNAL_FUNC(set_browser), (void *)BROWSER_INTERNAL); | |
727 gtk_widget_show(browseropt); | |
728 if (web_browser == BROWSER_INTERNAL) | |
729 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(browseropt), TRUE); | |
730 | |
731 | |
732 browseropt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(browseropt)), "Manual"); | |
733 gtk_box_pack_start(GTK_BOX(browser_page), browseropt, FALSE, FALSE, 0); | |
734 gtk_signal_connect(GTK_OBJECT(browseropt), "clicked", GTK_SIGNAL_FUNC(set_browser), (void *)BROWSER_MANUAL); | |
735 gtk_widget_show(browseropt); | |
736 if (web_browser == BROWSER_MANUAL) | |
737 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(browseropt), TRUE); | |
738 | |
739 | |
740 pd->browser_entry = gtk_entry_new(); | |
741 gtk_widget_show(pd->browser_entry); | |
742 | |
743 gtk_box_pack_start(GTK_BOX(browser_page), pd->browser_entry, FALSE, FALSE, 0); | |
744 gtk_entry_set_text(GTK_ENTRY(pd->browser_entry), web_command); | |
745 | |
746 pd->nwbutton = gaim_button("Pop up new window by default", &general_options, OPT_GEN_BROWSER_POPUP, browser_page); | |
747 gtk_widget_show(browser_page); | |
748 | |
749 gtk_signal_connect(GTK_OBJECT(pd->browser_entry), "focus_out_event", GTK_SIGNAL_FUNC(manualentry_key_pressed), NULL); | |
750 | |
751 | |
752 | |
753 if (web_browser != BROWSER_MANUAL) { | |
754 gtk_widget_set_sensitive(pd->browser_entry, FALSE); | |
755 } else { | |
756 gtk_widget_set_sensitive(pd->browser_entry, TRUE); | |
757 } | |
758 | |
759 if (web_browser != BROWSER_NETSCAPE) { | |
760 gtk_widget_set_sensitive(pd->nwbutton, FALSE); | |
761 } else { | |
762 gtk_widget_set_sensitive(pd->nwbutton, TRUE); | |
763 } | |
764 | |
765 | |
766 | |
767 | |
768 /* Appearance */ | |
769 appearance_page = gtk_hbox_new(FALSE, 0); | |
770 label = gtk_label_new("Appearance"); | |
771 gtk_widget_show(label); | |
772 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), appearance_page, label); | |
773 appbox = gtk_vbox_new(FALSE, 5); | |
774 fontframe = gtk_frame_new("Font Properties"); | |
775 fontbox = gtk_vbox_new(FALSE, 5); | |
776 | |
777 gtk_box_pack_start(GTK_BOX(appearance_page), appbox, TRUE, TRUE, 5); | |
778 gtk_box_pack_start(GTK_BOX(appearance_page), fontframe, TRUE, TRUE, 5); | |
779 gtk_container_add(GTK_CONTAINER(fontframe), fontbox); | |
780 | |
781 gaim_button("Show time on messages", &display_options, OPT_DISP_SHOW_TIME, appbox); | |
782 gaim_button("Show numbers in groups", &display_options, OPT_DISP_SHOW_GRPNUM, appbox ); | |
783 gaim_button("Show buddy-type pixmaps", &display_options, OPT_DISP_SHOW_PIXMAPS, appbox ); | |
784 gaim_button("Show idle times", &display_options, OPT_DISP_SHOW_IDLETIME, appbox ); | |
785 gaim_button("Show button pixmaps", &display_options, OPT_DISP_SHOW_BUTTON_XPM, appbox ); | |
786 gaim_button("Ignore incoming colours", &display_options, OPT_DISP_IGNORE_COLOUR, appbox ); | |
787 #if 0 | |
788 gaim_button("Transparent text window (experimental)", &transparent, appbox ); | |
789 #endif | |
790 gaim_button("Show logon/logoffs in conversation windows", &display_options, OPT_DISP_SHOW_LOGON, appbox ); | |
150
d4e99c17e399
[gaim-migrate @ 160]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
109
diff
changeset
|
791 gaim_button("Use devil icons", &display_options, OPT_DISP_DEVIL_PIXMAPS, appbox ); |
d4e99c17e399
[gaim-migrate @ 160]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
109
diff
changeset
|
792 |
1 | 793 |
794 | |
795 gaim_button("Bold Text", &font_options, OPT_FONT_BOLD, fontbox); | |
796 gaim_button("Italics Text", &font_options, OPT_FONT_ITALIC, fontbox); | |
797 gaim_button("Underlined Text", &font_options, OPT_FONT_UNDERLINE, fontbox); | |
798 gaim_button("Strike Text", &font_options, OPT_FONT_STRIKE, fontbox); | |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
799 font_face_for_text = gaim_button("Font Face for Text", &font_options, OPT_FONT_FACE, fontbox); |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
800 |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
206
diff
changeset
|
801 select_font = gtk_button_new_with_label("Select Font"); |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
206
diff
changeset
|
802 gtk_box_pack_start(GTK_BOX(fontbox), select_font, FALSE, FALSE, 0); |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
206
diff
changeset
|
803 gtk_signal_connect(GTK_OBJECT(select_font), "clicked", GTK_SIGNAL_FUNC(show_font_dialog), NULL); |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
804 if (!(font_options & OPT_FONT_FACE)) |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
805 gtk_widget_set_sensitive(GTK_WIDGET(select_font), FALSE); |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
206
diff
changeset
|
806 gtk_widget_show(select_font); |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
807 gtk_signal_connect(GTK_OBJECT(font_face_for_text), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select_font); |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
808 |
1 | 809 gtk_widget_show(appearance_page); |
810 gtk_widget_show(fontbox); | |
811 gtk_widget_show(fontframe); | |
812 gtk_widget_show(appbox); | |
813 | |
814 | |
815 /* Buddy Chats */ | |
816 chat_page = gtk_vbox_new(FALSE, 0); | |
817 label = gtk_label_new("Buddy Chats"); | |
818 | |
819 gtk_widget_show(label); | |
820 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), chat_page, label); | |
821 | |
822 do_chat_page(chat_page); | |
823 gtk_widget_show(chat_page); | |
824 | |
825 bbox = gtk_hbox_new(FALSE, 5); | |
826 close = gtk_button_new_with_label("Close"); | |
827 | |
828 /* Pack the button(s) in the button box */ | |
829 gtk_box_pack_end(GTK_BOX(bbox), close, FALSE, FALSE, 5); | |
830 gtk_box_pack_start(GTK_BOX(vbox),bbox, FALSE, FALSE, 5); | |
831 | |
832 gtk_widget_show(notebook); | |
833 gtk_widget_show(close); | |
834 | |
835 gtk_widget_show(bbox); | |
836 gtk_widget_show(vbox); | |
837 | |
838 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(handle_delete), NULL); | |
839 gtk_signal_connect(GTK_OBJECT(pd->window),"delete_event", GTK_SIGNAL_FUNC(handle_delete), NULL); | |
840 | |
841 } | |
842 | |
843 void show_prefs() | |
844 { | |
845 if (!pd || !pd->window) | |
846 build_prefs(); | |
847 gtk_widget_show(pd->window); | |
848 } | |
849 void add_chat(GtkWidget *w, struct chat_page *cp) | |
850 { | |
851 GList *sel = GTK_LIST(cp->list1)->selection; | |
852 struct chat_room *cr, *cr2; | |
853 GList *crs = chat_rooms; | |
854 GtkWidget *item; | |
855 | |
856 if (sel) { | |
857 cr = (struct chat_room *)gtk_object_get_user_data(GTK_OBJECT(sel->data)); | |
858 } else | |
859 return; | |
860 | |
861 while(crs) { | |
862 cr2 = (struct chat_room *)crs->data; | |
863 if (!strcasecmp(cr->name, cr2->name)) | |
864 return; | |
865 crs = crs->next; | |
866 } | |
867 item = gtk_list_item_new_with_label(cr->name); | |
868 cr2 = g_new0(struct chat_room, 1); | |
869 strcpy(cr2->name, cr->name); | |
870 cr2->exchange = cr->exchange; | |
871 gtk_object_set_user_data(GTK_OBJECT(item), cr2); | |
872 gtk_widget_show(item); | |
873 sel = g_list_append(NULL, item); | |
874 gtk_list_append_items(GTK_LIST(cp->list2), sel); | |
875 chat_rooms = g_list_append(chat_rooms, cr2); | |
876 | |
877 setup_buddy_chats(); | |
878 save_prefs(); | |
879 | |
880 | |
881 } | |
882 | |
883 void remove_chat(GtkWidget *w, struct chat_page *cp) | |
884 { | |
885 GList *sel = GTK_LIST(cp->list2)->selection; | |
886 struct chat_room *cr; | |
887 GList *crs; | |
888 GtkWidget *item; | |
889 | |
890 if (sel) { | |
891 item = (GtkWidget *)sel->data; | |
892 cr = (struct chat_room *)gtk_object_get_user_data(GTK_OBJECT(item)); | |
893 } else | |
894 return; | |
895 | |
896 chat_rooms = g_list_remove(chat_rooms, cr); | |
897 | |
898 | |
899 gtk_list_clear_items(GTK_LIST(cp->list2), 0, -1); | |
900 | |
901 if (g_list_length(chat_rooms) == 0) | |
902 chat_rooms = NULL; | |
903 | |
904 crs = chat_rooms; | |
905 | |
906 while(crs) { | |
907 cr = (struct chat_room *)crs->data; | |
908 item = gtk_list_item_new_with_label(cr->name); | |
909 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
910 gtk_widget_show(item); | |
911 gtk_list_append_items(GTK_LIST(cp->list2), g_list_append(NULL, item)); | |
912 | |
913 | |
914 crs = crs->next; | |
915 } | |
916 | |
917 setup_buddy_chats(); | |
918 save_prefs(); | |
919 } | |
920 | |
921 void refresh_list(GtkWidget *w, struct chat_page *cp) | |
922 { | |
923 char *text = grab_url("http://www.aol.com/community/chat/allchats.html"); | |
924 char *c; | |
925 int len = strlen(text); | |
926 GtkWidget *item; | |
927 GList *items = GTK_LIST(cp->list1)->children; | |
928 struct chat_room *cr; | |
929 c = text; | |
930 | |
931 while(items) { | |
932 g_free(gtk_object_get_user_data(GTK_OBJECT(items->data))); | |
933 items = items->next; | |
934 } | |
935 | |
936 items = NULL; | |
937 | |
938 gtk_list_clear_items(GTK_LIST(cp->list1), 0, -1); | |
939 | |
940 item = gtk_list_item_new_with_label("Gaim Chat"); | |
941 cr = g_new0(struct chat_room, 1); | |
942 strcpy(cr->name, "Gaim Chat"); | |
943 cr->exchange = 4; | |
944 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
945 gtk_widget_show(item); | |
946 | |
947 items = g_list_append(NULL, item); | |
948 | |
949 while(c) { | |
950 if (c - text > len - 30) | |
951 break; /* assume no chat rooms 30 from end, padding */ | |
952 if (!strncasecmp(AOL_SRCHSTR, c, strlen(AOL_SRCHSTR))) { | |
953 char *t; | |
954 int len=0; | |
955 int exchange; | |
956 char *name = NULL; | |
957 | |
958 c += strlen(AOL_SRCHSTR); | |
959 t = c; | |
960 while(t) { | |
961 len++; | |
962 name = g_realloc(name, len); | |
963 if (*t == '+') | |
964 name[len - 1] = ' '; | |
965 else if (*t == '&') { | |
966 name[len - 1] = 0; | |
967 sscanf(t, "&Exchange=%d", &exchange); | |
968 c = t + strlen("&Exchange=x"); | |
969 break; | |
970 } else | |
971 name[len - 1] = *t; | |
972 t++; | |
973 } | |
974 cr = g_new0(struct chat_room, 1); | |
975 strcpy(cr->name, name); | |
976 cr->exchange = exchange; | |
977 item = gtk_list_item_new_with_label(name); | |
978 gtk_widget_show(item); | |
979 items = g_list_append(items, item); | |
980 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
981 g_free(name); | |
982 } | |
983 c++; | |
984 } | |
985 gtk_list_append_items(GTK_LIST(cp->list1), items); | |
986 g_free(text); | |
987 } | |
988 | |
989 | |
990 | |
991 void do_chat_page(GtkWidget *page) | |
992 { | |
993 GtkWidget *table; | |
994 GtkWidget *rem_button, *add_button, *ref_button; | |
995 GtkWidget *list1, *list2; | |
996 GtkWidget *label; | |
997 GtkWidget *sw1, *sw2; | |
998 GtkWidget *item; | |
999 struct chat_page *cp = g_new0(struct chat_page, 1); | |
1000 GList *crs = chat_rooms; | |
1001 GList *items = NULL; | |
1002 struct chat_room *cr; | |
1003 | |
1004 table = gtk_table_new(4, 2, FALSE); | |
1005 gtk_widget_show(table); | |
1006 | |
1007 | |
1008 gtk_box_pack_start(GTK_BOX(page), table, TRUE, TRUE, 0); | |
1009 | |
1010 | |
1011 list1 = gtk_list_new(); | |
1012 list2 = gtk_list_new(); | |
1013 sw1 = gtk_scrolled_window_new(NULL, NULL); | |
1014 sw2 = gtk_scrolled_window_new(NULL, NULL); | |
1015 ref_button = gtk_button_new_with_label("Refresh"); | |
1016 add_button = gtk_button_new_with_label("Add"); | |
1017 rem_button = gtk_button_new_with_label("Remove"); | |
1018 gtk_widget_show(list1); | |
1019 gtk_widget_show(sw1); | |
1020 gtk_widget_show(list2); | |
1021 gtk_widget_show(sw2); | |
1022 gtk_widget_show(ref_button); | |
1023 gtk_widget_show(add_button); | |
1024 gtk_widget_show(rem_button); | |
1025 | |
1026 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw1), list1); | |
1027 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), list2); | |
1028 | |
1029 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw1), | |
1030 GTK_POLICY_AUTOMATIC,GTK_POLICY_ALWAYS); | |
1031 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), | |
1032 GTK_POLICY_AUTOMATIC,GTK_POLICY_ALWAYS); | |
1033 | |
1034 cp->list1 = list1; | |
1035 cp->list2 = list2; | |
1036 | |
1037 gtk_signal_connect(GTK_OBJECT(ref_button), "clicked", | |
1038 GTK_SIGNAL_FUNC(refresh_list), cp); | |
1039 gtk_signal_connect(GTK_OBJECT(rem_button), "clicked", | |
1040 GTK_SIGNAL_FUNC(remove_chat), cp); | |
1041 gtk_signal_connect(GTK_OBJECT(add_button), "clicked", | |
1042 GTK_SIGNAL_FUNC(add_chat), cp); | |
1043 | |
1044 | |
1045 | |
1046 label = gtk_label_new("List of available chats"); | |
1047 gtk_widget_show(label); | |
1048 | |
1049 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, | |
1050 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
1051 gtk_table_attach(GTK_TABLE(table), ref_button, 0, 1, 1, 2, | |
1052 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
1053 gtk_table_attach(GTK_TABLE(table), sw1, 0, 1, 2, 3, | |
1054 GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, | |
1055 5, 5); | |
1056 gtk_table_attach(GTK_TABLE(table), add_button, 0, 1, 3, 4, | |
1057 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
1058 | |
1059 | |
1060 label = gtk_label_new("List of subscribed chats"); | |
1061 gtk_widget_show(label); | |
1062 | |
1063 gtk_table_attach(GTK_TABLE(table), label, 1, 2, 0, 1, | |
1064 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
1065 gtk_table_attach(GTK_TABLE(table), sw2, 1, 2, 2, 3, | |
1066 GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, | |
1067 5, 5); | |
1068 gtk_table_attach(GTK_TABLE(table), rem_button, 1, 2, 3, 4, | |
1069 GTK_SHRINK, GTK_SHRINK, 0, 0); | |
1070 | |
1071 | |
1072 item = gtk_list_item_new_with_label("Gaim Chat"); | |
1073 cr = g_new0(struct chat_room, 1); | |
1074 strcpy(cr->name, "Gaim Chat"); | |
1075 cr->exchange = 4; | |
1076 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
1077 gtk_widget_show(item); | |
1078 gtk_list_append_items(GTK_LIST(list1), g_list_append(NULL, item)); | |
1079 | |
1080 | |
1081 while(crs) { | |
1082 cr = (struct chat_room *)crs->data; | |
1083 item = gtk_list_item_new_with_label(cr->name); | |
1084 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
1085 gtk_widget_show(item); | |
1086 items = g_list_append(items, item); | |
1087 | |
1088 crs = crs->next; | |
1089 } | |
1090 | |
1091 gtk_list_append_items(GTK_LIST(list2), items); | |
1092 } | |
1093 | |
1094 | |
1095 | |
1096 | |
1097 | |
1098 void debug_print(char *chars) | |
1099 { | |
18 | 1100 if(general_options & OPT_GEN_DEBUG && dw) |
1 | 1101 gtk_text_insert(GTK_TEXT(dw->entry),NULL, NULL, NULL, chars, strlen(chars)); |
1102 #ifdef DEBUG | |
1103 printf("%s\n", chars); | |
1104 #endif | |
1105 } | |
1106 | |
1107 | |
1108 void build_debug() | |
1109 { | |
1110 GtkWidget *scroll; | |
1111 GtkWidget *box; | |
1112 if (!dw) | |
1113 dw = g_new0(struct debug_window, 1); | |
1114 | |
1115 box = gtk_hbox_new(FALSE,0); | |
1116 dw->window = gtk_window_new(GTK_WINDOW_DIALOG); | |
1117 gtk_window_set_title(GTK_WINDOW(dw->window), "GAIM debug output window"); | |
1118 gtk_container_add(GTK_CONTAINER(dw->window), box); | |
1119 dw->entry = gtk_text_new(NULL,NULL); | |
1120 gtk_widget_set_usize(dw->entry, 500, 200); | |
1121 scroll = gtk_vscrollbar_new(GTK_TEXT(dw->entry)->vadj); | |
1122 gtk_box_pack_start(GTK_BOX(box), dw->entry, TRUE,TRUE,0); | |
1123 gtk_box_pack_end(GTK_BOX(box), scroll,FALSE,FALSE,0); | |
1124 gtk_widget_show(dw->entry); | |
1125 gtk_widget_show(scroll); | |
1126 gtk_widget_show(box); | |
1127 gtk_signal_connect(GTK_OBJECT(dw->window),"delete_event", GTK_SIGNAL_FUNC(debug_delete), NULL); | |
1128 gtk_widget_show(dw->window); | |
1129 } | |
1130 | |
1131 | |
1132 | |
1133 void show_debug(GtkObject * object) | |
1134 { | |
1135 if((general_options & OPT_GEN_DEBUG)) { | |
1136 if(!dw || !dw->window) | |
1137 build_debug(); | |
1138 gtk_widget_show(dw->window); | |
1139 } else { | |
171
789c792ed14b
[gaim-migrate @ 181]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
150
diff
changeset
|
1140 if (!dw) return; |
1 | 1141 gtk_widget_destroy(dw->window); |
1142 dw->window = NULL; | |
1143 } | |
1144 } | |
1145 |