Mercurial > geeqie.yaz
comparison src/preferences.c @ 230:4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
Each tab has now its own function named:
config_tab_general(), config_tab_image(), config_tab_windows(),
config_tab_filtering(), config_tab_editors(), config_tab_exif(),
config_tab_advanced();
author | zas_ |
---|---|
date | Thu, 03 Apr 2008 20:11:09 +0000 |
parents | 41fc4bfc8b25 |
children | b3120867710d |
comparison
equal
deleted
inserted
replaced
229:c44b98370dba | 230:4b2fbfafa511 |
---|---|
841 | 841 |
842 if (fullscreen_info_c) g_free(fullscreen_info_c); | 842 if (fullscreen_info_c) g_free(fullscreen_info_c); |
843 fullscreen_info_c = gtk_text_buffer_get_text(pTextBuffer, &iStart, &iEnd, TRUE); | 843 fullscreen_info_c = gtk_text_buffer_get_text(pTextBuffer, &iStart, &iEnd, TRUE); |
844 } | 844 } |
845 | 845 |
846 static void config_window_create(void) | 846 /* general options tab */ |
847 { | 847 static void config_tab_general(GtkWidget *notebook) |
848 GtkWidget *win_vbox; | 848 { |
849 GtkWidget *label; | |
849 GtkWidget *hbox; | 850 GtkWidget *hbox; |
850 GtkWidget *notebook; | 851 GtkWidget *vbox; |
852 GtkWidget *group; | |
853 GtkWidget *subgroup; | |
854 GtkWidget *button; | |
855 GtkWidget *tabcomp; | |
856 GtkWidget *ct_button; | |
857 GtkWidget *table; | |
858 GtkWidget *spin; | |
859 | |
860 vbox = gtk_vbox_new(FALSE, 0); | |
861 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | |
862 gtk_widget_show(vbox); | |
863 label = gtk_label_new(_("General")); | |
864 gtk_notebook_append_page (GTK_NOTEBOOK(notebook), vbox, label); | |
865 | |
866 group = pref_group_new(vbox, FALSE, _("Startup"), GTK_ORIENTATION_VERTICAL); | |
867 | |
868 button = pref_checkbox_new_int(group, _("Change to folder:"), | |
869 startup_path_enable, &startup_path_enable_c); | |
870 | |
871 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
872 pref_checkbox_link_sensitivity(button, hbox); | |
873 | |
874 tabcomp = tab_completion_new(&startup_path_entry, startup_path, NULL, NULL); | |
875 tab_completion_add_select_button(startup_path_entry, NULL, TRUE); | |
876 gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0); | |
877 gtk_widget_show(tabcomp); | |
878 | |
879 button = pref_button_new(hbox, NULL, _("Use current"), FALSE, | |
880 G_CALLBACK(startup_path_set_current), NULL); | |
881 | |
882 group = pref_group_new(vbox, FALSE, _("Thumbnails"), GTK_ORIENTATION_VERTICAL); | |
883 | |
884 table = pref_table_new(group, 2, 2, FALSE, FALSE); | |
885 add_thumb_size_menu(table, 0, 0, _("Size:")); | |
886 add_quality_menu(table, 0, 1, _("Quality:"), thumbnail_quality, &thumbnail_quality_c); | |
887 | |
888 ct_button = pref_checkbox_new_int(group, _("Cache thumbnails"), | |
889 enable_thumb_caching, &enable_thumb_caching_c); | |
890 | |
891 subgroup = pref_box_new(group, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | |
892 pref_checkbox_link_sensitivity(ct_button, subgroup); | |
893 | |
894 button = pref_checkbox_new_int(subgroup, _("Use shared thumbnail cache"), | |
895 thumbnail_spec_standard, &thumbnail_spec_standard_c); | |
896 | |
897 subgroup = pref_box_new(subgroup, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | |
898 pref_checkbox_link_sensitivity_swap(button, subgroup); | |
899 | |
900 pref_checkbox_new_int(subgroup, _("Cache thumbnails into .thumbnails"), | |
901 enable_thumb_dirs, &enable_thumb_dirs_c); | |
902 | |
903 #if 0 | |
904 pref_checkbox_new_int(subgroup, _("Use xvpics thumbnails when found (read only)"), | |
905 use_xvpics_thumbnails, &use_xvpics_thumbnails_c); | |
906 #endif | |
907 | |
908 pref_checkbox_new_int(group, _("Faster jpeg thumbnailing (may reduce quality)"), | |
909 thumbnail_fast, &thumbnail_fast_c); | |
910 | |
911 group = pref_group_new(vbox, FALSE, _("Slide show"), GTK_ORIENTATION_VERTICAL); | |
912 | |
913 slideshow_delay_c = slideshow_delay; | |
914 spin = pref_spin_new(group, _("Delay between image change:"), _("seconds"), | |
915 SLIDESHOW_MIN_SECONDS, SLIDESHOW_MAX_SECONDS, 1.0, 1, | |
916 slideshow_delay ? (double)slideshow_delay / SLIDESHOW_SUBSECOND_PRECISION : 10.0, | |
917 G_CALLBACK(slideshow_delay_cb), NULL); | |
918 gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS); | |
919 | |
920 pref_checkbox_new_int(group, _("Random"), slideshow_random, &slideshow_random_c); | |
921 pref_checkbox_new_int(group, _("Repeat"), slideshow_repeat, &slideshow_repeat_c); | |
922 } | |
923 | |
924 /* image tab */ | |
925 static void config_tab_image(GtkWidget *notebook) | |
926 { | |
927 GtkWidget *label; | |
928 GtkWidget *hbox; | |
929 GtkWidget *vbox; | |
930 GtkWidget *group; | |
931 GtkWidget *button; | |
932 GtkWidget *ct_button; | |
933 GtkWidget *table; | |
934 GtkWidget *spin; | |
935 | |
936 vbox = gtk_vbox_new(FALSE, 0); | |
937 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | |
938 gtk_widget_show(vbox); | |
939 label = gtk_label_new(_("Image")); | |
940 gtk_notebook_append_page (GTK_NOTEBOOK(notebook), vbox, label); | |
941 | |
942 group = pref_group_new(vbox, FALSE, _("Zoom"), GTK_ORIENTATION_VERTICAL); | |
943 | |
944 #if 0 | |
945 add_dither_menu(dither_quality, &dither_quality_c, _("Dithering method:"), group); | |
946 #endif | |
947 table = pref_table_new(group, 2, 1, FALSE, FALSE); | |
948 add_quality_menu(table, 0, 0, _("Quality:"), zoom_quality, &zoom_quality_c); | |
949 | |
950 pref_checkbox_new_int(group, _("Two pass zooming"), | |
951 two_pass_zoom, &two_pass_zoom_c); | |
952 | |
953 pref_checkbox_new_int(group, _("Allow enlargement of image for zoom to fit"), | |
954 zoom_to_fit_expands, &zoom_to_fit_expands_c); | |
955 | |
956 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
957 ct_button = pref_checkbox_new_int(hbox, _("Limit image size when autofitting (%):"), | |
958 limit_autofit_size, &limit_autofit_size_c); | |
959 spin = pref_spin_new_int(hbox, NULL, NULL, | |
960 10, 150, 1, | |
961 max_autofit_size, &max_autofit_size_c); | |
962 pref_checkbox_link_sensitivity(ct_button, spin); | |
963 | |
964 zoom_increment_c = zoom_increment; | |
965 spin = pref_spin_new(group, _("Zoom increment:"), NULL, | |
966 0.1, 4.0, 0.1, 1, (double)zoom_increment / 10.0, | |
967 G_CALLBACK(zoom_increment_cb), NULL); | |
968 gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS); | |
969 | |
970 group = pref_group_new(vbox, FALSE, _("When new image is selected:"), GTK_ORIENTATION_VERTICAL); | |
971 | |
972 zoom_mode_c = zoom_mode; | |
973 button = pref_radiobutton_new(group, NULL, _("Zoom to original size"), | |
974 (zoom_mode == ZOOM_RESET_ORIGINAL), | |
975 G_CALLBACK(zoom_mode_original_cb), NULL); | |
976 button = pref_radiobutton_new(group, button, _("Fit image to window"), | |
977 (zoom_mode == ZOOM_RESET_FIT_WINDOW), | |
978 G_CALLBACK(zoom_mode_fit_cb), NULL); | |
979 button = pref_radiobutton_new(group, button, _("Leave Zoom at previous setting"), | |
980 (zoom_mode == ZOOM_RESET_NONE), | |
981 G_CALLBACK(zoom_mode_none_cb), NULL); | |
982 | |
983 group = pref_group_new(vbox, FALSE, _("Appearance"), GTK_ORIENTATION_VERTICAL); | |
984 | |
985 pref_checkbox_new_int(group, _("User specified background color"), | |
986 user_specified_window_background, &user_specified_window_background_c); | |
987 | |
988 pref_colorbutton_new(group, _("Background color"), &window_background_color, | |
989 G_CALLBACK(pref_background_color_set_cb), &window_background_color_c); | |
990 | |
991 group = pref_group_new(vbox, FALSE, _("Convenience"), GTK_ORIENTATION_VERTICAL); | |
992 | |
993 pref_checkbox_new_int(group, _("Refresh on file change"), | |
994 update_on_time_change, &update_on_time_change_c); | |
995 pref_checkbox_new_int(group, _("Preload next image"), | |
996 enable_read_ahead, &enable_read_ahead_c); | |
997 pref_checkbox_new_int(group, _("Auto rotate image using Exif information"), | |
998 exif_rotate_enable, &exif_rotate_enable_c); | |
999 } | |
1000 | |
1001 /* windows tab */ | |
1002 static void config_tab_windows(GtkWidget *notebook) | |
1003 { | |
1004 GtkWidget *label; | |
1005 GtkWidget *hbox; | |
1006 GtkWidget *vbox; | |
1007 GtkWidget *group; | |
1008 GtkWidget *button; | |
1009 GtkWidget *ct_button; | |
1010 GtkWidget *spin; | |
1011 | |
1012 vbox = gtk_vbox_new(FALSE, 0); | |
1013 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | |
1014 gtk_widget_show(vbox); | |
1015 label = gtk_label_new(_("Windows")); | |
1016 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, label); | |
1017 | |
1018 group = pref_group_new(vbox, FALSE, _("State"), GTK_ORIENTATION_VERTICAL); | |
1019 | |
1020 pref_checkbox_new_int(group, _("Remember window positions"), | |
1021 save_window_positions, &save_window_positions_c); | |
1022 pref_checkbox_new_int(group, _("Remember tool state (float/hidden)"), | |
1023 restore_tool, &restore_tool_c); | |
1024 | |
1025 group = pref_group_new(vbox, FALSE, _("Size"), GTK_ORIENTATION_VERTICAL); | |
1026 | |
1027 pref_checkbox_new_int(group, _("Fit window to image when tools are hidden/floating"), | |
1028 fit_window, &fit_window_c); | |
1029 | |
1030 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
1031 ct_button = pref_checkbox_new_int(hbox, _("Limit size when auto-sizing window (%):"), | |
1032 limit_window_size, &limit_window_size_c); | |
1033 spin = pref_spin_new_int(hbox, NULL, NULL, | |
1034 10, 150, 1, | |
1035 max_window_size, &max_window_size_c); | |
1036 pref_checkbox_link_sensitivity(ct_button, spin); | |
1037 | |
1038 group = pref_group_new(vbox, FALSE, _("Layout"), GTK_ORIENTATION_VERTICAL); | |
1039 | |
1040 layout_widget = layout_config_new(); | |
1041 layout_config_set(layout_widget, layout_style, layout_order); | |
1042 gtk_box_pack_start(GTK_BOX(group), layout_widget, FALSE, FALSE, 0); | |
1043 gtk_widget_show(layout_widget); | |
1044 } | |
1045 | |
1046 /* filtering tab */ | |
1047 static void config_tab_filtering(GtkWidget *notebook) | |
1048 { | |
1049 GtkWidget *hbox; | |
851 GtkWidget *frame; | 1050 GtkWidget *frame; |
852 GtkWidget *label; | 1051 GtkWidget *label; |
853 GtkWidget *vbox; | 1052 GtkWidget *vbox; |
854 GtkWidget *group; | 1053 GtkWidget *group; |
855 GtkWidget *subgroup; | 1054 GtkWidget *subgroup; |
859 GtkWidget *table; | 1058 GtkWidget *table; |
860 GtkWidget *spin; | 1059 GtkWidget *spin; |
861 GtkWidget *scrolled; | 1060 GtkWidget *scrolled; |
862 GtkWidget *viewport; | 1061 GtkWidget *viewport; |
863 GtkWidget *filter_view; | 1062 GtkWidget *filter_view; |
864 GtkWidget *fullscreen_info_view; | |
865 GtkCellRenderer *renderer; | 1063 GtkCellRenderer *renderer; |
866 GtkTreeSelection *selection; | 1064 GtkTreeSelection *selection; |
867 GtkTreeViewColumn *column; | 1065 GtkTreeViewColumn *column; |
868 GtkTextBuffer *buffer; | |
869 gint i; | |
870 | |
871 configwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
872 gtk_window_set_type_hint(GTK_WINDOW(configwindow), GDK_WINDOW_TYPE_HINT_DIALOG); | |
873 g_signal_connect(G_OBJECT (configwindow), "delete_event", | |
874 G_CALLBACK(config_window_delete), NULL); | |
875 gtk_window_set_default_size(GTK_WINDOW(configwindow), CONFIG_WINDOW_DEF_WIDTH, CONFIG_WINDOW_DEF_HEIGHT); | |
876 gtk_window_set_resizable(GTK_WINDOW(configwindow), TRUE); | |
877 gtk_window_set_title(GTK_WINDOW(configwindow), _("Geeqie Preferences")); | |
878 gtk_window_set_wmclass(GTK_WINDOW(configwindow), "config", "Geeqie"); | |
879 gtk_container_set_border_width(GTK_CONTAINER(configwindow), PREF_PAD_BORDER); | |
880 | |
881 window_set_icon(configwindow, PIXBUF_INLINE_ICON_CONFIG, NULL); | |
882 | |
883 win_vbox = gtk_vbox_new(FALSE, PREF_PAD_SPACE); | |
884 gtk_container_add(GTK_CONTAINER(configwindow), win_vbox); | |
885 gtk_widget_show(win_vbox); | |
886 | |
887 hbox = gtk_hbutton_box_new(); | |
888 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_END); | |
889 gtk_box_set_spacing(GTK_BOX(hbox), PREF_PAD_BUTTON_GAP); | |
890 gtk_box_pack_end(GTK_BOX(win_vbox), hbox, FALSE, FALSE, 0); | |
891 gtk_widget_show(hbox); | |
892 | |
893 button = pref_button_new(NULL, GTK_STOCK_OK, NULL, FALSE, | |
894 G_CALLBACK(config_window_ok_cb), NULL); | |
895 gtk_container_add(GTK_CONTAINER(hbox), button); | |
896 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
897 gtk_widget_grab_default(button); | |
898 gtk_widget_show(button); | |
899 | |
900 ct_button = button; | |
901 | |
902 button = pref_button_new(NULL, GTK_STOCK_APPLY, NULL, FALSE, | |
903 G_CALLBACK(config_window_apply_cb), NULL); | |
904 gtk_container_add(GTK_CONTAINER(hbox), button); | |
905 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
906 gtk_widget_show(button); | |
907 | |
908 button = pref_button_new(NULL, GTK_STOCK_CANCEL, NULL, FALSE, | |
909 G_CALLBACK(config_window_close_cb), NULL); | |
910 gtk_container_add(GTK_CONTAINER(hbox), button); | |
911 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
912 gtk_widget_show(button); | |
913 | |
914 if (!generic_dialog_get_alternative_button_order(configwindow)) | |
915 { | |
916 gtk_box_reorder_child(GTK_BOX(hbox), ct_button, -1); | |
917 } | |
918 | |
919 notebook = gtk_notebook_new(); | |
920 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(notebook), GTK_POS_TOP); | |
921 gtk_box_pack_start(GTK_BOX(win_vbox), notebook, TRUE, TRUE, 0); | |
922 | |
923 /* general options tab */ | |
924 | |
925 vbox = gtk_vbox_new(FALSE, 0); | |
926 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | |
927 gtk_widget_show(vbox); | |
928 label = gtk_label_new(_("General")); | |
929 gtk_notebook_append_page (GTK_NOTEBOOK(notebook), vbox, label); | |
930 | |
931 group = pref_group_new(vbox, FALSE, _("Startup"), GTK_ORIENTATION_VERTICAL); | |
932 | |
933 button = pref_checkbox_new_int(group, _("Change to folder:"), | |
934 startup_path_enable, &startup_path_enable_c); | |
935 | |
936 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
937 pref_checkbox_link_sensitivity(button, hbox); | |
938 | |
939 tabcomp = tab_completion_new(&startup_path_entry, startup_path, NULL, NULL); | |
940 tab_completion_add_select_button(startup_path_entry, NULL, TRUE); | |
941 gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0); | |
942 gtk_widget_show(tabcomp); | |
943 | |
944 button = pref_button_new(hbox, NULL, _("Use current"), FALSE, | |
945 G_CALLBACK(startup_path_set_current), NULL); | |
946 | |
947 group = pref_group_new(vbox, FALSE, _("Thumbnails"), GTK_ORIENTATION_VERTICAL); | |
948 | |
949 table = pref_table_new(group, 2, 2, FALSE, FALSE); | |
950 add_thumb_size_menu(table, 0, 0, _("Size:")); | |
951 add_quality_menu(table, 0, 1, _("Quality:"), thumbnail_quality, &thumbnail_quality_c); | |
952 | |
953 ct_button = pref_checkbox_new_int(group, _("Cache thumbnails"), | |
954 enable_thumb_caching, &enable_thumb_caching_c); | |
955 | |
956 subgroup = pref_box_new(group, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | |
957 pref_checkbox_link_sensitivity(ct_button, subgroup); | |
958 | |
959 button = pref_checkbox_new_int(subgroup, _("Use shared thumbnail cache"), | |
960 thumbnail_spec_standard, &thumbnail_spec_standard_c); | |
961 | |
962 subgroup = pref_box_new(subgroup, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | |
963 pref_checkbox_link_sensitivity_swap(button, subgroup); | |
964 | |
965 pref_checkbox_new_int(subgroup, _("Cache thumbnails into .thumbnails"), | |
966 enable_thumb_dirs, &enable_thumb_dirs_c); | |
967 | |
968 #if 0 | |
969 pref_checkbox_new_int(subgroup, _("Use xvpics thumbnails when found (read only)"), | |
970 use_xvpics_thumbnails, &use_xvpics_thumbnails_c); | |
971 #endif | |
972 | |
973 pref_checkbox_new_int(group, _("Faster jpeg thumbnailing (may reduce quality)"), | |
974 thumbnail_fast, &thumbnail_fast_c); | |
975 | |
976 group = pref_group_new(vbox, FALSE, _("Slide show"), GTK_ORIENTATION_VERTICAL); | |
977 | |
978 slideshow_delay_c = slideshow_delay; | |
979 spin = pref_spin_new(group, _("Delay between image change:"), _("seconds"), | |
980 SLIDESHOW_MIN_SECONDS, SLIDESHOW_MAX_SECONDS, 1.0, 1, | |
981 slideshow_delay ? (double)slideshow_delay / SLIDESHOW_SUBSECOND_PRECISION : 10.0, | |
982 G_CALLBACK(slideshow_delay_cb), NULL); | |
983 gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS); | |
984 | |
985 pref_checkbox_new_int(group, _("Random"), slideshow_random, &slideshow_random_c); | |
986 pref_checkbox_new_int(group, _("Repeat"), slideshow_repeat, &slideshow_repeat_c); | |
987 | |
988 /* image tab */ | |
989 | |
990 vbox = gtk_vbox_new(FALSE, 0); | |
991 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | |
992 gtk_widget_show(vbox); | |
993 label = gtk_label_new(_("Image")); | |
994 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label); | |
995 | |
996 group = pref_group_new(vbox, FALSE, _("Zoom"), GTK_ORIENTATION_VERTICAL); | |
997 | |
998 #if 0 | |
999 add_dither_menu(dither_quality, &dither_quality_c, _("Dithering method:"), group); | |
1000 #endif | |
1001 table = pref_table_new(group, 2, 1, FALSE, FALSE); | |
1002 add_quality_menu(table, 0, 0, _("Quality:"), zoom_quality, &zoom_quality_c); | |
1003 | |
1004 pref_checkbox_new_int(group, _("Two pass zooming"), | |
1005 two_pass_zoom, &two_pass_zoom_c); | |
1006 | |
1007 pref_checkbox_new_int(group, _("Allow enlargement of image for zoom to fit"), | |
1008 zoom_to_fit_expands, &zoom_to_fit_expands_c); | |
1009 | |
1010 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
1011 ct_button = pref_checkbox_new_int(hbox, _("Limit image size when autofitting (%):"), | |
1012 limit_autofit_size, &limit_autofit_size_c); | |
1013 spin = pref_spin_new_int(hbox, NULL, NULL, | |
1014 10, 150, 1, | |
1015 max_autofit_size, &max_autofit_size_c); | |
1016 pref_checkbox_link_sensitivity(ct_button, spin); | |
1017 | |
1018 zoom_increment_c = zoom_increment; | |
1019 spin = pref_spin_new(group, _("Zoom increment:"), NULL, | |
1020 0.1, 4.0, 0.1, 1, (double)zoom_increment / 10.0, | |
1021 G_CALLBACK(zoom_increment_cb), NULL); | |
1022 gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS); | |
1023 | |
1024 group = pref_group_new(vbox, FALSE, _("When new image is selected:"), GTK_ORIENTATION_VERTICAL); | |
1025 | |
1026 zoom_mode_c = zoom_mode; | |
1027 button = pref_radiobutton_new(group, NULL, _("Zoom to original size"), | |
1028 (zoom_mode == ZOOM_RESET_ORIGINAL), | |
1029 G_CALLBACK(zoom_mode_original_cb), NULL); | |
1030 button = pref_radiobutton_new(group, button, _("Fit image to window"), | |
1031 (zoom_mode == ZOOM_RESET_FIT_WINDOW), | |
1032 G_CALLBACK(zoom_mode_fit_cb), NULL); | |
1033 button = pref_radiobutton_new(group, button, _("Leave Zoom at previous setting"), | |
1034 (zoom_mode == ZOOM_RESET_NONE), | |
1035 G_CALLBACK(zoom_mode_none_cb), NULL); | |
1036 | |
1037 group = pref_group_new(vbox, FALSE, _("Appearance"), GTK_ORIENTATION_VERTICAL); | |
1038 | |
1039 pref_checkbox_new_int(group, _("User specified background color"), | |
1040 user_specified_window_background, &user_specified_window_background_c); | |
1041 | |
1042 pref_colorbutton_new(group, _("Background color"), &window_background_color, | |
1043 G_CALLBACK(pref_background_color_set_cb), &window_background_color_c); | |
1044 | |
1045 group = pref_group_new(vbox, FALSE, _("Convenience"), GTK_ORIENTATION_VERTICAL); | |
1046 | |
1047 pref_checkbox_new_int(group, _("Refresh on file change"), | |
1048 update_on_time_change, &update_on_time_change_c); | |
1049 pref_checkbox_new_int(group, _("Preload next image"), | |
1050 enable_read_ahead, &enable_read_ahead_c); | |
1051 pref_checkbox_new_int(group, _("Auto rotate image using Exif information"), | |
1052 exif_rotate_enable, &exif_rotate_enable_c); | |
1053 | |
1054 | |
1055 /* window tab */ | |
1056 | |
1057 vbox = gtk_vbox_new(FALSE, 0); | |
1058 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | |
1059 gtk_widget_show(vbox); | |
1060 label = gtk_label_new(_("Windows")); | |
1061 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, label); | |
1062 | |
1063 group = pref_group_new(vbox, FALSE, _("State"), GTK_ORIENTATION_VERTICAL); | |
1064 | |
1065 pref_checkbox_new_int(group, _("Remember window positions"), | |
1066 save_window_positions, &save_window_positions_c); | |
1067 pref_checkbox_new_int(group, _("Remember tool state (float/hidden)"), | |
1068 restore_tool, &restore_tool_c); | |
1069 | |
1070 group = pref_group_new(vbox, FALSE, _("Size"), GTK_ORIENTATION_VERTICAL); | |
1071 | |
1072 pref_checkbox_new_int(group, _("Fit window to image when tools are hidden/floating"), | |
1073 fit_window, &fit_window_c); | |
1074 | |
1075 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
1076 ct_button = pref_checkbox_new_int(hbox, _("Limit size when auto-sizing window (%):"), | |
1077 limit_window_size, &limit_window_size_c); | |
1078 spin = pref_spin_new_int(hbox, NULL, NULL, | |
1079 10, 150, 1, | |
1080 max_window_size, &max_window_size_c); | |
1081 pref_checkbox_link_sensitivity(ct_button, spin); | |
1082 | |
1083 group = pref_group_new(vbox, FALSE, _("Layout"), GTK_ORIENTATION_VERTICAL); | |
1084 | |
1085 layout_widget = layout_config_new(); | |
1086 layout_config_set(layout_widget, layout_style, layout_order); | |
1087 gtk_box_pack_start(GTK_BOX(group), layout_widget, FALSE, FALSE, 0); | |
1088 gtk_widget_show(layout_widget); | |
1089 | |
1090 | |
1091 /* filtering tab */ | |
1092 | 1066 |
1093 vbox = gtk_vbox_new(FALSE, 0); | 1067 vbox = gtk_vbox_new(FALSE, 0); |
1094 gtk_container_set_border_width(GTK_CONTAINER (vbox), PREF_PAD_BORDER); | 1068 gtk_container_set_border_width(GTK_CONTAINER (vbox), PREF_PAD_BORDER); |
1095 gtk_widget_show(vbox); | 1069 gtk_widget_show(vbox); |
1096 label = gtk_label_new(_("Filtering")); | 1070 label = gtk_label_new(_("Filtering")); |
1185 | 1159 |
1186 button = pref_button_new(NULL, GTK_STOCK_ADD, NULL, FALSE, | 1160 button = pref_button_new(NULL, GTK_STOCK_ADD, NULL, FALSE, |
1187 G_CALLBACK(filter_add_cb), NULL); | 1161 G_CALLBACK(filter_add_cb), NULL); |
1188 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | 1162 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1189 gtk_widget_show(button); | 1163 gtk_widget_show(button); |
1190 | 1164 } |
1191 | 1165 |
1192 /* editor entry tab */ | 1166 /* editors tab */ |
1167 static void config_tab_editors(GtkWidget *notebook) | |
1168 { | |
1169 GtkWidget *hbox; | |
1170 GtkWidget *label; | |
1171 GtkWidget *vbox; | |
1172 GtkWidget *button; | |
1173 GtkWidget *table; | |
1174 gint i; | |
1193 | 1175 |
1194 vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP); | 1176 vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP); |
1195 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | 1177 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); |
1196 gtk_widget_show(vbox); | 1178 gtk_widget_show(vbox); |
1197 label = gtk_label_new(_("Editors")); | 1179 label = gtk_label_new(_("Editors")); |
1258 | 1240 |
1259 button = pref_button_new(NULL, GTK_STOCK_HELP, NULL, FALSE, | 1241 button = pref_button_new(NULL, GTK_STOCK_HELP, NULL, FALSE, |
1260 G_CALLBACK(editor_help_cb), NULL); | 1242 G_CALLBACK(editor_help_cb), NULL); |
1261 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | 1243 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1262 gtk_widget_show(button); | 1244 gtk_widget_show(button); |
1263 | 1245 } |
1264 /* exif tab */ | 1246 |
1247 /* exif tab */ | |
1248 static void config_tab_exif(GtkWidget *notebook) | |
1249 { | |
1250 GtkWidget *label; | |
1251 GtkWidget *vbox; | |
1252 GtkWidget *group; | |
1253 GtkWidget *table; | |
1254 GtkWidget *scrolled; | |
1255 GtkWidget *viewport; | |
1256 gint i; | |
1265 | 1257 |
1266 scrolled = gtk_scrolled_window_new(NULL, NULL); | 1258 scrolled = gtk_scrolled_window_new(NULL, NULL); |
1267 gtk_container_set_border_width(GTK_CONTAINER(scrolled), PREF_PAD_BORDER); | 1259 gtk_container_set_border_width(GTK_CONTAINER(scrolled), PREF_PAD_BORDER); |
1268 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), | 1260 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), |
1269 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | 1261 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); |
1292 | 1284 |
1293 title = exif_get_description_by_key(ExifUIList[i].key); | 1285 title = exif_get_description_by_key(ExifUIList[i].key); |
1294 exif_item(table, 0, i, title, ExifUIList[i].current, | 1286 exif_item(table, 0, i, title, ExifUIList[i].current, |
1295 &ExifUIList[i].temp); | 1287 &ExifUIList[i].temp); |
1296 } | 1288 } |
1297 | 1289 } |
1298 /* advanced entry tab */ | 1290 |
1291 /* advanced entry tab */ | |
1292 static void config_tab_advanced(GtkWidget *notebook) | |
1293 { | |
1294 GtkWidget *label; | |
1295 GtkWidget *hbox; | |
1296 GtkWidget *vbox; | |
1297 GtkWidget *group; | |
1298 GtkWidget *button; | |
1299 GtkWidget *tabcomp; | |
1300 GtkWidget *ct_button; | |
1301 GtkWidget *table; | |
1302 GtkWidget *spin; | |
1303 GtkWidget *scrolled; | |
1304 GtkWidget *viewport; | |
1305 GtkWidget *fullscreen_info_view; | |
1306 GtkTextBuffer *buffer; | |
1307 gint i; | |
1299 | 1308 |
1300 scrolled = gtk_scrolled_window_new(NULL, NULL); | 1309 scrolled = gtk_scrolled_window_new(NULL, NULL); |
1301 gtk_container_set_border_width(GTK_CONTAINER(scrolled), PREF_PAD_BORDER); | 1310 gtk_container_set_border_width(GTK_CONTAINER(scrolled), PREF_PAD_BORDER); |
1302 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), | 1311 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), |
1303 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | 1312 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); |
1485 group = pref_group_new(vbox, FALSE, _("Debugging"), GTK_ORIENTATION_VERTICAL); | 1494 group = pref_group_new(vbox, FALSE, _("Debugging"), GTK_ORIENTATION_VERTICAL); |
1486 | 1495 |
1487 pref_spin_new_int(group, _("Debug level:"), NULL, | 1496 pref_spin_new_int(group, _("Debug level:"), NULL, |
1488 0, 9, 1, debug, &debug_c); | 1497 0, 9, 1, debug, &debug_c); |
1489 #endif | 1498 #endif |
1499 } | |
1500 | |
1501 /* Main preferences window */ | |
1502 static void config_window_create(void) | |
1503 { | |
1504 GtkWidget *win_vbox; | |
1505 GtkWidget *hbox; | |
1506 GtkWidget *notebook; | |
1507 GtkWidget *button; | |
1508 GtkWidget *ct_button; | |
1509 | |
1510 configwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
1511 gtk_window_set_type_hint(GTK_WINDOW(configwindow), GDK_WINDOW_TYPE_HINT_DIALOG); | |
1512 g_signal_connect(G_OBJECT (configwindow), "delete_event", | |
1513 G_CALLBACK(config_window_delete), NULL); | |
1514 gtk_window_set_default_size(GTK_WINDOW(configwindow), CONFIG_WINDOW_DEF_WIDTH, CONFIG_WINDOW_DEF_HEIGHT); | |
1515 gtk_window_set_resizable(GTK_WINDOW(configwindow), TRUE); | |
1516 gtk_window_set_title(GTK_WINDOW(configwindow), _("Geeqie Preferences")); | |
1517 gtk_window_set_wmclass(GTK_WINDOW(configwindow), "config", "Geeqie"); | |
1518 gtk_container_set_border_width(GTK_CONTAINER(configwindow), PREF_PAD_BORDER); | |
1519 | |
1520 window_set_icon(configwindow, PIXBUF_INLINE_ICON_CONFIG, NULL); | |
1521 | |
1522 win_vbox = gtk_vbox_new(FALSE, PREF_PAD_SPACE); | |
1523 gtk_container_add(GTK_CONTAINER(configwindow), win_vbox); | |
1524 gtk_widget_show(win_vbox); | |
1525 | |
1526 hbox = gtk_hbutton_box_new(); | |
1527 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_END); | |
1528 gtk_box_set_spacing(GTK_BOX(hbox), PREF_PAD_BUTTON_GAP); | |
1529 gtk_box_pack_end(GTK_BOX(win_vbox), hbox, FALSE, FALSE, 0); | |
1530 gtk_widget_show(hbox); | |
1531 | |
1532 button = pref_button_new(NULL, GTK_STOCK_OK, NULL, FALSE, | |
1533 G_CALLBACK(config_window_ok_cb), NULL); | |
1534 gtk_container_add(GTK_CONTAINER(hbox), button); | |
1535 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
1536 gtk_widget_grab_default(button); | |
1537 gtk_widget_show(button); | |
1538 | |
1539 ct_button = button; | |
1540 | |
1541 button = pref_button_new(NULL, GTK_STOCK_APPLY, NULL, FALSE, | |
1542 G_CALLBACK(config_window_apply_cb), NULL); | |
1543 gtk_container_add(GTK_CONTAINER(hbox), button); | |
1544 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
1545 gtk_widget_show(button); | |
1546 | |
1547 button = pref_button_new(NULL, GTK_STOCK_CANCEL, NULL, FALSE, | |
1548 G_CALLBACK(config_window_close_cb), NULL); | |
1549 gtk_container_add(GTK_CONTAINER(hbox), button); | |
1550 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
1551 gtk_widget_show(button); | |
1552 | |
1553 if (!generic_dialog_get_alternative_button_order(configwindow)) | |
1554 { | |
1555 gtk_box_reorder_child(GTK_BOX(hbox), ct_button, -1); | |
1556 } | |
1557 | |
1558 notebook = gtk_notebook_new(); | |
1559 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(notebook), GTK_POS_TOP); | |
1560 gtk_box_pack_start(GTK_BOX(win_vbox), notebook, TRUE, TRUE, 0); | |
1561 | |
1562 config_tab_general(notebook); | |
1563 config_tab_image(notebook); | |
1564 config_tab_windows(notebook); | |
1565 config_tab_filtering(notebook); | |
1566 config_tab_editors(notebook); | |
1567 config_tab_exif(notebook); | |
1568 config_tab_advanced(notebook); | |
1490 | 1569 |
1491 gtk_widget_show(notebook); | 1570 gtk_widget_show(notebook); |
1492 | 1571 |
1493 gtk_widget_show(configwindow); | 1572 gtk_widget_show(configwindow); |
1494 } | 1573 } |