Mercurial > pidgin.yaz
comparison src/gtkprefs.c @ 9155:e0c50af60837
[gaim-migrate @ 9939]
Change the conversation tab preferences a bit.
If tabs are disabled then Gaim will always put new convs in a new
window, regardless of what your placement option is.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 01 Jun 2004 01:39:18 +0000 |
parents | e672ee8a12ec |
children | 45d2ad4ac1c1 |
comparison
equal
deleted
inserted
replaced
9154:dcb290a0c970 | 9155:e0c50af60837 |
---|---|
932 | 932 |
933 return ret; | 933 return ret; |
934 } | 934 } |
935 | 935 |
936 static void | 936 static void |
937 conversation_placement_cb(const char *name, GaimPrefType type, gpointer value, | 937 conversation_usetabs_cb(const char *name, GaimPrefType type, gpointer value, |
938 gpointer data) | 938 gpointer data) |
939 { | 939 { |
940 const char *placement = value; | 940 gboolean usetabs = (gboolean)value; |
941 | 941 |
942 if (strcmp(placement, "new")) | 942 if (usetabs) |
943 gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); | |
944 else | |
943 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); | 945 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); |
944 else | |
945 gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); | |
946 } | 946 } |
947 | 947 |
948 GtkWidget *conv_page() { | 948 GtkWidget *conv_page() { |
949 GtkWidget *ret; | 949 GtkWidget *ret; |
950 GtkWidget *vbox; | 950 GtkWidget *vbox, *vbox2; |
951 GtkWidget *label; | 951 GtkWidget *label; |
952 GtkWidget *close_checkbox; | |
953 GtkWidget *tabs_checkbox, *tab_placement; | |
954 /* GtkWidget *same_checkbox, *icons_checkbox; */ | |
955 GtkSizeGroup *sg; | 952 GtkSizeGroup *sg; |
956 GList *names = NULL; | 953 GList *names = NULL; |
957 | 954 |
958 ret = gtk_vbox_new(FALSE, 18); | 955 ret = gtk_vbox_new(FALSE, 18); |
959 gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | 956 gtk_container_set_border_width(GTK_CONTAINER(ret), 12); |
960 | 957 |
961 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | 958 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
962 vbox = gaim_gtk_make_frame(ret, _("Conversations")); | 959 vbox = gaim_gtk_make_frame(ret, _("Conversations")); |
963 | 960 |
964 names = gaim_conv_placement_get_options(); | |
965 | |
966 label = gaim_gtk_prefs_dropdown_from_list(vbox, _("_Placement:"), | |
967 GAIM_PREF_STRING, "/gaim/gtk/conversations/placement", names); | |
968 g_list_free(names); | |
969 | |
970 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
971 gtk_size_group_add_widget(sg, label); | |
972 #if 1 /* PREFSLASH04 */ | 961 #if 1 /* PREFSLASH04 */ |
973 label = gaim_gtk_prefs_dropdown(vbox, _("Show _buttons as:"), GAIM_PREF_INT, | 962 label = gaim_gtk_prefs_dropdown(vbox, _("Show _buttons as:"), GAIM_PREF_INT, |
974 "/gaim/gtk/conversations/button_type", | 963 "/gaim/gtk/conversations/button_type", |
975 _("Pictures"), GAIM_BUTTON_IMAGE, | 964 _("Pictures"), GAIM_BUTTON_IMAGE, |
976 _("Text"), GAIM_BUTTON_TEXT, | 965 _("Text"), GAIM_BUTTON_TEXT, |
977 _("Pictures and text"), GAIM_BUTTON_TEXT_IMAGE, | 966 _("Pictures and text"), GAIM_BUTTON_TEXT_IMAGE, |
978 _("None"), GAIM_BUTTON_NONE, | 967 _("None"), GAIM_BUTTON_NONE, |
979 NULL); | 968 NULL); |
980 | |
981 gtk_size_group_add_widget(sg, label); | 969 gtk_size_group_add_widget(sg, label); |
982 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | 970 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
983 #endif /* PREFSLASH04 */ | 971 #endif /* PREFSLASH04 */ |
984 | 972 |
985 label = gaim_gtk_prefs_labeled_spin_button(vbox, _("Number of conversations per window"), | |
986 "/gaim/gtk/conversations/placement_number", | |
987 1, 50, sg); | |
988 if (strcmp("number", | |
989 gaim_prefs_get_string("/gaim/gtk/conversations/placement"))) | |
990 gtk_widget_set_sensitive(label, FALSE); | |
991 else | |
992 gtk_widget_set_sensitive(label, TRUE); | |
993 | |
994 gaim_gtk_prefs_checkbox(_("Show _formatting toolbar"), | 973 gaim_gtk_prefs_checkbox(_("Show _formatting toolbar"), |
995 "/gaim/gtk/conversations/show_formatting_toolbar", vbox); | 974 "/gaim/gtk/conversations/show_formatting_toolbar", vbox); |
996 | 975 gaim_gtk_prefs_checkbox(_("Show _aliases in tabs/titles"), |
997 gaim_gtk_prefs_checkbox(_("Show a_liases in tabs/titles"), | |
998 "/core/conversations/use_alias_for_title", vbox); | 976 "/core/conversations/use_alias_for_title", vbox); |
999 | 977 gaim_gtk_prefs_checkbox(_("Show buddy _icons"), |
1000 gaim_gtk_prefs_checkbox(_("Enable _Commands"), | 978 "/gaim/gtk/conversations/im/show_buddy_icons", vbox); |
1001 "/gaim/gtk/conversations/enable_commands", vbox); | 979 gaim_gtk_prefs_checkbox(_("Enable buddy ic_on animation"), |
1002 | 980 "/gaim/gtk/conversations/im/animate_buddy_icons", vbox); |
1003 gaim_gtk_prefs_checkbox(_("_Raise window on events"), | 981 gaim_gtk_prefs_checkbox(_("_Raise window on events"), |
1004 "/gaim/gtk/conversations/raise_on_events", vbox); | 982 "/gaim/gtk/conversations/raise_on_events", vbox); |
1005 | 983 gaim_gtk_prefs_checkbox(_("_Notify buddies that you are typing to them"), |
1006 /* XXX This caption totally sucks but I can't break the string freeze. */ | 984 "/core/conversations/im/send_typing", vbox); |
1007 gaim_gtk_prefs_checkbox(_("Co_lorize screen names"), | 985 gaim_gtk_prefs_checkbox(_("Enable \"_slash\" commands"), |
986 "/gaim/gtk/conversations/enable_commands", vbox); | |
987 gaim_gtk_prefs_checkbox(_("Use _multi-colored screen names in chats"), | |
1008 "/gaim/gtk/conversations/chat/color_nicks", vbox); | 988 "/gaim/gtk/conversations/chat/color_nicks", vbox); |
1009 gaim_gtk_prefs_checkbox(_("Show buddy _icons"), | 989 |
1010 "/gaim/gtk/conversations/im/show_buddy_icons", vbox); | 990 /* All the tab options! */ |
1011 gaim_gtk_prefs_checkbox(_("Enable buddy icon a_nimation"), | 991 vbox = gaim_gtk_make_frame(ret, _("Tab Options")); |
1012 "/gaim/gtk/conversations/im/animate_buddy_icons", vbox); | 992 |
1013 gaim_gtk_prefs_checkbox(_("Notify buddies that you are _typing to them"), | 993 gaim_gtk_prefs_checkbox(_("Show IMs and chats in _tabbed windows"), |
1014 "/core/conversations/im/send_typing", vbox); | |
1015 | |
1016 vbox = gaim_gtk_make_frame (ret, _("Tab Options")); | |
1017 | |
1018 tabs_checkbox = gaim_gtk_prefs_checkbox(_("Show IMs and chats in _tabbed windows"), | |
1019 "/gaim/gtk/conversations/tabs", vbox); | 994 "/gaim/gtk/conversations/tabs", vbox); |
1020 if (strcmp(gaim_prefs_get_string("/gaim/gtk/conversations/placement"), "new")) | 995 |
1021 gtk_widget_set_sensitive(tabs_checkbox, FALSE); | 996 /* |
1022 | 997 * Connect a signal to the above preference. When conversations are not |
1023 #if 0 /* Overzealous last-minute prefslashing */ | 998 * shown in a tabbed window then all tabbing options should be disabled. |
1024 same_checkbox = gaim_gtk_prefs_checkbox(_("Show IMs and chats in _same tabbed window"), | 999 */ |
1025 "/core/conversations/combine_chat_im", vbox); | 1000 vbox2 = gtk_vbox_new(FALSE, 0); |
1026 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) { | 1001 gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0); |
1027 gtk_widget_set_sensitive(GTK_WIDGET(same_checkbox), FALSE); | 1002 placement_pref_id = gaim_prefs_connect_callback("/gaim/gtk/conversations/tabs", |
1028 } | 1003 conversation_usetabs_cb, |
1029 | 1004 vbox2); |
1030 g_signal_connect(G_OBJECT(tabs_checkbox), "clicked", | 1005 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) |
1031 G_CALLBACK(gaim_gtk_toggle_sensitive), same_checkbox); | 1006 gtk_widget_set_sensitive(vbox2, FALSE); |
1007 | |
1008 #if 0 /* PREFSLASH04 */ | |
1009 gaim_gtk_prefs_checkbox(_("Show IMs and chats in _same tabbed window"), | |
1010 "/core/conversations/combine_chat_im", vbox2); | |
1032 #endif | 1011 #endif |
1033 | 1012 |
1034 placement_pref_id = gaim_prefs_connect_callback("/gaim/gtk/conversations/placement", | 1013 gaim_gtk_prefs_checkbox(_("Show _close button on tabs"), |
1035 conversation_placement_cb, | 1014 "/gaim/gtk/conversations/close_on_tabs", vbox2); |
1036 tabs_checkbox); | 1015 |
1037 | 1016 label = gaim_gtk_prefs_dropdown(vbox2, _("Tab p_lacement:"), GAIM_PREF_INT, |
1038 close_checkbox = gaim_gtk_prefs_checkbox(_("Show _close button on tabs"), | |
1039 "/gaim/gtk/conversations/close_on_tabs", | |
1040 vbox); | |
1041 | |
1042 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) { | |
1043 gtk_widget_set_sensitive(GTK_WIDGET(close_checkbox), FALSE); | |
1044 } | |
1045 | |
1046 g_signal_connect(G_OBJECT(tabs_checkbox), "clicked", | |
1047 G_CALLBACK(gaim_gtk_toggle_sensitive), close_checkbox); | |
1048 | |
1049 tab_placement = gtk_hbox_new(FALSE, 0); | |
1050 | |
1051 label = gaim_gtk_prefs_dropdown(tab_placement, _("_Tab Placement:"), GAIM_PREF_INT, | |
1052 "/gaim/gtk/conversations/tab_side", | 1017 "/gaim/gtk/conversations/tab_side", |
1053 _("Top"), GTK_POS_TOP, | 1018 _("Top"), GTK_POS_TOP, |
1054 _("Bottom"), GTK_POS_BOTTOM, | 1019 _("Bottom"), GTK_POS_BOTTOM, |
1055 _("Left"), GTK_POS_LEFT, | 1020 _("Left"), GTK_POS_LEFT, |
1056 _("Right"), GTK_POS_RIGHT, | 1021 _("Right"), GTK_POS_RIGHT, |
1057 NULL); | 1022 NULL); |
1058 | |
1059 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | 1023 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
1060 gtk_size_group_add_widget(sg, label); | 1024 gtk_size_group_add_widget(sg, label); |
1061 | 1025 |
1062 gtk_box_pack_start(GTK_BOX(vbox), tab_placement, FALSE, FALSE, 0); | 1026 names = gaim_conv_placement_get_options(); |
1063 | 1027 label = gaim_gtk_prefs_dropdown_from_list(vbox2, _("New window _placement:"), |
1064 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) { | 1028 GAIM_PREF_STRING, "/gaim/gtk/conversations/placement", names); |
1065 gtk_widget_set_sensitive(GTK_WIDGET(tab_placement), FALSE); | 1029 gtk_size_group_add_widget(sg, label); |
1066 } | 1030 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
1067 | 1031 g_list_free(names); |
1068 g_signal_connect(G_OBJECT(tabs_checkbox), "clicked", | 1032 |
1069 G_CALLBACK(gaim_gtk_toggle_sensitive), tab_placement); | 1033 #if 0 /* PREFSLASH04 */ |
1034 label = gaim_gtk_prefs_labeled_spin_button(vbox2, _("Number of conversations per window:"), | |
1035 "/gaim/gtk/conversations/placement_number", | |
1036 1, 50, sg); | |
1037 #endif | |
1070 | 1038 |
1071 gtk_widget_show_all(ret); | 1039 gtk_widget_show_all(ret); |
1072 | 1040 |
1073 return ret; | 1041 return ret; |
1074 } | 1042 } |