Mercurial > pidgin
comparison src/prefs.c @ 2843:87d11d2a7d59
[gaim-migrate @ 2856]
i think we've found our mole
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 04 Dec 2001 07:53:55 +0000 |
parents | c936163f916a |
children | b1e300a85678 |
comparison
equal
deleted
inserted
replaced
2842:cf0f0153e2da | 2843:87d11d2a7d59 |
---|---|
764 } | 764 } |
765 | 765 |
766 static void set_tab_opt(GtkWidget *w, int data) | 766 static void set_tab_opt(GtkWidget *w, int data) |
767 { | 767 { |
768 int mask; | 768 int mask; |
769 if (data & 0x1) { /* set the first bit if we're affecting chat buttons */ | 769 if (convo_options & OPT_CONVO_COMBINE) { |
770 /* through an amazing coincidence (this wasn't planned), we're able to do this, | |
771 * since the two sets of options end up having the same value. isn't that great. */ | |
770 mask = (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB); | 772 mask = (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB); |
771 chat_options &= ~(mask); | 773 chat_options &= ~(mask); |
772 chat_options |= (data & mask); | 774 chat_options |= (data & mask); |
773 update_chat_tabs(); | 775 |
774 } else { | |
775 mask = (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB); | 776 mask = (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB); |
776 im_options &= ~(mask); | 777 im_options &= ~(mask); |
777 im_options |= (data & mask); | 778 im_options |= (data & mask); |
779 | |
778 update_im_tabs(); | 780 update_im_tabs(); |
781 } else { | |
782 if (data & 0x1) { /* set the first bit if we're affecting chat buttons */ | |
783 mask = (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB); | |
784 chat_options &= ~(mask); | |
785 chat_options |= (data & mask); | |
786 update_chat_tabs(); | |
787 } else { | |
788 mask = (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB); | |
789 im_options &= ~(mask); | |
790 im_options |= (data & mask); | |
791 update_im_tabs(); | |
792 } | |
779 } | 793 } |
780 | 794 |
781 save_prefs(); | 795 save_prefs(); |
782 } | 796 } |
783 | 797 |
838 gtk_signal_connect(GTK_OBJECT(adjust), "value-changed", | 852 gtk_signal_connect(GTK_OBJECT(adjust), "value-changed", |
839 GTK_SIGNAL_FUNC(update_spin_value), GTK_WIDGET(spin)); | 853 GTK_SIGNAL_FUNC(update_spin_value), GTK_WIDGET(spin)); |
840 gtk_widget_show(spin); | 854 gtk_widget_show(spin); |
841 } | 855 } |
842 | 856 |
857 static gboolean current_is_im = FALSE; | |
858 | |
859 static void not_im() | |
860 { | |
861 current_is_im = FALSE; | |
862 } | |
863 | |
843 static void im_page() | 864 static void im_page() |
844 { | 865 { |
845 GtkWidget *parent; | 866 GtkWidget *parent; |
846 GtkWidget *box; | 867 GtkWidget *box; |
847 GtkWidget *label; | 868 GtkWidget *label; |
856 GtkWidget *vbox3; | 877 GtkWidget *vbox3; |
857 | 878 |
858 parent = prefdialog->parent; | 879 parent = prefdialog->parent; |
859 gtk_widget_destroy(prefdialog); | 880 gtk_widget_destroy(prefdialog); |
860 | 881 |
882 current_is_im = TRUE; | |
883 | |
861 prefdialog = gtk_frame_new(_("IM Options")); | 884 prefdialog = gtk_frame_new(_("IM Options")); |
862 gtk_container_add(GTK_CONTAINER(parent), prefdialog); | 885 gtk_container_add(GTK_CONTAINER(parent), prefdialog); |
886 gtk_signal_connect(GTK_OBJECT(prefdialog), "destroy", GTK_SIGNAL_FUNC(not_im), NULL); | |
863 | 887 |
864 box = gtk_vbox_new(FALSE, 5); | 888 box = gtk_vbox_new(FALSE, 5); |
865 gtk_container_set_border_width(GTK_CONTAINER(box), 5); | 889 gtk_container_set_border_width(GTK_CONTAINER(box), 5); |
866 gtk_container_add(GTK_CONTAINER(prefdialog), box); | 890 gtk_container_add(GTK_CONTAINER(prefdialog), box); |
867 gtk_widget_show(box); | 891 gtk_widget_show(box); |
903 gtk_widget_show(vbox2); | 927 gtk_widget_show(vbox2); |
904 | 928 |
905 button = | 929 button = |
906 gaim_button(_("Show all conversations in one tabbed window"), &im_options, OPT_IM_ONE_WINDOW, | 930 gaim_button(_("Show all conversations in one tabbed window"), &im_options, OPT_IM_ONE_WINDOW, |
907 vbox2); | 931 vbox2); |
932 opt = gaim_button(_("Show chats in the same tabbed window"), &convo_options, OPT_CONVO_COMBINE, vbox2); | |
933 if (chat_options & OPT_CHAT_ONE_WINDOW) { | |
934 if (!(im_options & OPT_IM_ONE_WINDOW)) | |
935 gtk_widget_set_sensitive(opt, FALSE); | |
936 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt); | |
937 } else | |
938 gtk_widget_set_sensitive(opt, FALSE); | |
908 gaim_button(_("Raise windows on events"), &im_options, OPT_IM_POPUP, vbox2); | 939 gaim_button(_("Raise windows on events"), &im_options, OPT_IM_POPUP, vbox2); |
909 gaim_button(_("Show logins in window"), &im_options, OPT_IM_LOGON, vbox2); | 940 gaim_button(_("Show logins in window"), &im_options, OPT_IM_LOGON, vbox2); |
910 gaim_button(_("Show aliases in tabs/titles"), &im_options, OPT_IM_ALIAS_TAB, vbox2); | 941 gaim_button(_("Show aliases in tabs/titles"), &im_options, OPT_IM_ALIAS_TAB, vbox2); |
911 gaim_button(_("Hide window on send"), &im_options, OPT_IM_POPDOWN, vbox2); | 942 gaim_button(_("Hide window on send"), &im_options, OPT_IM_POPDOWN, vbox2); |
912 | 943 |
1042 gtk_widget_show(vbox2); | 1073 gtk_widget_show(vbox2); |
1043 | 1074 |
1044 button = | 1075 button = |
1045 gaim_button(_("Show all chats in one tabbed window"), &chat_options, OPT_CHAT_ONE_WINDOW, | 1076 gaim_button(_("Show all chats in one tabbed window"), &chat_options, OPT_CHAT_ONE_WINDOW, |
1046 vbox2); | 1077 vbox2); |
1078 opt = gaim_button(_("Show conversations in the same tabbed window"), &convo_options, OPT_CONVO_COMBINE, vbox2); | |
1079 if (im_options & OPT_IM_ONE_WINDOW) { | |
1080 if (!(chat_options & OPT_CHAT_ONE_WINDOW)) | |
1081 gtk_widget_set_sensitive(opt, FALSE); | |
1082 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt); | |
1083 } else | |
1084 gtk_widget_set_sensitive(opt, FALSE); | |
1047 gaim_button(_("Raise windows on events"), &chat_options, OPT_CHAT_POPUP, vbox2); | 1085 gaim_button(_("Raise windows on events"), &chat_options, OPT_CHAT_POPUP, vbox2); |
1048 gaim_button(_("Show people joining/leaving in window"), &chat_options, OPT_CHAT_LOGON, vbox2); | 1086 gaim_button(_("Show people joining/leaving in window"), &chat_options, OPT_CHAT_LOGON, vbox2); |
1049 | 1087 |
1050 frame = gtk_frame_new(_("Window Sizes")); | 1088 frame = gtk_frame_new(_("Window Sizes")); |
1051 gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5); | 1089 gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5); |
1774 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | 1812 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); |
1775 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | 1813 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); |
1776 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | 1814 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); |
1777 } | 1815 } |
1778 | 1816 |
1779 | |
1780 | |
1781 static void away_page() | 1817 static void away_page() |
1782 { | 1818 { |
1783 GtkWidget *parent; | 1819 GtkWidget *parent; |
1784 GtkWidget *box; | 1820 GtkWidget *box; |
1785 GtkWidget *label; | 1821 GtkWidget *label; |
2620 toggle_timestamps(); | 2656 toggle_timestamps(); |
2621 | 2657 |
2622 if (option == OPT_CONVO_CHECK_SPELLING) | 2658 if (option == OPT_CONVO_CHECK_SPELLING) |
2623 toggle_spellchk(); | 2659 toggle_spellchk(); |
2624 | 2660 |
2661 if (option == OPT_CONVO_COMBINE) { | |
2662 /* (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB) == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB) */ | |
2663 if (current_is_im) { | |
2664 int set = im_options & (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB); | |
2665 chat_options &= ~(OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB); | |
2666 chat_options |= set; | |
2667 } else { | |
2668 int set = chat_options & (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB); | |
2669 im_options &= ~(OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB); | |
2670 im_options |= set; | |
2671 } | |
2672 convo_tabize(); | |
2673 } | |
2674 | |
2625 save_prefs(); | 2675 save_prefs(); |
2626 } | 2676 } |
2627 | 2677 |
2628 static void set_im_option(GtkWidget *w, int option) | 2678 static void set_im_option(GtkWidget *w, int option) |
2629 { | 2679 { |
2630 im_options ^= option; | 2680 im_options ^= option; |
2631 | 2681 |
2632 if (option == OPT_IM_ONE_WINDOW) | 2682 if (option == OPT_IM_ONE_WINDOW) |
2633 tabize(); | 2683 im_tabize(); |
2634 | 2684 |
2635 if (option == OPT_IM_HIDE_ICONS) | 2685 if (option == OPT_IM_HIDE_ICONS) |
2636 set_hide_icons(); | 2686 set_hide_icons(); |
2637 | 2687 |
2638 if (option == OPT_IM_ALIAS_TAB) | 2688 if (option == OPT_IM_ALIAS_TAB) |