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