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