| 956 | | GtkWidget *frame1; |
|---|
| 957 | | GtkWidget *vbox2; |
|---|
| 958 | | GtkWidget *hbox1; |
|---|
| 959 | | GtkWidget *button1; |
|---|
| 960 | | GtkWidget *image1; |
|---|
| 961 | | GtkWidget *button2; |
|---|
| 962 | | GtkWidget *image2; |
|---|
| 963 | | GtkWidget *button3; |
|---|
| 964 | | GtkWidget *image3; |
|---|
| 965 | | GtkWidget *frame2; |
|---|
| 966 | | GtkWidget *hbuttonbox1; |
|---|
| 967 | | GtkWidget *button6; |
|---|
| 968 | | GtkWidget *button7; |
|---|
| 969 | | GtkWidget *radiobuttons[SCHEME_SELECT_LAST]; |
|---|
| 970 | | GtkWidget *label; |
|---|
| 971 | | GtkTreeSelection *selection; |
|---|
| 972 | | GtkTooltips *tooltips; |
|---|
| 973 | | |
|---|
| 974 | | scheme_editor = gtk_vbox_new (FALSE, 0); |
|---|
| 975 | | |
|---|
| 976 | | tooltips = gtk_tooltips_new (); |
|---|
| 977 | | |
|---|
| 978 | | frame1 = gtk_frame_new (NULL); |
|---|
| 979 | | gtk_box_pack_start (GTK_BOX (scheme_editor), frame1, TRUE, TRUE, 0); |
|---|
| 980 | | gtk_container_set_border_width (GTK_CONTAINER (frame1), 3); |
|---|
| 981 | | gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_OUT); |
|---|
| 982 | | |
|---|
| 983 | | vbox2 = gtk_vbox_new (FALSE, 0); |
|---|
| 984 | | gtk_container_add (GTK_CONTAINER (frame1), vbox2); |
|---|
| 985 | | gtk_container_set_border_width (GTK_CONTAINER (vbox2), 2); |
|---|
| 986 | | |
|---|
| 987 | | hbox1 = gtk_hbox_new (FALSE, 0); |
|---|
| 988 | | gtk_widget_show (hbox1); |
|---|
| 989 | | gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0); |
|---|
| 990 | | gtk_container_set_border_width (GTK_CONTAINER (hbox1), 1); |
|---|
| 991 | | |
|---|
| 992 | | label = gtk_label_new (_("<b> Selected scheme </b>")); |
|---|
| 993 | | gtk_label_set_use_markup (GTK_LABEL (label), TRUE); |
|---|
| 994 | | gtk_box_pack_start (GTK_BOX (hbox1), GTK_WIDGET (label), FALSE, FALSE, 0); |
|---|
| 995 | | |
|---|
| 996 | | |
|---|
| 997 | | schemes_combo = GTK_COMBO_BOX (gtk_combo_box_new_text ()); |
|---|
| 998 | | gtk_box_pack_start (GTK_BOX (hbox1), GTK_WIDGET (schemes_combo), TRUE, TRUE, 0); |
|---|
| 999 | | |
|---|
| 1000 | | button1 = gtk_button_new (); |
|---|
| 1001 | | gtk_box_pack_start (GTK_BOX (hbox1), button1, FALSE, FALSE, 0); |
|---|
| 1002 | | |
|---|
| 1003 | | image1 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); |
|---|
| 1004 | | gtk_container_add (GTK_CONTAINER (button1), image1); |
|---|
| 1005 | | |
|---|
| 1006 | | gtk_tooltips_set_tip (tooltips, button1, |
|---|
| | 956 | GtkWidget * editor_vbox; |
|---|
| | 957 | GtkWidget * general_vbox; |
|---|
| | 958 | GtkWidget * checkbutton; |
|---|
| | 959 | GtkWidget * color_picker; |
|---|
| | 960 | GtkWidget * treeview; |
|---|
| | 961 | GtkWidget * button; |
|---|
| | 962 | GtkWidget * frame; |
|---|
| | 963 | GtkWidget * hbuttonbox; |
|---|
| | 964 | GtkWidget * label; |
|---|
| | 965 | GtkWidget * notebook; |
|---|
| | 966 | GtkWidget * image; |
|---|
| | 967 | GtkWidget * hbox; |
|---|
| | 968 | GtkWidget * radiobuttons[SCHEME_SELECT_LAST]; |
|---|
| | 969 | GtkTooltips * tooltips; |
|---|
| | 970 | GtkTreeSelection * selection; |
|---|
| | 971 | gint method; |
|---|
| | 972 | |
|---|
| | 973 | tooltips = gtk_tooltips_new (); |
|---|
| | 974 | |
|---|
| | 975 | scheme_editor = gtk_vbox_new (FALSE, 0); |
|---|
| | 976 | notebook = gtk_notebook_new (); |
|---|
| | 977 | |
|---|
| | 978 | editor_vbox = gtk_vbox_new (FALSE, 0); |
|---|
| | 979 | gtk_container_set_border_width (GTK_CONTAINER (editor_vbox), 2); |
|---|
| | 980 | |
|---|
| | 981 | general_vbox = gtk_vbox_new (FALSE, 0); |
|---|
| | 982 | gtk_container_set_border_width (GTK_CONTAINER (general_vbox), 2); |
|---|
| | 983 | |
|---|
| | 984 | gtk_box_pack_start_defaults (GTK_BOX (scheme_editor), notebook); |
|---|
| | 985 | gtk_container_set_border_width (GTK_CONTAINER (notebook), 4); |
|---|
| | 986 | |
|---|
| | 987 | /* scheme editor notebook tab widgets */ |
|---|
| | 988 | |
|---|
| | 989 | hbox = gtk_hbox_new (FALSE, 0); |
|---|
| | 990 | image = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_BUTTON); |
|---|
| | 991 | gtk_box_pack_start (GTK_BOX (hbox), image, TRUE, TRUE, 0); |
|---|
| | 992 | gtk_misc_set_padding (GTK_MISC (image), 2, 0); |
|---|
| | 993 | |
|---|
| | 994 | label = gtk_label_new (_("Color scheme editor")); |
|---|
| | 995 | gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); |
|---|
| | 996 | gtk_misc_set_padding (GTK_MISC (label), 2, 0); |
|---|
| | 997 | gtk_widget_show_all (hbox); |
|---|
| | 998 | |
|---|
| | 999 | gtk_notebook_append_page (GTK_NOTEBOOK (notebook), editor_vbox, hbox); |
|---|
| | 1000 | |
|---|
| | 1001 | |
|---|
| | 1002 | /* general notebook tab widgets */ |
|---|
| | 1003 | |
|---|
| | 1004 | hbox = gtk_hbox_new (FALSE, 0); |
|---|
| | 1005 | image = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_BUTTON); |
|---|
| | 1006 | gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); |
|---|
| | 1007 | gtk_misc_set_padding (GTK_MISC (image), 2, 0); |
|---|
| | 1008 | |
|---|
| | 1009 | label = gtk_label_new (_("General scheme options")); |
|---|
| | 1010 | gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
|---|
| | 1011 | gtk_misc_set_padding (GTK_MISC (label), 2, 0); |
|---|
| | 1012 | gtk_widget_show_all (hbox); |
|---|
| | 1013 | |
|---|
| | 1014 | gtk_notebook_append_page (GTK_NOTEBOOK (notebook), general_vbox, hbox); |
|---|
| | 1015 | |
|---|
| | 1016 | /** scheme selection and operations **/ |
|---|
| | 1017 | |
|---|
| | 1018 | /* schemes combo and label */ |
|---|
| | 1019 | |
|---|
| | 1020 | hbox = gtk_hbox_new (FALSE, 0); |
|---|
| | 1021 | gtk_widget_show (hbox); |
|---|
| | 1022 | gtk_box_pack_start (GTK_BOX (editor_vbox), hbox, FALSE, FALSE, 2); |
|---|
| | 1023 | gtk_container_set_border_width (GTK_CONTAINER (hbox), 3); |
|---|
| | 1024 | |
|---|
| | 1025 | label = gtk_label_new (_("<b>Selected scheme</b>")); |
|---|
| | 1026 | gtk_misc_set_padding (GTK_MISC (label), 4, 0); |
|---|
| | 1027 | gtk_label_set_use_markup (GTK_LABEL (label), TRUE); |
|---|
| | 1028 | gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (label), FALSE, FALSE, 0); |
|---|
| | 1029 | |
|---|
| | 1030 | |
|---|
| | 1031 | schemes_combo = GTK_COMBO_BOX (gtk_combo_box_new_text ()); |
|---|
| | 1032 | g_signal_connect ((gpointer) schemes_combo, "changed", |
|---|
| | 1033 | G_CALLBACK (scheme_ed_combo_changed_cb), |
|---|
| | 1034 | NULL); |
|---|
| | 1035 | gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (schemes_combo), TRUE, TRUE, 2); |
|---|
| | 1036 | |
|---|
| | 1037 | /* new scheme button */ |
|---|
| | 1038 | |
|---|
| | 1039 | button = gtk_button_new (); |
|---|
| | 1040 | gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); |
|---|
| | 1041 | image = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); |
|---|
| | 1042 | gtk_container_add (GTK_CONTAINER (button), image); |
|---|
| | 1043 | gtk_tooltips_set_tip (tooltips, button, |
|---|
| 1025 | | |
|---|
| 1026 | | image3 = gtk_image_new_from_stock ("gtk-delete", GTK_ICON_SIZE_MENU); |
|---|
| 1027 | | gtk_container_add (GTK_CONTAINER (button3), image3); |
|---|
| 1028 | | |
|---|
| 1029 | | GtkWidget *hbox2 = gtk_hbox_new (FALSE, 0); |
|---|
| 1030 | | gtk_box_pack_start (GTK_BOX (vbox2), hbox2, TRUE, TRUE, 0); |
|---|
| 1031 | | |
|---|
| 1032 | | |
|---|
| 1033 | | frame2 = gtk_frame_new (NULL); |
|---|
| 1034 | | gtk_container_set_border_width (GTK_CONTAINER (frame2), 2); |
|---|
| 1035 | | gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_IN); |
|---|
| 1036 | | gtk_box_pack_start (GTK_BOX (hbox2), frame2, FALSE, TRUE, 0); |
|---|
| 1037 | | |
|---|
| 1038 | | GtkWidget *treeview = schemes_create_tree_view (); |
|---|
| 1039 | | gtk_container_add (GTK_CONTAINER (frame2), treeview); |
|---|
| 1040 | | gtk_tooltips_set_tip (tooltips, treeview, |
|---|
| | 1070 | image = gtk_image_new_from_stock ("gtk-delete", GTK_ICON_SIZE_MENU); |
|---|
| | 1071 | gtk_container_add (GTK_CONTAINER (button), image); |
|---|
| | 1072 | g_signal_connect ((gpointer) button, "clicked", |
|---|
| | 1073 | G_CALLBACK (scheme_ed_delete_clicked_cb), |
|---|
| | 1074 | schemes_combo); |
|---|
| | 1075 | |
|---|
| | 1076 | /* is default toggle button */ |
|---|
| | 1077 | |
|---|
| | 1078 | checkbutton = gtk_check_button_new_with_label (_("Default")); |
|---|
| | 1079 | gtk_box_pack_start (GTK_BOX (hbox), checkbutton, FALSE, FALSE, 0); |
|---|
| | 1080 | gtk_tooltips_set_tip (tooltips, checkbutton, |
|---|
| | 1081 | _("Toggle whether the selected scheme is the default"), |
|---|
| | 1082 | _("Toggle whether the selected scheme is the default")); |
|---|
| | 1083 | |
|---|
| | 1084 | |
|---|
| | 1085 | /** color swatches and color selection **/ |
|---|
| | 1086 | |
|---|
| | 1087 | hbox = gtk_hbox_new (FALSE, 0); |
|---|
| | 1088 | gtk_box_pack_start (GTK_BOX (editor_vbox), hbox, TRUE, TRUE, 0); |
|---|
| | 1089 | |
|---|
| | 1090 | /* color swatches treeview */ |
|---|
| | 1091 | |
|---|
| | 1092 | frame = gtk_frame_new (NULL); |
|---|
| | 1093 | gtk_container_set_border_width (GTK_CONTAINER (frame), 0); |
|---|
| | 1094 | gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); |
|---|
| | 1095 | gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, TRUE, 2); |
|---|
| | 1096 | |
|---|
| | 1097 | treeview = schemes_create_tree_view (); |
|---|
| | 1098 | gtk_container_add (GTK_CONTAINER (frame), treeview); |
|---|
| | 1099 | gtk_tooltips_set_tip (tooltips, treeview, |
|---|
| 1043 | | |
|---|
| 1044 | | GtkWidget *frame3 = gtk_frame_new (NULL); |
|---|
| 1045 | | gtk_container_set_border_width (GTK_CONTAINER (frame3), 0); |
|---|
| 1046 | | gtk_frame_set_shadow_type (GTK_FRAME (frame3), GTK_SHADOW_NONE); |
|---|
| 1047 | | gtk_box_pack_start (GTK_BOX (hbox2), frame3, TRUE, TRUE, 0); |
|---|
| 1048 | | GtkWidget *color_picker = schemes_create_color_picker (); |
|---|
| 1049 | | gtk_container_add (GTK_CONTAINER (frame3), color_picker); |
|---|
| 1050 | | |
|---|
| 1051 | | GtkWidget *frame_sel_options = gtk_frame_new (_("Automatic scheme selection")); |
|---|
| 1052 | | gtk_container_set_border_width (GTK_CONTAINER (frame_sel_options), 8); |
|---|
| 1053 | | gtk_box_pack_start (GTK_BOX (scheme_editor), frame_sel_options, FALSE, FALSE, 0); |
|---|
| 1054 | | |
|---|
| 1055 | | GtkWidget *vbox_sel_options = gtk_vbox_new (TRUE, 2); |
|---|
| 1056 | | gtk_container_set_border_width (GTK_CONTAINER (vbox_sel_options), 5); |
|---|
| 1057 | | gtk_container_add (GTK_CONTAINER (frame_sel_options), vbox_sel_options); |
|---|
| 1058 | | |
|---|
| 1059 | | radiobuttons[SCHEME_SELECT_DEFAULT] = gtk_radio_button_new_with_label (NULL, |
|---|
| 1060 | | _("Always use the default scheme")); |
|---|
| 1061 | | gtk_box_pack_start_defaults (GTK_BOX (vbox_sel_options), |
|---|
| 1062 | | radiobuttons[SCHEME_SELECT_DEFAULT]); |
|---|
| 1063 | | |
|---|
| 1064 | | radiobuttons[SCHEME_SELECT_FILENAME] = |
|---|
| 1065 | | gtk_radio_button_new_with_label_from_widget ( |
|---|
| 1066 | | GTK_RADIO_BUTTON (radiobuttons[SCHEME_SELECT_DEFAULT]), |
|---|
| 1067 | | _("Select scheme by filename")); |
|---|
| 1068 | | |
|---|
| 1069 | | gtk_box_pack_start_defaults (GTK_BOX (vbox_sel_options), |
|---|
| 1070 | | radiobuttons[SCHEME_SELECT_FILENAME]); |
|---|
| 1071 | | |
|---|
| 1072 | | radiobuttons[SCHEME_SELECT_RANDOM] = |
|---|
| 1073 | | gtk_radio_button_new_with_label_from_widget ( |
|---|
| 1074 | | GTK_RADIO_BUTTON (radiobuttons[SCHEME_SELECT_DEFAULT]), |
|---|
| 1075 | | _("Select random scheme")); |
|---|
| 1076 | | |
|---|
| 1077 | | gtk_box_pack_start_defaults (GTK_BOX (vbox_sel_options), |
|---|
| 1078 | | radiobuttons[SCHEME_SELECT_RANDOM]); |
|---|
| 1079 | | |
|---|
| 1080 | | gint method = schemes_get_selection_method (); |
|---|
| 1081 | | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobuttons[method]), TRUE); |
|---|
| 1082 | | |
|---|
| 1083 | | |
|---|
| 1084 | | hbuttonbox1 = gtk_hbutton_box_new (); |
|---|
| 1085 | | gtk_box_pack_start (GTK_BOX (scheme_editor), hbuttonbox1, FALSE, FALSE, 0); |
|---|
| 1086 | | gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox1), 3); |
|---|
| 1087 | | gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_END); |
|---|
| 1088 | | |
|---|
| 1089 | | button6 = gtk_button_new_from_stock ("gtk-apply"); |
|---|
| 1090 | | gtk_container_add (GTK_CONTAINER (hbuttonbox1), button6); |
|---|
| 1091 | | gtk_container_set_border_width (GTK_CONTAINER (button6), 2); |
|---|
| 1092 | | GTK_WIDGET_SET_FLAGS (button6, GTK_CAN_DEFAULT); |
|---|
| 1093 | | gtk_widget_set_sensitive (button6, FALSE); |
|---|
| 1094 | | |
|---|
| 1095 | | button7 = gtk_button_new_from_stock ("gtk-ok"); |
|---|
| 1096 | | gtk_container_add (GTK_CONTAINER (hbuttonbox1), button7); |
|---|
| 1097 | | gtk_container_set_border_width (GTK_CONTAINER (button7), 2); |
|---|
| 1098 | | |
|---|
| 1099 | | GTK_WIDGET_SET_FLAGS (button7, GTK_CAN_DEFAULT); |
|---|
| 1100 | | |
|---|
| 1101 | | g_signal_connect ((gpointer) button1, "clicked", |
|---|
| 1102 | | G_CALLBACK (scheme_ed_new_clicked_cb), |
|---|
| 1103 | | NULL); |
|---|
| 1104 | | g_signal_connect ((gpointer) button2, "clicked", |
|---|
| 1105 | | G_CALLBACK (scheme_ed_copy_clicked_cb), |
|---|
| 1106 | | schemes_combo); |
|---|
| 1107 | | g_signal_connect ((gpointer) button3, "clicked", |
|---|
| 1108 | | G_CALLBACK (scheme_ed_delete_clicked_cb), |
|---|
| 1109 | | schemes_combo); |
|---|
| 1110 | | g_signal_connect ((gpointer) button7, "clicked", |
|---|
| 1111 | | G_CALLBACK (scheme_ed_ok_clicked_cb), |
|---|
| 1112 | | scheme_editor); |
|---|
| 1113 | | |
|---|
| 1114 | | g_signal_connect ((gpointer) schemes_combo, "changed", |
|---|
| 1115 | | G_CALLBACK (scheme_ed_combo_changed_cb), |
|---|
| 1116 | | NULL); |
|---|
| | 1102 | |
|---|
| | 1103 | /* color selection */ |
|---|
| | 1104 | |
|---|
| | 1105 | color_picker = schemes_create_color_picker (); |
|---|
| | 1106 | gtk_box_pack_start (GTK_BOX (hbox), color_picker, TRUE, TRUE, 2); |
|---|
| | 1107 | |
|---|
| | 1108 | /** global dialog close button box **/ |
|---|
| | 1109 | |
|---|
| | 1110 | hbuttonbox = gtk_hbutton_box_new (); |
|---|
| | 1111 | gtk_box_pack_start (GTK_BOX (scheme_editor), hbuttonbox, FALSE, FALSE, 0); |
|---|
| | 1112 | gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox), 3); |
|---|
| | 1113 | gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox), GTK_BUTTONBOX_END); |
|---|
| | 1114 | |
|---|
| | 1115 | /* close button */ |
|---|
| | 1116 | |
|---|
| | 1117 | button = gtk_button_new_from_stock ("gtk-close"); |
|---|
| | 1118 | gtk_container_add (GTK_CONTAINER (hbuttonbox), button); |
|---|
| | 1119 | gtk_container_set_border_width (GTK_CONTAINER (button), 1); |
|---|
| | 1120 | GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); |
|---|
| | 1121 | |
|---|
| | 1122 | /** scheme save / revert buttons **/ |
|---|
| | 1123 | |
|---|
| | 1124 | hbuttonbox = gtk_hbutton_box_new (); |
|---|
| | 1125 | gtk_box_pack_start (GTK_BOX (editor_vbox), hbuttonbox, FALSE, FALSE, 0); |
|---|
| | 1126 | gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox), 4); |
|---|
| | 1127 | gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox), GTK_BUTTONBOX_END); |
|---|
| | 1128 | |
|---|
| | 1129 | /* revert scheme button */ |
|---|
| | 1130 | |
|---|
| | 1131 | button = gtk_button_new (); |
|---|
| | 1132 | label = gtk_label_new (_("Revert")); |
|---|
| | 1133 | image = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); |
|---|
| | 1134 | hbox = gtk_hbox_new (FALSE, 0); |
|---|
| | 1135 | |
|---|
| | 1136 | gtk_container_add (GTK_CONTAINER (button), hbox); |
|---|
| | 1137 | gtk_box_pack_start (GTK_BOX (hbox), image, TRUE, TRUE, 2); |
|---|
| | 1138 | gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 2); |
|---|
| | 1139 | gtk_misc_set_alignment (GTK_MISC (image), 1, 0.5); |
|---|
| | 1140 | gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); |
|---|
| | 1141 | g_signal_connect ((gpointer) button, "clicked", |
|---|
| | 1142 | G_CALLBACK (scheme_ed_revert_clicked_cb), |
|---|
| | 1143 | scheme_editor); |
|---|
| | 1144 | gtk_container_add (GTK_CONTAINER (hbuttonbox), button); |
|---|
| | 1145 | gtk_container_set_border_width (GTK_CONTAINER (button), 1); |
|---|
| | 1146 | GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); |
|---|
| | 1147 | // gtk_widget_set_sensitive (button, FALSE); |
|---|
| | 1148 | |
|---|
| | 1149 | /** general tab option widgets **/ |
|---|
| | 1150 | |
|---|
| | 1151 | /* scheme selection radios */ |
|---|
| | 1152 | |
|---|
| | 1153 | frame = gtk_frame_new (NULL); |
|---|
| | 1154 | gtk_box_pack_start (GTK_BOX (general_vbox), frame, FALSE, TRUE, 0); |
|---|
| | 1155 | label = gtk_label_new (_("<b>Automatic scheme selection</b>")); |
|---|
| | 1156 | gtk_label_set_use_markup (GTK_LABEL (label), TRUE); |
|---|
| | 1157 | gtk_frame_set_label_widget (GTK_FRAME (frame), label); |
|---|
| | 1158 | gtk_container_set_border_width (GTK_CONTAINER (frame), 8); |
|---|
| | 1159 | |
|---|
| | 1160 | |
|---|
| | 1161 | GtkWidget *vbox_sel_options = gtk_vbox_new (TRUE, 2); |
|---|
| | 1162 | gtk_container_set_border_width (GTK_CONTAINER (vbox_sel_options), 5); |
|---|
| | 1163 | gtk_container_add (GTK_CONTAINER (frame), vbox_sel_options); |
|---|
| | 1164 | |
|---|
| | 1165 | radiobuttons[SCHEME_SELECT_DEFAULT] = gtk_radio_button_new_with_label (NULL, |
|---|
| | 1166 | _("Always use the default scheme")); |
|---|
| | 1167 | gtk_box_pack_start_defaults (GTK_BOX (vbox_sel_options), |
|---|
| | 1168 | radiobuttons[SCHEME_SELECT_DEFAULT]); |
|---|
| | 1169 | |
|---|
| | 1170 | radiobuttons[SCHEME_SELECT_FILENAME] = |
|---|
| | 1171 | gtk_radio_button_new_with_label_from_widget ( |
|---|
| | 1172 | GTK_RADIO_BUTTON (radiobuttons[SCHEME_SELECT_DEFAULT]), |
|---|
| | 1173 | _("Select scheme by filename")); |
|---|
| | 1174 | |
|---|
| | 1175 | gtk_box_pack_start_defaults (GTK_BOX (vbox_sel_options), |
|---|
| | 1176 | radiobuttons[SCHEME_SELECT_FILENAME]); |
|---|
| | 1177 | |
|---|
| | 1178 | radiobuttons[SCHEME_SELECT_RANDOM] = |
|---|
| | 1179 | gtk_radio_button_new_with_label_from_widget ( |
|---|
| | 1180 | GTK_RADIO_BUTTON (radiobuttons[SCHEME_SELECT_DEFAULT]), |
|---|
| | 1181 | _("Select random scheme")); |
|---|
| | 1182 | |
|---|
| | 1183 | gtk_box_pack_start_defaults (GTK_BOX (vbox_sel_options), |
|---|
| | 1184 | radiobuttons[SCHEME_SELECT_RANDOM]); |
|---|
| | 1185 | |
|---|
| | 1186 | method = schemes_get_selection_method (); |
|---|
| | 1187 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobuttons[method]), TRUE); |
|---|
| | 1188 | |
|---|
| | 1189 | /* save scheme button */ |
|---|
| | 1190 | |
|---|
| | 1191 | button = gtk_button_new (); |
|---|
| | 1192 | label = gtk_label_new (_("Save")); |
|---|
| | 1193 | image = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU); |
|---|
| | 1194 | hbox = gtk_hbox_new (FALSE, 0); |
|---|
| | 1195 | |
|---|
| | 1196 | gtk_container_add (GTK_CONTAINER (button), hbox); |
|---|
| | 1197 | gtk_box_pack_start (GTK_BOX (hbox), image, TRUE, TRUE, 2); |
|---|
| | 1198 | gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 2); |
|---|
| | 1199 | gtk_misc_set_alignment (GTK_MISC (image), 1, 0.5); |
|---|
| | 1200 | gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); |
|---|
| | 1201 | g_signal_connect ((gpointer) button, "clicked", |
|---|
| | 1202 | G_CALLBACK (scheme_ed_save_clicked_cb), |
|---|
| | 1203 | scheme_editor); |
|---|
| | 1204 | gtk_container_add (GTK_CONTAINER (hbuttonbox), button); |
|---|
| | 1205 | gtk_container_set_border_width (GTK_CONTAINER (button), 1); |
|---|
| | 1206 | GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); |
|---|
| | 1207 | |
|---|
| | 1208 | |
|---|
| | 1209 | |
|---|
| | 1210 | |
|---|
| | 1211 | |
|---|
| | 1212 | |
|---|
| | 1213 | |
|---|