comparison src/prefs.c @ 5314:1f901484599d

[gaim-migrate @ 5686] GTK_OBJECT -> G_OBJECT Also fixed a few compiler warnings. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 06 May 2003 05:48:03 +0000
parents d4c9c5491812
children c54cb8f8655f
comparison
equal deleted inserted replaced
5313:8d118c2b03c9 5314:1f901484599d
36 #include <gtk/gtk.h> 36 #include <gtk/gtk.h>
37 #include "gtkimhtml.h" 37 #include "gtkimhtml.h"
38 #include "gaim.h" 38 #include "gaim.h"
39 #include "gtkblist.h" 39 #include "gtkblist.h"
40 #include "gtkplugin.h" 40 #include "gtkplugin.h"
41 #include "gtkdebug.h"
41 #include "prpl.h" 42 #include "prpl.h"
42 #include "proxy.h" 43 #include "proxy.h"
43 #include "sound.h" 44 #include "sound.h"
44 45
45 #ifdef _WIN32 46 #ifdef _WIN32
464 gtk_size_group_add_widget(sg, button); 465 gtk_size_group_add_widget(sg, button);
465 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); 466 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT);
466 467
467 if (!(font_options & OPT_FONT_FACE)) 468 if (!(font_options & OPT_FONT_FACE))
468 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); 469 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
469 g_signal_connect(GTK_OBJECT(button), "clicked", 470 g_signal_connect(G_OBJECT(button), "clicked",
470 G_CALLBACK(gaim_gtk_toggle_sensitive), select); 471 G_CALLBACK(gaim_gtk_toggle_sensitive), select);
471 g_signal_connect(GTK_OBJECT(select), "clicked", 472 g_signal_connect(G_OBJECT(select), "clicked",
472 G_CALLBACK(show_font_dialog), NULL); 473 G_CALLBACK(show_font_dialog), NULL);
473 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); 474 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0);
474 475
475 hbox = gtk_hbox_new(FALSE, 5); 476 hbox = gtk_hbox_new(FALSE, 5);
476 gtk_container_add(GTK_CONTAINER(vbox), hbox); 477 gtk_container_add(GTK_CONTAINER(vbox), hbox);
477 button = gaim_button(_("Use custom si_ze"), &font_options, OPT_FONT_SIZE, hbox); 478 button = gaim_button(_("Use custom si_ze"), &font_options, OPT_FONT_SIZE, hbox);
478 gtk_size_group_add_widget(sg, button); 479 gtk_size_group_add_widget(sg, button);
479 select = gaim_labeled_spin_button(hbox, NULL, &fontsize, 1, 7, NULL); 480 select = gaim_labeled_spin_button(hbox, NULL, &fontsize, 1, 7, NULL);
480 if (!(font_options & OPT_FONT_SIZE)) 481 if (!(font_options & OPT_FONT_SIZE))
481 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); 482 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
482 g_signal_connect(GTK_OBJECT(button), "clicked", 483 g_signal_connect(G_OBJECT(button), "clicked",
483 G_CALLBACK(gaim_gtk_toggle_sensitive), select); 484 G_CALLBACK(gaim_gtk_toggle_sensitive), select);
484 485
485 vbox = make_frame(ret, _("Color")); 486 vbox = make_frame(ret, _("Color"));
486 hbox = gtk_hbox_new(FALSE, 5); 487 hbox = gtk_hbox_new(FALSE, 5);
487 gtk_container_add(GTK_CONTAINER(vbox), hbox); 488 gtk_container_add(GTK_CONTAINER(vbox), hbox);
491 gtk_size_group_add_widget(sg, button); 492 gtk_size_group_add_widget(sg, button);
492 493
493 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); 494 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR);
494 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); 495 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0);
495 pref_fg_picture = show_color_pref(hbox, TRUE); 496 pref_fg_picture = show_color_pref(hbox, TRUE);
496 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), 497 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(update_color),
497 pref_fg_picture); 498 pref_fg_picture);
498 499
499 if (!(font_options & OPT_FONT_FGCOL)) 500 if (!(font_options & OPT_FONT_FGCOL))
500 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); 501 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
501 g_signal_connect(GTK_OBJECT(button), "clicked", 502 g_signal_connect(G_OBJECT(button), "clicked",
502 G_CALLBACK(gaim_gtk_toggle_sensitive), select); 503 G_CALLBACK(gaim_gtk_toggle_sensitive), select);
503 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_fgcolor_dialog), NULL); 504 g_signal_connect(G_OBJECT(select), "clicked", G_CALLBACK(show_fgcolor_dialog), NULL);
504 hbox = gtk_hbox_new(FALSE, 5); 505 hbox = gtk_hbox_new(FALSE, 5);
505 gtk_container_add(GTK_CONTAINER(vbox), hbox); 506 gtk_container_add(GTK_CONTAINER(vbox), hbox);
506 507
507 button = gaim_button(_("Bac_kground color"), &font_options, OPT_FONT_BGCOL, hbox); 508 button = gaim_button(_("Bac_kground color"), &font_options, OPT_FONT_BGCOL, hbox);
508 gtk_size_group_add_widget(sg, button); 509 gtk_size_group_add_widget(sg, button);
509 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); 510 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR);
510 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); 511 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0);
511 pref_bg_picture = show_color_pref(hbox, FALSE); 512 pref_bg_picture = show_color_pref(hbox, FALSE);
512 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), 513 g_signal_connect(G_OBJECT(button), "clicked",
513 pref_bg_picture); 514 G_CALLBACK(update_color), pref_bg_picture);
514 515
515 if (!(font_options & OPT_FONT_BGCOL)) 516 if (!(font_options & OPT_FONT_BGCOL))
516 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); 517 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
517 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_bgcolor_dialog), NULL); 518 g_signal_connect(G_OBJECT(select), "clicked",
518 g_signal_connect(GTK_OBJECT(button), "clicked", 519 G_CALLBACK(show_bgcolor_dialog), NULL);
520 g_signal_connect(G_OBJECT(button), "clicked",
519 G_CALLBACK(gaim_gtk_toggle_sensitive), select); 521 G_CALLBACK(gaim_gtk_toggle_sensitive), select);
520 522
521 gtk_widget_show_all(ret); 523 gtk_widget_show_all(ret);
522 return ret; 524 return ret;
523 } 525 }
591 vbox = make_frame (ret, _("Buddy Display")); 593 vbox = make_frame (ret, _("Buddy Display"));
592 button = gaim_button(_("Show buddy _icons"), &blist_options, OPT_BLIST_SHOW_ICONS, vbox); 594 button = gaim_button(_("Show buddy _icons"), &blist_options, OPT_BLIST_SHOW_ICONS, vbox);
593 b2 = gaim_button(_("Show _warning levels"), &blist_options, OPT_BLIST_SHOW_WARN, vbox); 595 b2 = gaim_button(_("Show _warning levels"), &blist_options, OPT_BLIST_SHOW_WARN, vbox);
594 if (blist_options & OPT_BLIST_SHOW_ICONS) 596 if (blist_options & OPT_BLIST_SHOW_ICONS)
595 gtk_widget_set_sensitive(GTK_WIDGET(b2), FALSE); 597 gtk_widget_set_sensitive(GTK_WIDGET(b2), FALSE);
596 g_signal_connect(GTK_OBJECT(button), "clicked", 598 g_signal_connect(G_OBJECT(button), "clicked",
597 G_CALLBACK(gaim_gtk_toggle_sensitive), b2); 599 G_CALLBACK(gaim_gtk_toggle_sensitive), b2);
598 b2 = gaim_button(_("Show idle _times"), &blist_options, OPT_BLIST_SHOW_IDLETIME, vbox); 600 b2 = gaim_button(_("Show idle _times"), &blist_options, OPT_BLIST_SHOW_IDLETIME, vbox);
599 if (blist_options & OPT_BLIST_SHOW_ICONS) 601 if (blist_options & OPT_BLIST_SHOW_ICONS)
600 gtk_widget_set_sensitive(GTK_WIDGET(b2), FALSE); 602 gtk_widget_set_sensitive(GTK_WIDGET(b2), FALSE);
601 g_signal_connect(GTK_OBJECT(button), "clicked", 603 g_signal_connect(G_OBJECT(button), "clicked",
602 G_CALLBACK(gaim_gtk_toggle_sensitive), b2); 604 G_CALLBACK(gaim_gtk_toggle_sensitive), b2);
603 gaim_button(_("Dim i_dle buddies"), &blist_options, OPT_BLIST_GREY_IDLERS, vbox); 605 gaim_button(_("Dim i_dle buddies"), &blist_options, OPT_BLIST_GREY_IDLERS, vbox);
604 606
605 gtk_widget_show_all(ret); 607 gtk_widget_show_all(ret);
606 return ret; 608 return ret;
607 } 609 }
797 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); 799 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
798 800
799 entry = gtk_entry_new(); 801 entry = gtk_entry_new();
800 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); 802 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
801 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); 803 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
802 g_signal_connect(GTK_OBJECT(entry), "changed", 804 g_signal_connect(G_OBJECT(entry), "changed",
803 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); 805 G_CALLBACK(proxy_print_option), (void *)PROXYHOST);
804 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxyhost); 806 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxyhost);
805 807
806 hbox = gtk_hbox_new(TRUE, 5); 808 hbox = gtk_hbox_new(TRUE, 5);
807 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); 809 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
808 810
811 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); 813 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
812 814
813 entry = gtk_entry_new(); 815 entry = gtk_entry_new();
814 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); 816 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
815 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); 817 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0);
816 g_signal_connect(GTK_OBJECT(entry), "changed", 818 g_signal_connect(G_OBJECT(entry), "changed",
817 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); 819 G_CALLBACK(proxy_print_option), (void *)PROXYPORT);
818 820
819 if (global_proxy_info.proxyport) { 821 if (global_proxy_info.proxyport) {
820 char buf[128]; 822 char buf[128];
821 g_snprintf(buf, sizeof(buf), "%d", global_proxy_info.proxyport); 823 g_snprintf(buf, sizeof(buf), "%d", global_proxy_info.proxyport);
822 gtk_entry_set_text(GTK_ENTRY(entry), buf); 824 gtk_entry_set_text(GTK_ENTRY(entry), buf);
827 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); 829 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0);
828 830
829 entry = gtk_entry_new(); 831 entry = gtk_entry_new();
830 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); 832 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
831 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); 833 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0);
832 g_signal_connect(GTK_OBJECT(entry), "changed", 834 g_signal_connect(G_OBJECT(entry), "changed",
833 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); 835 G_CALLBACK(proxy_print_option), (void *)PROXYUSER);
834 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxyuser); 836 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxyuser);
835 837
836 hbox = gtk_hbox_new(TRUE, 5); 838 hbox = gtk_hbox_new(TRUE, 5);
837 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); 839 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
838 840
842 844
843 entry = gtk_entry_new(); 845 entry = gtk_entry_new();
844 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); 846 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
845 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, GTK_FILL , 0, 0, 0); 847 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, GTK_FILL , 0, 0, 0);
846 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); 848 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
847 g_signal_connect(GTK_OBJECT(entry), "changed", 849 g_signal_connect(G_OBJECT(entry), "changed",
848 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); 850 G_CALLBACK(proxy_print_option), (void *)PROXYPASS);
849 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxypass); 851 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxypass);
850 852
851 gtk_widget_show_all(ret); 853 gtk_widget_show_all(ret);
852 return ret; 854 return ret;
853 } 855 }
1043 gtk_entry_set_text(GTK_ENTRY(sndcmd), cmd); 1045 gtk_entry_set_text(GTK_ENTRY(sndcmd), cmd);
1044 gtk_widget_set_size_request(sndcmd, 75, -1); 1046 gtk_widget_set_size_request(sndcmd, 75, -1);
1045 1047
1046 gtk_widget_set_sensitive(sndcmd, (sound_options & OPT_SOUND_CMD)); 1048 gtk_widget_set_sensitive(sndcmd, (sound_options & OPT_SOUND_CMD));
1047 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); 1049 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5);
1048 g_signal_connect(GTK_OBJECT(sndcmd), "changed", G_CALLBACK(sound_cmd_yeah), NULL); 1050 g_signal_connect(G_OBJECT(sndcmd), "changed",
1051 G_CALLBACK(sound_cmd_yeah), NULL);
1049 #endif /* _WIN32 */ 1052 #endif /* _WIN32 */
1050 gtk_widget_show_all(ret); 1053 gtk_widget_show_all(ret);
1051 return ret; 1054 return ret;
1052 } 1055 }
1053 1056
1100 vbox = make_frame (ret, _("Auto-away")); 1103 vbox = make_frame (ret, _("Auto-away"));
1101 button = gaim_button(_("Set away _when idle"), &away_options, OPT_AWAY_AUTO, vbox); 1104 button = gaim_button(_("Set away _when idle"), &away_options, OPT_AWAY_AUTO, vbox);
1102 select = gaim_labeled_spin_button(vbox, _("_Minutes before setting away:"), &auto_away, 1, 24 * 60, sg); 1105 select = gaim_labeled_spin_button(vbox, _("_Minutes before setting away:"), &auto_away, 1, 24 * 60, sg);
1103 if (!(away_options & OPT_AWAY_AUTO)) 1106 if (!(away_options & OPT_AWAY_AUTO))
1104 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); 1107 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
1105 g_signal_connect(GTK_OBJECT(button), "clicked", 1108 g_signal_connect(G_OBJECT(button), "clicked",
1106 G_CALLBACK(gaim_gtk_toggle_sensitive), select); 1109 G_CALLBACK(gaim_gtk_toggle_sensitive), select);
1107 1110
1108 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); 1111 label = gtk_label_new_with_mnemonic(_("Away m_essage:"));
1109 gtk_size_group_add_widget(sg, label); 1112 gtk_size_group_add_widget(sg, label);
1110 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); 1113 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
1113 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); 1116 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
1114 prefs_away_menu = gtk_option_menu_new(); 1117 prefs_away_menu = gtk_option_menu_new();
1115 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); 1118 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu);
1116 if (!(away_options & OPT_AWAY_AUTO)) 1119 if (!(away_options & OPT_AWAY_AUTO))
1117 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); 1120 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE);
1118 g_signal_connect(GTK_OBJECT(button), "clicked", 1121 g_signal_connect(G_OBJECT(button), "clicked",
1119 G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu); 1122 G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu);
1120 default_away_menu_init(prefs_away_menu); 1123 default_away_menu_init(prefs_away_menu);
1121 gtk_widget_show(prefs_away_menu); 1124 gtk_widget_show(prefs_away_menu);
1122 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); 1125 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0);
1123 1126
1498 1501
1499 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S, last_sound_dir ? last_sound_dir : gaim_home_dir()); 1502 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S, last_sound_dir ? last_sound_dir : gaim_home_dir());
1500 1503
1501 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); 1504 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf);
1502 1505
1503 g_signal_connect(GTK_OBJECT(sounddialog), "destroy", 1506 g_signal_connect(G_OBJECT(sounddialog), "destroy",
1504 G_CALLBACK(close_sounddialog), sounddialog); 1507 G_CALLBACK(close_sounddialog), sounddialog);
1505 1508
1506 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), 1509 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button),
1507 "clicked", G_CALLBACK(do_select_sound), (int *)sound_row_sel); 1510 "clicked",
1508 1511 G_CALLBACK(do_select_sound), (int *)sound_row_sel);
1509 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button), 1512
1510 "clicked", G_CALLBACK(close_sounddialog), sounddialog); 1513 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button),
1514 "clicked",
1515 G_CALLBACK(close_sounddialog), sounddialog);
1511 } 1516 }
1512 1517
1513 g_free(buf); 1518 g_free(buf);
1514 gtk_widget_show(sounddialog); 1519 gtk_widget_show(sounddialog);
1515 gdk_window_raise(sounddialog->window); 1520 gdk_window_raise(sounddialog->window);
1605 gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)"); 1610 gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)");
1606 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); 1611 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE);
1607 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5); 1612 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5);
1608 1613
1609 button = gtk_button_new_with_label(_("Test")); 1614 button = gtk_button_new_with_label(_("Test"));
1610 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); 1615 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL);
1611 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); 1616 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
1612 1617
1613 button = gtk_button_new_with_label(_("Reset")); 1618 button = gtk_button_new_with_label(_("Reset"));
1614 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); 1619 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL);
1615 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); 1620 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
1616 1621
1617 button = gtk_button_new_with_label(_("Choose...")); 1622 button = gtk_button_new_with_label(_("Choose..."));
1618 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(sel_sound), NULL); 1623 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(sel_sound), NULL);
1619 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); 1624 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
1620 1625
1621 gtk_widget_show_all (ret); 1626 gtk_widget_show_all (ret);
1622 1627
1623 return ret; 1628 return ret;
1726 hbox = gtk_hbox_new(TRUE, 5); 1731 hbox = gtk_hbox_new(TRUE, 5);
1727 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); 1732 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0);
1728 button = gtk_button_new_from_stock (GTK_STOCK_ADD); 1733 button = gtk_button_new_from_stock (GTK_STOCK_ADD);
1729 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); 1734 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
1730 gtk_size_group_add_widget(sg, button); 1735 gtk_size_group_add_widget(sg, button);
1731 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(create_away_mess), NULL); 1736 g_signal_connect(G_OBJECT(button), "clicked",
1737 G_CALLBACK(create_away_mess), NULL);
1732 1738
1733 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); 1739 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
1734 gtk_size_group_add_widget(sg, button); 1740 gtk_size_group_add_widget(sg, button);
1735 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(remove_away_message), event_view); 1741 g_signal_connect(G_OBJECT(button), "clicked",
1742 G_CALLBACK(remove_away_message), event_view);
1736 1743
1737 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); 1744 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
1738 1745
1739 button = gaim_pixbuf_button_from_stock(_("_Edit"), GAIM_STOCK_EDIT, GAIM_BUTTON_HORIZONTAL); 1746 button = gaim_pixbuf_button_from_stock(_("_Edit"), GAIM_STOCK_EDIT, GAIM_BUTTON_HORIZONTAL);
1740 gtk_size_group_add_widget(sg, button); 1747 gtk_size_group_add_widget(sg, button);
1741 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(create_away_mess), event_view); 1748 g_signal_connect(G_OBJECT(button), "clicked",
1749 G_CALLBACK(create_away_mess), event_view);
1742 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); 1750 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
1743 1751
1744 gtk_widget_show_all(ret); 1752 gtk_widget_show_all(ret);
1745 return ret; 1753 return ret;
1746 } 1754 }
1843 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); 1851 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL);
1844 gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); 1852 gtk_window_set_role(GTK_WINDOW(prefs), "preferences");
1845 gtk_widget_realize(prefs); 1853 gtk_widget_realize(prefs);
1846 gtk_window_set_title(GTK_WINDOW(prefs), _("Preferences")); 1854 gtk_window_set_title(GTK_WINDOW(prefs), _("Preferences"));
1847 gtk_window_set_resizable (GTK_WINDOW(prefs), FALSE); 1855 gtk_window_set_resizable (GTK_WINDOW(prefs), FALSE);
1848 g_signal_connect(GTK_OBJECT(prefs), "destroy", G_CALLBACK(delete_prefs), NULL); 1856 g_signal_connect(G_OBJECT(prefs), "destroy",
1857 G_CALLBACK(delete_prefs), NULL);
1849 1858
1850 vbox = gtk_vbox_new(FALSE, 5); 1859 vbox = gtk_vbox_new(FALSE, 5);
1851 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); 1860 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
1852 gtk_container_add(GTK_CONTAINER(prefs), vbox); 1861 gtk_container_add(GTK_CONTAINER(prefs), vbox);
1853 gtk_widget_show(vbox); 1862 gtk_widget_show(vbox);
1926 gtk_container_add (GTK_CONTAINER(vbox), hbox); 1935 gtk_container_add (GTK_CONTAINER(vbox), hbox);
1927 gtk_widget_show (hbox); 1936 gtk_widget_show (hbox);
1928 1937
1929 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); 1938 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
1930 gtk_size_group_add_widget(sg, button); 1939 gtk_size_group_add_widget(sg, button);
1931 g_signal_connect_swapped(GTK_OBJECT(button), "clicked", G_CALLBACK(gtk_widget_destroy), prefs); 1940 g_signal_connect_swapped(G_OBJECT(button), "clicked",
1941 G_CALLBACK(gtk_widget_destroy), prefs);
1932 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); 1942 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
1933 gtk_widget_show(button); 1943 gtk_widget_show(button);
1934 1944
1935 prefs_notebook_init(); 1945 prefs_notebook_init();
1936 1946
2066 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), (*options & option)); 2076 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), (*options & option));
2067 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); 2077 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0);
2068 g_object_set_data(G_OBJECT(button), "options", options); 2078 g_object_set_data(G_OBJECT(button), "options", options);
2069 2079
2070 if (options == &misc_options) { 2080 if (options == &misc_options) {
2071 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_misc_option), 2081 g_signal_connect(G_OBJECT(button), "clicked",
2072 (int *)option); 2082 G_CALLBACK(set_misc_option), (int *)option);
2073 } else if (options == &logging_options) { 2083 } else if (options == &logging_options) {
2074 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_logging_option), 2084 g_signal_connect(G_OBJECT(button), "clicked",
2075 (int *)option); 2085 G_CALLBACK(set_logging_option), (int *)option);
2076 } else if (options == &blist_options) { 2086 } else if (options == &blist_options) {
2077 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_blist_option), 2087 g_signal_connect(G_OBJECT(button), "clicked",
2078 (int *)option); 2088 G_CALLBACK(set_blist_option), (int *)option);
2079 } else if (options == &convo_options) { 2089 } else if (options == &convo_options) {
2080 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_convo_option), 2090 g_signal_connect(G_OBJECT(button), "clicked",
2081 (int *)option); 2091 G_CALLBACK(set_convo_option), (int *)option);
2082 } else if (options == &im_options) { 2092 } else if (options == &im_options) {
2083 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_im_option), 2093 g_signal_connect(G_OBJECT(button), "clicked",
2084 (int *)option); 2094 G_CALLBACK(set_im_option), (int *)option);
2085 } else if (options == &chat_options) { 2095 } else if (options == &chat_options) {
2086 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_chat_option), 2096 g_signal_connect(G_OBJECT(button), "clicked",
2087 (int *)option); 2097 G_CALLBACK(set_chat_option), (int *)option);
2088 } else if (options == &font_options) { 2098 } else if (options == &font_options) {
2089 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_font_option), 2099 g_signal_connect(G_OBJECT(button), "clicked",
2090 (int *)option); 2100 G_CALLBACK(set_font_option), (int *)option);
2091 } else if (options == &sound_options) { 2101 } else if (options == &sound_options) {
2092 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_sound_option), 2102 g_signal_connect(G_OBJECT(button), "clicked",
2093 (int *)option); 2103 G_CALLBACK(set_sound_option), (int *)option);
2094 } else if (options == &away_options) { 2104 } else if (options == &away_options) {
2095 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_away_option), 2105 g_signal_connect(G_OBJECT(button), "clicked",
2096 (int *)option); 2106 G_CALLBACK(set_away_option), (int *)option);
2097 } else { 2107 } else {
2098 gaim_debug(GAIM_DEBUG_WARNING, "gaim_button", 2108 gaim_debug(GAIM_DEBUG_WARNING, "gaim_button",
2099 "\"%s\" has no signal handler attached to it!\n", text); 2109 "\"%s\" has no signal handler attached to it!\n", text);
2100 } 2110 }
2101 gtk_widget_show(button); 2111 gtk_widget_show(button);
2113 menu = gtk_menu_new(); 2123 menu = gtk_menu_new();
2114 2124
2115 while (awy) { 2125 while (awy) {
2116 a = (struct away_message *)awy->data; 2126 a = (struct away_message *)awy->data;
2117 opt = gtk_menu_item_new_with_label(a->name); 2127 opt = gtk_menu_item_new_with_label(a->name);
2118 g_signal_connect(GTK_OBJECT(opt), "activate", G_CALLBACK(set_default_away), 2128 g_signal_connect(G_OBJECT(opt), "activate",
2119 (gpointer)index); 2129 G_CALLBACK(set_default_away), (gpointer)index);
2120 gtk_widget_show(opt); 2130 gtk_widget_show(opt);
2121 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); 2131 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt);
2122 2132
2123 awy = awy->next; 2133 awy = awy->next;
2124 index++; 2134 index++;
2266 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1); 2276 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1);
2267 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); 2277 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0);
2268 g_object_set_data(G_OBJECT(spin), "val", val); 2278 g_object_set_data(G_OBJECT(spin), "val", val);
2269 gtk_widget_set_size_request(spin, 50, -1); 2279 gtk_widget_set_size_request(spin, 50, -1);
2270 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); 2280 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0);
2271 g_signal_connect(GTK_OBJECT(adjust), "value-changed", 2281 g_signal_connect(G_OBJECT(adjust), "value-changed",
2272 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); 2282 G_CALLBACK(update_spin_value), GTK_WIDGET(spin));
2273 gtk_widget_show(spin); 2283 gtk_widget_show(spin);
2274 2284
2275 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); 2285 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin);
2276 2286
2277 if (sg) { 2287 if (sg) {
2389 menuitems = g_list_next(menuitems); 2399 menuitems = g_list_next(menuitems);
2390 2400
2391 opt = gtk_menu_item_new_with_label(text); 2401 opt = gtk_menu_item_new_with_label(text);
2392 g_object_set_data(G_OBJECT(opt), "value", GINT_TO_POINTER(value)); 2402 g_object_set_data(G_OBJECT(opt), "value", GINT_TO_POINTER(value));
2393 g_object_set_data(G_OBJECT(opt), "clear", GINT_TO_POINTER(clear)); 2403 g_object_set_data(G_OBJECT(opt), "clear", GINT_TO_POINTER(clear));
2394 g_signal_connect(GTK_OBJECT(opt), "activate", 2404 g_signal_connect(G_OBJECT(opt), "activate",
2395 G_CALLBACK(dropdown_set), (void *)option); 2405 G_CALLBACK(dropdown_set), (void *)option);
2396 gtk_widget_show(opt); 2406 gtk_widget_show(opt);
2397 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); 2407 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt);
2398 2408
2399 if (((clear > -1) && ((*option & clear) == value)) || *option == value) { 2409 if (((clear > -1) && ((*option & clear) == value)) || *option == value) {
2400 gtk_menu_set_active(GTK_MENU(menu), o); 2410 gtk_menu_set_active(GTK_MENU(menu), o);