Mercurial > pidgin
comparison src/prefs.c @ 253:5b28ef2b550e
[gaim-migrate @ 263]
A few things happened in this update:
- Commented out the libfaim deny/permit list stuff because it's seriously buggy
- Added Socks v4 support
- improved proxy support for things like getting users' info
- i think that's it
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 23 May 2000 05:26:30 +0000 |
parents | 985635758c33 |
children | a88b889b692b |
comparison
equal
deleted
inserted
replaced
252:4a41f8323022 | 253:5b28ef2b550e |
---|---|
211 static int | 211 static int |
212 connection_key_pressed(GtkWidget *w, GdkEvent *event, void *dummy) | 212 connection_key_pressed(GtkWidget *w, GdkEvent *event, void *dummy) |
213 { | 213 { |
214 g_snprintf(aim_host, sizeof(aim_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->aim_host_entry))); | 214 g_snprintf(aim_host, sizeof(aim_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->aim_host_entry))); |
215 sscanf(gtk_entry_get_text(GTK_ENTRY(pd->aim_port_entry)), "%d", &aim_port); | 215 sscanf(gtk_entry_get_text(GTK_ENTRY(pd->aim_port_entry)), "%d", &aim_port); |
216 g_snprintf(proxy_host, sizeof(proxy_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->http_proxy_host_entry))); | 216 if (proxy_type == PROXY_HTTP) { |
217 sscanf(gtk_entry_get_text(GTK_ENTRY(pd->http_proxy_port_entry)), "%d", &proxy_port); | 217 g_snprintf(proxy_host, sizeof(proxy_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->http_proxy_host_entry))); |
218 sscanf(gtk_entry_get_text(GTK_ENTRY(pd->http_proxy_port_entry)), "%d", &proxy_port); | |
219 } else if (proxy_type == PROXY_SOCKS) { | |
220 g_snprintf(proxy_host, sizeof(proxy_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->socks_proxy_host_entry))); | |
221 sscanf(gtk_entry_get_text(GTK_ENTRY(pd->socks_proxy_port_entry)), "%d", &proxy_port); | |
222 } | |
218 | 223 |
219 g_snprintf(login_host, sizeof(login_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->login_host_entry))); | 224 g_snprintf(login_host, sizeof(login_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->login_host_entry))); |
220 sscanf(gtk_entry_get_text(GTK_ENTRY(pd->login_port_entry)), "%d", &login_port); | 225 sscanf(gtk_entry_get_text(GTK_ENTRY(pd->login_port_entry)), "%d", &login_port); |
221 save_prefs(); | 226 save_prefs(); |
222 return TRUE; | 227 return TRUE; |
254 if (proxy_type == PROXY_HTTP) { | 259 if (proxy_type == PROXY_HTTP) { |
255 if (pd->http_proxy_host_entry) | 260 if (pd->http_proxy_host_entry) |
256 gtk_widget_set_sensitive(pd->http_proxy_host_entry, TRUE); | 261 gtk_widget_set_sensitive(pd->http_proxy_host_entry, TRUE); |
257 if (pd->http_proxy_port_entry) | 262 if (pd->http_proxy_port_entry) |
258 gtk_widget_set_sensitive(pd->http_proxy_port_entry, TRUE); | 263 gtk_widget_set_sensitive(pd->http_proxy_port_entry, TRUE); |
259 | 264 if (pd->socks_proxy_host_entry) |
265 gtk_widget_set_sensitive(pd->socks_proxy_host_entry, FALSE); | |
266 if (pd->socks_proxy_port_entry) | |
267 gtk_widget_set_sensitive(pd->socks_proxy_port_entry, FALSE); | |
268 } else if (proxy_type == PROXY_SOCKS) { | |
269 if (pd->socks_proxy_host_entry) | |
270 gtk_widget_set_sensitive(pd->socks_proxy_host_entry, TRUE); | |
271 if (pd->socks_proxy_port_entry) | |
272 gtk_widget_set_sensitive(pd->socks_proxy_port_entry, TRUE); | |
273 if (pd->http_proxy_host_entry) | |
274 gtk_widget_set_sensitive(pd->http_proxy_host_entry, FALSE); | |
275 if (pd->http_proxy_port_entry) | |
276 gtk_widget_set_sensitive(pd->http_proxy_port_entry, FALSE); | |
260 } else { | 277 } else { |
261 if (pd->http_proxy_host_entry) | 278 if (pd->http_proxy_host_entry) |
262 gtk_widget_set_sensitive(pd->http_proxy_host_entry, FALSE); | 279 gtk_widget_set_sensitive(pd->http_proxy_host_entry, FALSE); |
263 if (pd->http_proxy_port_entry) | 280 if (pd->http_proxy_port_entry) |
264 gtk_widget_set_sensitive(pd->http_proxy_port_entry, FALSE); | 281 gtk_widget_set_sensitive(pd->http_proxy_port_entry, FALSE); |
265 | 282 if (pd->socks_proxy_host_entry) |
283 gtk_widget_set_sensitive(pd->socks_proxy_host_entry, FALSE); | |
284 if (pd->socks_proxy_port_entry) | |
285 gtk_widget_set_sensitive(pd->socks_proxy_port_entry, FALSE); | |
266 } | 286 } |
267 | 287 |
268 save_prefs(); | 288 save_prefs(); |
269 } | 289 } |
270 | 290 |
507 gtk_entry_set_text(GTK_ENTRY(pd->http_proxy_host_entry), proxy_host); | 527 gtk_entry_set_text(GTK_ENTRY(pd->http_proxy_host_entry), proxy_host); |
508 | 528 |
509 g_snprintf(buffer, sizeof(buffer), "%d", proxy_port); | 529 g_snprintf(buffer, sizeof(buffer), "%d", proxy_port); |
510 gtk_entry_set_text(GTK_ENTRY(pd->http_proxy_port_entry), buffer); | 530 gtk_entry_set_text(GTK_ENTRY(pd->http_proxy_port_entry), buffer); |
511 | 531 |
532 connectopt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(connectopt)), "SOCKS v4 Proxy"); | |
533 gtk_box_pack_start(GTK_BOX(connection_page), connectopt, FALSE, FALSE, 0); | |
534 gtk_signal_connect(GTK_OBJECT(connectopt), "clicked", GTK_SIGNAL_FUNC(set_connect), (void *)PROXY_SOCKS); | |
535 gtk_widget_show(connectopt); | |
536 if (proxy_type == PROXY_SOCKS) | |
537 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(connectopt), TRUE); | |
538 | |
539 | |
540 hbox = gtk_hbox_new(FALSE, 0); | |
541 label = gtk_label_new("Proxy Host:"); | |
542 gtk_widget_show(label); | |
543 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
544 pd->socks_proxy_host_entry = gtk_entry_new(); | |
545 gtk_widget_show(pd->socks_proxy_host_entry); | |
546 gtk_box_pack_start(GTK_BOX(hbox), pd->socks_proxy_host_entry, FALSE, FALSE, 0); | |
547 | |
548 label = gtk_label_new("Port:"); | |
549 gtk_widget_show(label); | |
550 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
551 pd->socks_proxy_port_entry = gtk_entry_new(); | |
552 gtk_widget_show(pd->socks_proxy_port_entry); | |
553 gtk_box_pack_start(GTK_BOX(hbox), pd->socks_proxy_port_entry, FALSE, FALSE, 0); | |
554 gtk_widget_show(hbox); | |
555 | |
556 gtk_box_pack_start(GTK_BOX(connection_page), hbox, FALSE, FALSE, 0); | |
557 gtk_entry_set_text(GTK_ENTRY(pd->socks_proxy_host_entry), proxy_host); | |
558 | |
559 g_snprintf(buffer, sizeof(buffer), "%d", proxy_port); | |
560 gtk_entry_set_text(GTK_ENTRY(pd->socks_proxy_port_entry), buffer); | |
561 | |
512 | 562 |
513 gtk_widget_show(connection_page); | 563 gtk_widget_show(connection_page); |
514 | 564 |
515 | 565 |
516 if (proxy_type == PROXY_HTTP) { | 566 if (proxy_type == PROXY_HTTP) { |
517 if (pd->http_proxy_host_entry) | 567 if (pd->http_proxy_host_entry) |
518 gtk_widget_set_sensitive(pd->http_proxy_host_entry, TRUE); | 568 gtk_widget_set_sensitive(pd->http_proxy_host_entry, TRUE); |
519 if (pd->http_proxy_port_entry) | 569 if (pd->http_proxy_port_entry) |
520 gtk_widget_set_sensitive(pd->http_proxy_port_entry, TRUE); | 570 gtk_widget_set_sensitive(pd->http_proxy_port_entry, TRUE); |
521 | 571 if (pd->socks_proxy_host_entry) |
572 gtk_widget_set_sensitive(pd->socks_proxy_host_entry, FALSE); | |
573 if (pd->socks_proxy_port_entry) | |
574 gtk_widget_set_sensitive(pd->socks_proxy_port_entry, FALSE); | |
575 } else if (proxy_type == PROXY_SOCKS) { | |
576 if (pd->socks_proxy_host_entry) | |
577 gtk_widget_set_sensitive(pd->socks_proxy_host_entry, TRUE); | |
578 if (pd->socks_proxy_port_entry) | |
579 gtk_widget_set_sensitive(pd->socks_proxy_port_entry, TRUE); | |
580 if (pd->http_proxy_host_entry) | |
581 gtk_widget_set_sensitive(pd->http_proxy_host_entry, FALSE); | |
582 if (pd->http_proxy_port_entry) | |
583 gtk_widget_set_sensitive(pd->http_proxy_port_entry, FALSE); | |
522 } else { | 584 } else { |
523 if (pd->http_proxy_host_entry) | 585 if (pd->http_proxy_host_entry) |
524 gtk_widget_set_sensitive(pd->http_proxy_host_entry, FALSE); | 586 gtk_widget_set_sensitive(pd->http_proxy_host_entry, FALSE); |
525 if (pd->http_proxy_port_entry) | 587 if (pd->http_proxy_port_entry) |
526 gtk_widget_set_sensitive(pd->http_proxy_port_entry, FALSE); | 588 gtk_widget_set_sensitive(pd->http_proxy_port_entry, FALSE); |
527 | 589 if (pd->socks_proxy_host_entry) |
590 gtk_widget_set_sensitive(pd->socks_proxy_host_entry, FALSE); | |
591 if (pd->socks_proxy_port_entry) | |
592 gtk_widget_set_sensitive(pd->socks_proxy_port_entry, FALSE); | |
528 } | 593 } |
529 | 594 |
530 | 595 |
531 | 596 |
532 gtk_signal_connect(GTK_OBJECT(pd->aim_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | 597 gtk_signal_connect(GTK_OBJECT(pd->aim_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); |
533 gtk_signal_connect(GTK_OBJECT(pd->aim_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | 598 gtk_signal_connect(GTK_OBJECT(pd->aim_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); |
534 gtk_signal_connect(GTK_OBJECT(pd->login_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | 599 gtk_signal_connect(GTK_OBJECT(pd->login_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); |
535 gtk_signal_connect(GTK_OBJECT(pd->login_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | 600 gtk_signal_connect(GTK_OBJECT(pd->login_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); |
536 gtk_signal_connect(GTK_OBJECT(pd->http_proxy_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | 601 gtk_signal_connect(GTK_OBJECT(pd->socks_proxy_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); |
537 gtk_signal_connect(GTK_OBJECT(pd->http_proxy_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | 602 gtk_signal_connect(GTK_OBJECT(pd->socks_proxy_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); |
603 gtk_signal_connect(GTK_OBJECT(pd->socks_proxy_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
604 gtk_signal_connect(GTK_OBJECT(pd->socks_proxy_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL); | |
538 | 605 |
539 | 606 |
540 /* Away */ | 607 /* Away */ |
541 | 608 |
542 a = awaymessage; | 609 a = awaymessage; |