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