Mercurial > geeqie
comparison src/preferences.c @ 334:df868b947aa0
Rename image-related options.
author | zas_ |
---|---|
date | Sat, 12 Apr 2008 15:04:58 +0000 |
parents | 767b53cd9ab7 |
children | 41c3cb73120f |
comparison
equal
deleted
inserted
replaced
333:767b53cd9ab7 | 334:df868b947aa0 |
---|---|
109 } | 109 } |
110 | 110 |
111 static void zoom_mode_original_cb(GtkWidget *widget, gpointer data) | 111 static void zoom_mode_original_cb(GtkWidget *widget, gpointer data) |
112 { | 112 { |
113 if (GTK_TOGGLE_BUTTON (widget)->active) | 113 if (GTK_TOGGLE_BUTTON (widget)->active) |
114 c_options->zoom_mode = ZOOM_RESET_ORIGINAL; | 114 c_options->image.zoom_mode = ZOOM_RESET_ORIGINAL; |
115 } | 115 } |
116 | 116 |
117 static void zoom_mode_fit_cb(GtkWidget *widget, gpointer data) | 117 static void zoom_mode_fit_cb(GtkWidget *widget, gpointer data) |
118 { | 118 { |
119 if (GTK_TOGGLE_BUTTON (widget)->active) | 119 if (GTK_TOGGLE_BUTTON (widget)->active) |
120 c_options->zoom_mode = ZOOM_RESET_FIT_WINDOW; | 120 c_options->image.zoom_mode = ZOOM_RESET_FIT_WINDOW; |
121 } | 121 } |
122 | 122 |
123 static void zoom_mode_none_cb(GtkWidget *widget, gpointer data) | 123 static void zoom_mode_none_cb(GtkWidget *widget, gpointer data) |
124 { | 124 { |
125 if (GTK_TOGGLE_BUTTON (widget)->active) | 125 if (GTK_TOGGLE_BUTTON (widget)->active) |
126 c_options->zoom_mode = ZOOM_RESET_NONE; | 126 c_options->image.zoom_mode = ZOOM_RESET_NONE; |
127 } | 127 } |
128 | 128 |
129 static void zoom_increment_cb(GtkWidget *spin, gpointer data) | 129 static void zoom_increment_cb(GtkWidget *spin, gpointer data) |
130 { | 130 { |
131 c_options->zoom_increment = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * 10.0 + 0.01); | 131 c_options->image.zoom_increment = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * 10.0 + 0.01); |
132 } | 132 } |
133 | 133 |
134 static void slideshow_delay_cb(GtkWidget *spin, gpointer data) | 134 static void slideshow_delay_cb(GtkWidget *spin, gpointer data) |
135 { | 135 { |
136 c_options->slideshow.delay = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * | 136 c_options->slideshow.delay = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * |
187 options->enable_delete_key = c_options->enable_delete_key; | 187 options->enable_delete_key = c_options->enable_delete_key; |
188 options->safe_delete_enable = c_options->safe_delete_enable; | 188 options->safe_delete_enable = c_options->safe_delete_enable; |
189 options->safe_delete_size = c_options->safe_delete_size; | 189 options->safe_delete_size = c_options->safe_delete_size; |
190 options->restore_tool = c_options->restore_tool; | 190 options->restore_tool = c_options->restore_tool; |
191 options->save_window_positions = c_options->save_window_positions; | 191 options->save_window_positions = c_options->save_window_positions; |
192 options->zoom_mode = c_options->zoom_mode; | 192 options->image.zoom_mode = c_options->image.zoom_mode; |
193 options->two_pass_zoom = c_options->two_pass_zoom; | 193 options->image.zoom_2pass = c_options->image.zoom_2pass; |
194 options->fit_window = c_options->fit_window; | 194 options->image.fit_window_to_image = c_options->image.fit_window_to_image; |
195 options->limit_window_size = c_options->limit_window_size; | 195 options->image.limit_window_size = c_options->image.limit_window_size; |
196 options->zoom_to_fit_expands = c_options->zoom_to_fit_expands; | 196 options->image.zoom_to_fit_allow_expand = c_options->image.zoom_to_fit_allow_expand; |
197 options->max_window_size = c_options->max_window_size; | 197 options->image.max_window_size = c_options->image.max_window_size; |
198 options->limit_autofit_size = c_options->limit_autofit_size; | 198 options->image.limit_autofit_size = c_options->image.limit_autofit_size; |
199 options->max_autofit_size = c_options->max_autofit_size; | 199 options->image.max_autofit_size = c_options->image.max_autofit_size; |
200 options->progressive_key_scrolling = c_options->progressive_key_scrolling; | 200 options->progressive_key_scrolling = c_options->progressive_key_scrolling; |
201 options->thumbnails.max_width = c_options->thumbnails.max_width; | 201 options->thumbnails.max_width = c_options->thumbnails.max_width; |
202 options->thumbnails.max_height = c_options->thumbnails.max_height; | 202 options->thumbnails.max_height = c_options->thumbnails.max_height; |
203 options->thumbnails.enable_caching = c_options->thumbnails.enable_caching; | 203 options->thumbnails.enable_caching = c_options->thumbnails.enable_caching; |
204 options->thumbnails.cache_into_dirs = c_options->thumbnails.cache_into_dirs; | 204 options->thumbnails.cache_into_dirs = c_options->thumbnails.cache_into_dirs; |
222 | 222 |
223 options->enable_in_place_rename = c_options->enable_in_place_rename; | 223 options->enable_in_place_rename = c_options->enable_in_place_rename; |
224 | 224 |
225 options->collections.rectangular_selection = c_options->collections.rectangular_selection; | 225 options->collections.rectangular_selection = c_options->collections.rectangular_selection; |
226 | 226 |
227 options->tile_cache_max = c_options->tile_cache_max; | 227 options->image.tile_cache_max = c_options->image.tile_cache_max; |
228 | 228 |
229 options->thumbnails.quality = c_options->thumbnails.quality; | 229 options->thumbnails.quality = c_options->thumbnails.quality; |
230 options->zoom_quality = c_options->zoom_quality; | 230 options->image.zoom_quality = c_options->image.zoom_quality; |
231 | 231 |
232 options->zoom_increment = c_options->zoom_increment; | 232 options->image.zoom_increment = c_options->image.zoom_increment; |
233 | 233 |
234 options->enable_read_ahead = c_options->enable_read_ahead; | 234 options->image.enable_read_ahead = c_options->image.enable_read_ahead; |
235 | 235 |
236 if (options->user_specified_window_background != c_options->user_specified_window_background | 236 if (options->user_specified_window_background != c_options->user_specified_window_background |
237 || !gdk_color_equal(&options->window_background_color, &c_options->window_background_color)) | 237 || !gdk_color_equal(&options->window_background_color, &c_options->window_background_color)) |
238 { | 238 { |
239 options->user_specified_window_background = c_options->user_specified_window_background; | 239 options->user_specified_window_background = c_options->user_specified_window_background; |
252 g_free(options->fullscreen.info); | 252 g_free(options->fullscreen.info); |
253 options->fullscreen.info = g_strdup(c_options->fullscreen.info); | 253 options->fullscreen.info = g_strdup(c_options->fullscreen.info); |
254 } | 254 } |
255 | 255 |
256 options->update_on_time_change = c_options->update_on_time_change; | 256 options->update_on_time_change = c_options->update_on_time_change; |
257 options->exif_rotate_enable = c_options->exif_rotate_enable; | 257 options->image.exif_rotate_enable = c_options->image.exif_rotate_enable; |
258 | 258 |
259 options->dupe_custom_threshold = c_options->dupe_custom_threshold; | 259 options->dupe_custom_threshold = c_options->dupe_custom_threshold; |
260 | 260 |
261 options->tree_descend_subdirs = c_options->tree_descend_subdirs; | 261 options->tree_descend_subdirs = c_options->tree_descend_subdirs; |
262 #ifdef DEBUG | 262 #ifdef DEBUG |
877 gtk_notebook_append_page (GTK_NOTEBOOK(notebook), vbox, label); | 877 gtk_notebook_append_page (GTK_NOTEBOOK(notebook), vbox, label); |
878 | 878 |
879 group = pref_group_new(vbox, FALSE, _("Zoom"), GTK_ORIENTATION_VERTICAL); | 879 group = pref_group_new(vbox, FALSE, _("Zoom"), GTK_ORIENTATION_VERTICAL); |
880 | 880 |
881 #if 0 | 881 #if 0 |
882 add_dither_menu(dither_quality, &c_options->dither_quality, _("Dithering method:"), group); | 882 add_dither_menu(dither_quality, &c_options->image.dither_quality, _("Dithering method:"), group); |
883 #endif | 883 #endif |
884 table = pref_table_new(group, 2, 1, FALSE, FALSE); | 884 table = pref_table_new(group, 2, 1, FALSE, FALSE); |
885 add_quality_menu(table, 0, 0, _("Quality:"), options->zoom_quality, &c_options->zoom_quality); | 885 add_quality_menu(table, 0, 0, _("Quality:"), options->image.zoom_quality, &c_options->image.zoom_quality); |
886 | 886 |
887 pref_checkbox_new_int(group, _("Two pass zooming"), | 887 pref_checkbox_new_int(group, _("Two pass zooming"), |
888 options->two_pass_zoom, &c_options->two_pass_zoom); | 888 options->image.zoom_2pass, &c_options->image.zoom_2pass); |
889 | 889 |
890 pref_checkbox_new_int(group, _("Allow enlargement of image for zoom to fit"), | 890 pref_checkbox_new_int(group, _("Allow enlargement of image for zoom to fit"), |
891 options->zoom_to_fit_expands, &c_options->zoom_to_fit_expands); | 891 options->image.zoom_to_fit_allow_expand, &c_options->image.zoom_to_fit_allow_expand); |
892 | 892 |
893 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | 893 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); |
894 ct_button = pref_checkbox_new_int(hbox, _("Limit image size when autofitting (%):"), | 894 ct_button = pref_checkbox_new_int(hbox, _("Limit image size when autofitting (%):"), |
895 options->limit_autofit_size, &c_options->limit_autofit_size); | 895 options->image.limit_autofit_size, &c_options->image.limit_autofit_size); |
896 spin = pref_spin_new_int(hbox, NULL, NULL, | 896 spin = pref_spin_new_int(hbox, NULL, NULL, |
897 10, 150, 1, | 897 10, 150, 1, |
898 options->max_autofit_size, &c_options->max_autofit_size); | 898 options->image.max_autofit_size, &c_options->image.max_autofit_size); |
899 pref_checkbox_link_sensitivity(ct_button, spin); | 899 pref_checkbox_link_sensitivity(ct_button, spin); |
900 | 900 |
901 c_options->zoom_increment = options->zoom_increment; | 901 c_options->image.zoom_increment = options->image.zoom_increment; |
902 spin = pref_spin_new(group, _("Zoom increment:"), NULL, | 902 spin = pref_spin_new(group, _("Zoom increment:"), NULL, |
903 0.1, 4.0, 0.1, 1, (double)options->zoom_increment / 10.0, | 903 0.1, 4.0, 0.1, 1, (double)options->image.zoom_increment / 10.0, |
904 G_CALLBACK(zoom_increment_cb), NULL); | 904 G_CALLBACK(zoom_increment_cb), NULL); |
905 gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS); | 905 gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS); |
906 | 906 |
907 group = pref_group_new(vbox, FALSE, _("When new image is selected:"), GTK_ORIENTATION_VERTICAL); | 907 group = pref_group_new(vbox, FALSE, _("When new image is selected:"), GTK_ORIENTATION_VERTICAL); |
908 | 908 |
909 c_options->zoom_mode = options->zoom_mode; | 909 c_options->image.zoom_mode = options->image.zoom_mode; |
910 button = pref_radiobutton_new(group, NULL, _("Zoom to original size"), | 910 button = pref_radiobutton_new(group, NULL, _("Zoom to original size"), |
911 (options->zoom_mode == ZOOM_RESET_ORIGINAL), | 911 (options->image.zoom_mode == ZOOM_RESET_ORIGINAL), |
912 G_CALLBACK(zoom_mode_original_cb), NULL); | 912 G_CALLBACK(zoom_mode_original_cb), NULL); |
913 button = pref_radiobutton_new(group, button, _("Fit image to window"), | 913 button = pref_radiobutton_new(group, button, _("Fit image to window"), |
914 (options->zoom_mode == ZOOM_RESET_FIT_WINDOW), | 914 (options->image.zoom_mode == ZOOM_RESET_FIT_WINDOW), |
915 G_CALLBACK(zoom_mode_fit_cb), NULL); | 915 G_CALLBACK(zoom_mode_fit_cb), NULL); |
916 button = pref_radiobutton_new(group, button, _("Leave Zoom at previous setting"), | 916 button = pref_radiobutton_new(group, button, _("Leave Zoom at previous setting"), |
917 (options->zoom_mode == ZOOM_RESET_NONE), | 917 (options->image.zoom_mode == ZOOM_RESET_NONE), |
918 G_CALLBACK(zoom_mode_none_cb), NULL); | 918 G_CALLBACK(zoom_mode_none_cb), NULL); |
919 | 919 |
920 group = pref_group_new(vbox, FALSE, _("Appearance"), GTK_ORIENTATION_VERTICAL); | 920 group = pref_group_new(vbox, FALSE, _("Appearance"), GTK_ORIENTATION_VERTICAL); |
921 | 921 |
922 pref_checkbox_new_int(group, _("User specified background color"), | 922 pref_checkbox_new_int(group, _("User specified background color"), |
928 group = pref_group_new(vbox, FALSE, _("Convenience"), GTK_ORIENTATION_VERTICAL); | 928 group = pref_group_new(vbox, FALSE, _("Convenience"), GTK_ORIENTATION_VERTICAL); |
929 | 929 |
930 pref_checkbox_new_int(group, _("Refresh on file change"), | 930 pref_checkbox_new_int(group, _("Refresh on file change"), |
931 options->update_on_time_change, &c_options->update_on_time_change); | 931 options->update_on_time_change, &c_options->update_on_time_change); |
932 pref_checkbox_new_int(group, _("Preload next image"), | 932 pref_checkbox_new_int(group, _("Preload next image"), |
933 options->enable_read_ahead, &c_options->enable_read_ahead); | 933 options->image.enable_read_ahead, &c_options->image.enable_read_ahead); |
934 pref_checkbox_new_int(group, _("Auto rotate image using Exif information"), | 934 pref_checkbox_new_int(group, _("Auto rotate image using Exif information"), |
935 options->exif_rotate_enable, &c_options->exif_rotate_enable); | 935 options->image.exif_rotate_enable, &c_options->image.exif_rotate_enable); |
936 } | 936 } |
937 | 937 |
938 /* windows tab */ | 938 /* windows tab */ |
939 static void config_tab_windows(GtkWidget *notebook) | 939 static void config_tab_windows(GtkWidget *notebook) |
940 { | 940 { |
959 options->restore_tool, &c_options->restore_tool); | 959 options->restore_tool, &c_options->restore_tool); |
960 | 960 |
961 group = pref_group_new(vbox, FALSE, _("Size"), GTK_ORIENTATION_VERTICAL); | 961 group = pref_group_new(vbox, FALSE, _("Size"), GTK_ORIENTATION_VERTICAL); |
962 | 962 |
963 pref_checkbox_new_int(group, _("Fit window to image when tools are hidden/floating"), | 963 pref_checkbox_new_int(group, _("Fit window to image when tools are hidden/floating"), |
964 options->fit_window, &c_options->fit_window); | 964 options->image.fit_window_to_image, &c_options->image.fit_window_to_image); |
965 | 965 |
966 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | 966 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); |
967 ct_button = pref_checkbox_new_int(hbox, _("Limit size when auto-sizing window (%):"), | 967 ct_button = pref_checkbox_new_int(hbox, _("Limit size when auto-sizing window (%):"), |
968 options->limit_window_size, &c_options->limit_window_size); | 968 options->image.limit_window_size, &c_options->image.limit_window_size); |
969 spin = pref_spin_new_int(hbox, NULL, NULL, | 969 spin = pref_spin_new_int(hbox, NULL, NULL, |
970 10, 150, 1, | 970 10, 150, 1, |
971 options->max_window_size, &c_options->max_window_size); | 971 options->image.max_window_size, &c_options->image.max_window_size); |
972 pref_checkbox_link_sensitivity(ct_button, spin); | 972 pref_checkbox_link_sensitivity(ct_button, spin); |
973 | 973 |
974 group = pref_group_new(vbox, FALSE, _("Layout"), GTK_ORIENTATION_VERTICAL); | 974 group = pref_group_new(vbox, FALSE, _("Layout"), GTK_ORIENTATION_VERTICAL); |
975 | 975 |
976 layout_widget = layout_config_new(); | 976 layout_widget = layout_config_new(); |
1372 | 1372 |
1373 pref_spin_new_int(group, _("Custom similarity threshold:"), NULL, | 1373 pref_spin_new_int(group, _("Custom similarity threshold:"), NULL, |
1374 0, 100, 1, options->dupe_custom_threshold, &c_options->dupe_custom_threshold); | 1374 0, 100, 1, options->dupe_custom_threshold, &c_options->dupe_custom_threshold); |
1375 | 1375 |
1376 pref_spin_new_int(group, _("Offscreen cache size (Mb per image):"), NULL, | 1376 pref_spin_new_int(group, _("Offscreen cache size (Mb per image):"), NULL, |
1377 0, 128, 1, options->tile_cache_max, &c_options->tile_cache_max); | 1377 0, 128, 1, options->image.tile_cache_max, &c_options->image.tile_cache_max); |
1378 | 1378 |
1379 group = pref_group_new(vbox, FALSE, _("Color profiles"), GTK_ORIENTATION_VERTICAL); | 1379 group = pref_group_new(vbox, FALSE, _("Color profiles"), GTK_ORIENTATION_VERTICAL); |
1380 #ifndef HAVE_LCMS | 1380 #ifndef HAVE_LCMS |
1381 gtk_widget_set_sensitive(pref_group_parent(group), FALSE); | 1381 gtk_widget_set_sensitive(pref_group_parent(group), FALSE); |
1382 #endif | 1382 #endif |