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