Mercurial > geeqie.yaz
annotate src/preferences.c @ 513:985fdfebd89e
Remove whitespace between function name and first parenthesis for the sake of consistency. (pass 2)
author | zas_ |
---|---|
date | Thu, 24 Apr 2008 12:47:09 +0000 |
parents | f9bf33be53ff |
children | d84f2210a73c |
rev | line source |
---|---|
9 | 1 /* |
196 | 2 * Geeqie |
67
f63ecca6c087
Fri Oct 13 05:22:43 2006 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
3 * (C) 2006 John Ellis |
475 | 4 * Copyright (C) 2008 The Geeqie Team |
9 | 5 * |
6 * Author: John Ellis | |
7 * | |
8 * This software is released under the GNU General Public License (GNU GPL). | |
9 * Please read the included file COPYING for more information. | |
10 * This software comes with no warranty of any kind, use at your own risk! | |
11 */ | |
12 | |
13 | |
281 | 14 #include "main.h" |
9 | 15 #include "preferences.h" |
16 | |
17 #include "cache_maint.h" | |
507 | 18 #include "debug.h" |
9 | 19 #include "editors.h" |
20 #include "filelist.h" | |
21 #include "fullscreen.h" | |
26
acd9885ebd78
Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents:
15
diff
changeset
|
22 #include "image.h" |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
23 #include "image-overlay.h" |
426
9fe0ca1b5263
show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents:
413
diff
changeset
|
24 #include "color-man.h" |
9 | 25 #include "img-view.h" |
26 #include "layout_config.h" | |
27 #include "layout_util.h" | |
28 #include "pixbuf_util.h" | |
29 #include "slideshow.h" | |
30 #include "utilops.h" | |
31 #include "ui_fileops.h" | |
32 #include "ui_misc.h" | |
33 #include "ui_tabcomp.h" | |
34 #include "ui_utildlg.h" | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
35 #include "bar_exif.h" |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
36 #include "exif.h" |
9 | 37 |
38 #include <math.h> | |
39 | |
40 | |
41 #define EDITOR_NAME_MAX_LENGTH 32 | |
42 #define EDITOR_COMMAND_MAX_LENGTH 1024 | |
43 | |
44 | |
45 typedef struct _ThumbSize ThumbSize; | |
46 struct _ThumbSize | |
47 { | |
48 gint w; | |
49 gint h; | |
50 }; | |
51 | |
52 static ThumbSize thumb_size_list[] = | |
53 { | |
54 { 24, 24 }, | |
55 { 32, 32 }, | |
56 { 48, 48 }, | |
57 { 64, 64 }, | |
58 { 96, 72 }, | |
59 { 96, 96 }, | |
60 { 128, 96 }, | |
61 { 128, 128 }, | |
62 { 160, 120 }, | |
63 { 160, 160 }, | |
64 { 192, 144 }, | |
65 { 192, 192 }, | |
66 { 256, 192 }, | |
67 { 256, 256 } | |
68 }; | |
69 | |
70 enum { | |
71 FE_ENABLE, | |
72 FE_EXTENSION, | |
73 FE_DESCRIPTION | |
74 }; | |
75 | |
76 /* config memory values */ | |
321 | 77 static ConfOptions *c_options = NULL; |
9 | 78 |
79 | |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
80 #ifdef DEBUG |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
81 static gint debug_c; |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
82 #endif |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
83 |
9 | 84 static GtkWidget *configwindow = NULL; |
85 static GtkWidget *startup_path_entry; | |
86 static GtkListStore *filter_store = NULL; | |
283 | 87 static GtkWidget *editor_name_entry[GQ_EDITOR_SLOTS]; |
88 static GtkWidget *editor_command_entry[GQ_EDITOR_SLOTS]; | |
9 | 89 |
90 static GtkWidget *layout_widget; | |
91 | |
92 static GtkWidget *safe_delete_path_entry; | |
93 | |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
94 static GtkWidget *color_profile_input_file_entry[COLOR_PROFILE_INPUTS]; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
95 static GtkWidget *color_profile_input_name_entry[COLOR_PROFILE_INPUTS]; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
96 static GtkWidget *color_profile_screen_file_entry; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
97 |
170
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
98 static GtkWidget *sidecar_ext_entry; |
225
649f7cb544e0
Make the preferences window resizeable, and try to improve
zas_
parents:
224
diff
changeset
|
99 |
649f7cb544e0
Make the preferences window resizeable, and try to improve
zas_
parents:
224
diff
changeset
|
100 |
649f7cb544e0
Make the preferences window resizeable, and try to improve
zas_
parents:
224
diff
changeset
|
101 #define CONFIG_WINDOW_DEF_WIDTH 700 |
649f7cb544e0
Make the preferences window resizeable, and try to improve
zas_
parents:
224
diff
changeset
|
102 #define CONFIG_WINDOW_DEF_HEIGHT 500 |
649f7cb544e0
Make the preferences window resizeable, and try to improve
zas_
parents:
224
diff
changeset
|
103 |
9 | 104 /* |
105 *----------------------------------------------------------------------------- | |
106 * option widget callbacks (private) | |
107 *----------------------------------------------------------------------------- | |
442 | 108 */ |
9 | 109 |
110 static void startup_path_set_current(GtkWidget *widget, gpointer data) | |
111 { | |
112 gtk_entry_set_text(GTK_ENTRY(startup_path_entry), layout_get_path(NULL)); | |
113 } | |
114 | |
115 static void zoom_mode_original_cb(GtkWidget *widget, gpointer data) | |
116 { | |
117 if (GTK_TOGGLE_BUTTON (widget)->active) | |
334 | 118 c_options->image.zoom_mode = ZOOM_RESET_ORIGINAL; |
9 | 119 } |
120 | |
121 static void zoom_mode_fit_cb(GtkWidget *widget, gpointer data) | |
122 { | |
123 if (GTK_TOGGLE_BUTTON (widget)->active) | |
334 | 124 c_options->image.zoom_mode = ZOOM_RESET_FIT_WINDOW; |
9 | 125 } |
126 | |
127 static void zoom_mode_none_cb(GtkWidget *widget, gpointer data) | |
128 { | |
129 if (GTK_TOGGLE_BUTTON (widget)->active) | |
334 | 130 c_options->image.zoom_mode = ZOOM_RESET_NONE; |
9 | 131 } |
132 | |
133 static void zoom_increment_cb(GtkWidget *spin, gpointer data) | |
134 { | |
334 | 135 c_options->image.zoom_increment = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * 10.0 + 0.01); |
9 | 136 } |
137 | |
138 static void slideshow_delay_cb(GtkWidget *spin, gpointer data) | |
139 { | |
326 | 140 c_options->slideshow.delay = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * |
9 | 141 (double)SLIDESHOW_SUBSECOND_PRECISION + 0.01); |
142 } | |
143 | |
144 /* | |
145 *----------------------------------------------------------------------------- | |
146 * sync progam to config window routine (private) | |
147 *----------------------------------------------------------------------------- | |
442 | 148 */ |
9 | 149 |
150 static void config_window_apply(void) | |
151 { | |
152 const gchar *buf; | |
153 gint new_style; | |
154 gint i; | |
155 gint refresh = FALSE; | |
156 | |
283 | 157 for(i = 0; i < GQ_EDITOR_SLOTS; i++) |
9 | 158 { |
283 | 159 if (i < GQ_EDITOR_GENERIC_SLOTS) |
134
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
160 { |
318 | 161 g_free(options->editor_name[i]); |
162 options->editor_name[i] = NULL; | |
134
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
163 buf = gtk_entry_get_text(GTK_ENTRY(editor_name_entry[i])); |
318 | 164 if (buf && strlen(buf) > 0) options->editor_name[i] = g_strdup(buf); |
134
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
165 } |
9 | 166 |
318 | 167 g_free(options->editor_command[i]); |
168 options->editor_command[i] = NULL; | |
9 | 169 buf = gtk_entry_get_text(GTK_ENTRY(editor_command_entry[i])); |
318 | 170 if (buf && strlen(buf) > 0) options->editor_command[i] = g_strdup(buf); |
9 | 171 } |
172 layout_edit_update_all(); | |
173 | |
318 | 174 g_free(options->startup_path); |
175 options->startup_path = NULL; | |
9 | 176 buf = gtk_entry_get_text(GTK_ENTRY(startup_path_entry)); |
318 | 177 if (buf && strlen(buf) > 0) options->startup_path = remove_trailing_slash(buf); |
9 | 178 |
341
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
179 g_free(options->file_ops.safe_delete_path); |
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
180 options->file_ops.safe_delete_path = NULL; |
9 | 181 buf = gtk_entry_get_text(GTK_ENTRY(safe_delete_path_entry)); |
341
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
182 if (buf && strlen(buf) > 0) options->file_ops.safe_delete_path = remove_trailing_slash(buf); |
9 | 183 |
356 | 184 if (options->file_filter.show_hidden_files != c_options->file_filter.show_hidden_files) refresh = TRUE; |
373
61a3c8b05b24
Add a new option in Preferences > Filtering to allow the
zas_
parents:
356
diff
changeset
|
185 if (options->file_filter.show_dot_directory != c_options->file_filter.show_dot_directory) refresh = TRUE; |
329 | 186 if (options->file_sort.case_sensitive != c_options->file_sort.case_sensitive) refresh = TRUE; |
332 | 187 if (options->file_filter.disable != c_options->file_filter.disable) refresh = TRUE; |
9 | 188 |
321 | 189 options->startup_path_enable = c_options->startup_path_enable; |
341
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
190 options->file_ops.confirm_delete = c_options->file_ops.confirm_delete; |
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
191 options->file_ops.enable_delete_key = c_options->file_ops.enable_delete_key; |
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
192 options->file_ops.safe_delete_enable = c_options->file_ops.safe_delete_enable; |
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
193 options->file_ops.safe_delete_folder_maxsize = c_options->file_ops.safe_delete_folder_maxsize; |
338
41c3cb73120f
Rename window options (moved to layout) and re-order rc file.
zas_
parents:
334
diff
changeset
|
194 options->layout.tools_restore_state = c_options->layout.tools_restore_state; |
41c3cb73120f
Rename window options (moved to layout) and re-order rc file.
zas_
parents:
334
diff
changeset
|
195 options->layout.save_window_positions = c_options->layout.save_window_positions; |
334 | 196 options->image.zoom_mode = c_options->image.zoom_mode; |
197 options->image.zoom_2pass = c_options->image.zoom_2pass; | |
198 options->image.fit_window_to_image = c_options->image.fit_window_to_image; | |
199 options->image.limit_window_size = c_options->image.limit_window_size; | |
200 options->image.zoom_to_fit_allow_expand = c_options->image.zoom_to_fit_allow_expand; | |
201 options->image.max_window_size = c_options->image.max_window_size; | |
202 options->image.limit_autofit_size = c_options->image.limit_autofit_size; | |
203 options->image.max_autofit_size = c_options->image.max_autofit_size; | |
321 | 204 options->progressive_key_scrolling = c_options->progressive_key_scrolling; |
333 | 205 options->thumbnails.max_width = c_options->thumbnails.max_width; |
206 options->thumbnails.max_height = c_options->thumbnails.max_height; | |
207 options->thumbnails.enable_caching = c_options->thumbnails.enable_caching; | |
208 options->thumbnails.cache_into_dirs = c_options->thumbnails.cache_into_dirs; | |
209 options->thumbnails.fast = c_options->thumbnails.fast; | |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
210 #if 0 |
333 | 211 options->thumbnails.use_xvpics = c_options->thumbnails.use_xvpics; |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
212 #endif |
333 | 213 options->thumbnails.spec_standard = c_options->thumbnails.spec_standard; |
321 | 214 options->enable_metadata_dirs = c_options->enable_metadata_dirs; |
356 | 215 options->file_filter.show_hidden_files = c_options->file_filter.show_hidden_files; |
373
61a3c8b05b24
Add a new option in Preferences > Filtering to allow the
zas_
parents:
356
diff
changeset
|
216 options->file_filter.show_dot_directory = c_options->file_filter.show_dot_directory; |
61a3c8b05b24
Add a new option in Preferences > Filtering to allow the
zas_
parents:
356
diff
changeset
|
217 |
329 | 218 options->file_sort.case_sensitive = c_options->file_sort.case_sensitive; |
332 | 219 options->file_filter.disable = c_options->file_filter.disable; |
9 | 220 |
170
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
221 sidecar_ext_parse(gtk_entry_get_text(GTK_ENTRY(sidecar_ext_entry)), FALSE); |
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
222 |
326 | 223 options->slideshow.random = c_options->slideshow.random; |
224 options->slideshow.repeat = c_options->slideshow.repeat; | |
225 options->slideshow.delay = c_options->slideshow.delay; | |
9 | 226 |
321 | 227 options->mousewheel_scrolls = c_options->mousewheel_scrolls; |
9 | 228 |
341
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
229 options->file_ops.enable_in_place_rename = c_options->file_ops.enable_in_place_rename; |
9 | 230 |
330 | 231 options->collections.rectangular_selection = c_options->collections.rectangular_selection; |
9 | 232 |
334 | 233 options->image.tile_cache_max = c_options->image.tile_cache_max; |
442 | 234 |
413
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
410
diff
changeset
|
235 options->image.read_buffer_size = c_options->image.read_buffer_size; |
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
410
diff
changeset
|
236 options->image.idle_read_loop_count = c_options->image.idle_read_loop_count; |
9 | 237 |
333 | 238 options->thumbnails.quality = c_options->thumbnails.quality; |
334 | 239 options->image.zoom_quality = c_options->image.zoom_quality; |
9 | 240 |
334 | 241 options->image.zoom_increment = c_options->image.zoom_increment; |
9 | 242 |
334 | 243 options->image.enable_read_ahead = c_options->image.enable_read_ahead; |
9 | 244 |
339
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
338
diff
changeset
|
245 if (options->image.use_custom_border_color != c_options->image.use_custom_border_color |
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
338
diff
changeset
|
246 || !gdk_color_equal(&options->image.border_color, &c_options->image.border_color)) |
9 | 247 { |
339
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
338
diff
changeset
|
248 options->image.use_custom_border_color = c_options->image.use_custom_border_color; |
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
338
diff
changeset
|
249 options->image.border_color = c_options->image.border_color; |
9 | 250 layout_colors_update(); |
251 view_window_colors_update(); | |
252 } | |
253 | |
322 | 254 options->fullscreen.screen = c_options->fullscreen.screen; |
255 options->fullscreen.clean_flip = c_options->fullscreen.clean_flip; | |
256 options->fullscreen.disable_saver = c_options->fullscreen.disable_saver; | |
257 options->fullscreen.above = c_options->fullscreen.above; | |
468
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
258 options->image_overlay.common.show_at_startup = c_options->image_overlay.common.show_at_startup; |
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
259 if (c_options->image_overlay.common.template_string) |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
260 { |
468
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
261 g_free(options->image_overlay.common.template_string); |
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
262 options->image_overlay.common.template_string = g_strdup(c_options->image_overlay.common.template_string); |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
263 } |
9 | 264 |
321 | 265 options->update_on_time_change = c_options->update_on_time_change; |
334 | 266 options->image.exif_rotate_enable = c_options->image.exif_rotate_enable; |
9 | 267 |
342
07490120df2d
Rename dupe_custom_threshold option to duplicates_similarity_threshold.
zas_
parents:
341
diff
changeset
|
268 options->duplicates_similarity_threshold = c_options->duplicates_similarity_threshold; |
9 | 269 |
321 | 270 options->tree_descend_subdirs = c_options->tree_descend_subdirs; |
441
08eb7137cd94
Allow the user to change open_recent_list_maxsize option through
zas_
parents:
426
diff
changeset
|
271 |
08eb7137cd94
Allow the user to change open_recent_list_maxsize option through
zas_
parents:
426
diff
changeset
|
272 options->open_recent_list_maxsize = c_options->open_recent_list_maxsize; |
458
7a69309b91c8
Allow the user to set the drag'n drop icon size through
zas_
parents:
446
diff
changeset
|
273 options->dnd_icon_size = c_options->dnd_icon_size; |
497 | 274 |
275 if (options->show_copy_path != c_options->show_copy_path) | |
276 { | |
277 options->show_copy_path = c_options->show_copy_path; | |
278 layout_copy_path_update_all(); | |
279 } | |
441
08eb7137cd94
Allow the user to change open_recent_list_maxsize option through
zas_
parents:
426
diff
changeset
|
280 |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
281 #ifdef DEBUG |
507 | 282 set_debug_level(debug_c); |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
283 #endif |
9 | 284 |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
285 #ifdef HAVE_LCMS |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
286 for (i = 0; i < COLOR_PROFILE_INPUTS; i++) |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
287 { |
327 | 288 g_free(options->color_profile.input_name[i]); |
289 options->color_profile.input_name[i] = NULL; | |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
290 buf = gtk_entry_get_text(GTK_ENTRY(color_profile_input_name_entry[i])); |
327 | 291 if (buf && strlen(buf) > 0) options->color_profile.input_name[i] = g_strdup(buf); |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
292 |
327 | 293 g_free(options->color_profile.input_file[i]); |
294 options->color_profile.input_file[i] = NULL; | |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
295 buf = gtk_entry_get_text(GTK_ENTRY(color_profile_input_file_entry[i])); |
327 | 296 if (buf && strlen(buf) > 0) options->color_profile.input_file[i] = g_strdup(buf); |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
297 } |
327 | 298 g_free(options->color_profile.screen_file); |
299 options->color_profile.screen_file = NULL; | |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
300 buf = gtk_entry_get_text(GTK_ENTRY(color_profile_screen_file_entry)); |
327 | 301 if (buf && strlen(buf) > 0) options->color_profile.screen_file = g_strdup(buf); |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
302 #endif |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
303 |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
304 for (i=0; ExifUIList[i].key; i++) |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
305 { |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
306 ExifUIList[i].current = ExifUIList[i].temp; |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
307 } |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
308 |
375 | 309 { |
310 gchar *layout_order = layout_config_get(layout_widget, &new_style); | |
9 | 311 |
327 | 312 if (new_style != options->layout.style || |
375 | 313 (layout_order == NULL) != (options->layout.order == NULL) || |
327 | 314 !options->layout.order || |
375 | 315 strcmp(layout_order, options->layout.order) != 0) |
9 | 316 { |
317 if (refresh) filter_rebuild(); | |
318 refresh = FALSE; | |
319 | |
327 | 320 g_free(options->layout.order); |
375 | 321 options->layout.order = layout_order; |
322 layout_order = NULL; /* g_free() later */ | |
9 | 323 |
327 | 324 options->layout.style = new_style; |
9 | 325 |
326 layout_styles_update(); | |
327 } | |
328 | |
375 | 329 g_free(layout_order); |
330 } | |
9 | 331 |
26
acd9885ebd78
Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents:
15
diff
changeset
|
332 image_options_sync(); |
acd9885ebd78
Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents:
15
diff
changeset
|
333 |
9 | 334 if (refresh) |
335 { | |
336 filter_rebuild(); | |
337 layout_refresh(NULL); | |
338 } | |
339 } | |
340 | |
341 /* | |
342 *----------------------------------------------------------------------------- | |
343 * config window main button callbacks (private) | |
344 *----------------------------------------------------------------------------- | |
442 | 345 */ |
9 | 346 |
347 static void config_window_close_cb(GtkWidget *widget, gpointer data) | |
348 { | |
349 gtk_widget_destroy(configwindow); | |
350 configwindow = NULL; | |
351 filter_store = NULL; | |
352 } | |
353 | |
354 static gint config_window_delete(GtkWidget *w, GdkEventAny *event, gpointer data) | |
355 { | |
356 config_window_close_cb(NULL, NULL); | |
357 return TRUE; | |
358 } | |
359 | |
360 static void config_window_ok_cb(GtkWidget *widget, gpointer data) | |
361 { | |
362 config_window_apply(); | |
363 config_window_close_cb(NULL, NULL); | |
364 } | |
365 | |
366 static void config_window_apply_cb(GtkWidget *widget, gpointer data) | |
367 { | |
368 config_window_apply(); | |
369 } | |
370 | |
371 /* | |
372 *----------------------------------------------------------------------------- | |
373 * config window setup (private) | |
374 *----------------------------------------------------------------------------- | |
442 | 375 */ |
9 | 376 |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
377 static void exif_item_cb(GtkWidget *combo, gpointer data) |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
378 { |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
379 gint *option = data; |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
380 *option = gtk_combo_box_get_active(GTK_COMBO_BOX(combo)); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
381 } |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
382 |
442 | 383 static void exif_item(GtkWidget *table, gint column, gint row, |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
384 const gchar *text, gint option, gint *option_c) |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
385 { |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
386 GtkWidget *combo; |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
387 |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
388 *option_c = option; |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
389 |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
390 pref_table_label(table, column, row, text, 0.0); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
391 |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
392 combo = gtk_combo_box_new_text(); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
393 |
442 | 394 /* note: the order is important, it must match the values of |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
395 * EXIF_UI_OFF, _IFSET, _ON */ |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
396 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Never")); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
397 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("If set")); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
398 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Always")); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
399 |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
400 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), option); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
401 |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
402 g_signal_connect(G_OBJECT(combo), "changed", |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
403 G_CALLBACK(exif_item_cb), option_c); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
404 |
442 | 405 gtk_table_attach(GTK_TABLE(table), combo, |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
406 column + 1, column + 2, row, row + 1, |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
407 GTK_EXPAND | GTK_FILL, 0, 0, 0); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
408 gtk_widget_show(combo); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
409 } |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
410 |
9 | 411 static void quality_menu_cb(GtkWidget *combo, gpointer data) |
412 { | |
413 gint *option = data; | |
414 | |
415 switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo))) | |
416 { | |
417 case 0: | |
418 default: | |
419 *option = GDK_INTERP_NEAREST; | |
420 break; | |
421 case 1: | |
422 *option = GDK_INTERP_TILES; | |
423 break; | |
424 case 2: | |
425 *option = GDK_INTERP_BILINEAR; | |
426 break; | |
427 case 3: | |
428 *option = GDK_INTERP_HYPER; | |
429 break; | |
430 } | |
431 } | |
432 | |
433 static void add_quality_menu(GtkWidget *table, gint column, gint row, const gchar *text, | |
434 gint option, gint *option_c) | |
435 { | |
436 GtkWidget *combo; | |
437 gint current = 0; | |
438 | |
439 *option_c = option; | |
440 | |
441 pref_table_label(table, column, row, text, 0.0); | |
442 | |
443 combo = gtk_combo_box_new_text(); | |
444 | |
445 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Nearest (worst, but fastest)")); | |
446 if (option == GDK_INTERP_NEAREST) current = 0; | |
447 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Tiles")); | |
448 if (option == GDK_INTERP_TILES) current = 1; | |
449 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Bilinear")); | |
450 if (option == GDK_INTERP_BILINEAR) current = 2; | |
451 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Hyper (best, but slowest)")); | |
452 if (option == GDK_INTERP_HYPER) current = 3; | |
453 | |
454 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current); | |
455 | |
456 g_signal_connect(G_OBJECT(combo), "changed", | |
457 G_CALLBACK(quality_menu_cb), option_c); | |
458 | |
459 gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, | |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
460 GTK_EXPAND | GTK_FILL, 0, 0, 0); |
9 | 461 gtk_widget_show(combo); |
462 } | |
463 | |
464 #if 0 | |
465 static void add_dither_menu(gint option, gint *option_c, gchar *text, GtkWidget *box) | |
466 { | |
467 GtkWidget *hbox; | |
468 GtkWidget *omenu; | |
469 GtkWidget *menu; | |
470 | |
471 *option_c = option; | |
472 | |
473 hbox = pref_box_new(box, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
474 pref_label_new(hbox, text); | |
475 | |
476 omenu = gtk_option_menu_new(); | |
477 menu = gtk_menu_new(); | |
478 | |
479 add_menu_item(menu, _("None"), option_c, (gint)GDK_RGB_DITHER_NONE); | |
480 add_menu_item(menu, _("Normal"), option_c, (gint)GDK_RGB_DITHER_NORMAL); | |
481 add_menu_item(menu, _("Best"), option_c, (gint)GDK_RGB_DITHER_MAX); | |
482 | |
483 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
484 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), *option_c); | |
485 | |
486 gtk_box_pack_start(GTK_BOX(hbox), omenu, FALSE, FALSE, 0); | |
487 gtk_widget_show(omenu); | |
488 } | |
489 #endif | |
490 | |
491 static void thumb_size_menu_cb(GtkWidget *combo, gpointer data) | |
492 { | |
493 gint n; | |
494 | |
495 n = gtk_combo_box_get_active(GTK_COMBO_BOX(combo)); | |
496 | |
497 if (n >= 0 && n < sizeof(thumb_size_list) / sizeof(ThumbSize)) | |
498 { | |
333 | 499 c_options->thumbnails.max_width = thumb_size_list[n].w; |
500 c_options->thumbnails.max_height = thumb_size_list[n].h; | |
9 | 501 } |
502 else if (n > 0) | |
503 { | |
333 | 504 c_options->thumbnails.max_width = options->thumbnails.max_width; |
505 c_options->thumbnails.max_height = options->thumbnails.max_height; | |
9 | 506 } |
507 } | |
508 | |
509 static void add_thumb_size_menu(GtkWidget *table, gint column, gint row, gchar *text) | |
510 { | |
511 GtkWidget *combo; | |
512 gint current; | |
513 gint i; | |
514 | |
333 | 515 c_options->thumbnails.max_width = options->thumbnails.max_width; |
516 c_options->thumbnails.max_height = options->thumbnails.max_height; | |
9 | 517 |
518 pref_table_label(table, column, row, text, 0.0); | |
519 | |
520 combo = gtk_combo_box_new_text(); | |
521 | |
522 current = -1; | |
226
3c89da4aef95
Fix and simplify thumbnails size combo box related code.
zas_
parents:
225
diff
changeset
|
523 for (i = 0; i < sizeof(thumb_size_list) / sizeof(ThumbSize); i++) |
9 | 524 { |
525 gint w, h; | |
226
3c89da4aef95
Fix and simplify thumbnails size combo box related code.
zas_
parents:
225
diff
changeset
|
526 gchar *buf; |
9 | 527 |
528 w = thumb_size_list[i].w; | |
529 h = thumb_size_list[i].h; | |
530 | |
226
3c89da4aef95
Fix and simplify thumbnails size combo box related code.
zas_
parents:
225
diff
changeset
|
531 buf = g_strdup_printf("%d x %d", w, h); |
3c89da4aef95
Fix and simplify thumbnails size combo box related code.
zas_
parents:
225
diff
changeset
|
532 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), buf); |
3c89da4aef95
Fix and simplify thumbnails size combo box related code.
zas_
parents:
225
diff
changeset
|
533 g_free(buf); |
442 | 534 |
333 | 535 if (w == options->thumbnails.max_width && h == options->thumbnails.max_height) current = i; |
9 | 536 } |
537 | |
538 if (current == -1) | |
539 { | |
540 gchar *buf; | |
541 | |
333 | 542 buf = g_strdup_printf("%s %d x %d", _("Custom"), options->thumbnails.max_width, options->thumbnails.max_height); |
9 | 543 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), buf); |
544 g_free(buf); | |
545 | |
226
3c89da4aef95
Fix and simplify thumbnails size combo box related code.
zas_
parents:
225
diff
changeset
|
546 current = i; |
9 | 547 } |
548 | |
549 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current); | |
550 g_signal_connect(G_OBJECT(combo), "changed", | |
551 G_CALLBACK(thumb_size_menu_cb), NULL); | |
552 | |
553 gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, | |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
554 GTK_EXPAND | GTK_FILL, 0, 0, 0); |
9 | 555 gtk_widget_show(combo); |
556 } | |
557 | |
558 static void filter_store_populate(void) | |
559 { | |
560 GList *work; | |
561 | |
562 if (!filter_store) return; | |
563 | |
564 gtk_list_store_clear(filter_store); | |
565 | |
566 work = filter_get_list(); | |
567 while (work) | |
568 { | |
569 FilterEntry *fe; | |
570 GtkTreeIter iter; | |
571 | |
572 fe = work->data; | |
573 work = work->next; | |
574 | |
575 gtk_list_store_append(filter_store, &iter); | |
576 gtk_list_store_set(filter_store, &iter, 0, fe, -1); | |
577 } | |
578 } | |
579 | |
580 static void filter_store_ext_edit_cb(GtkCellRendererText *cell, gchar *path_str, | |
581 gchar *new_text, gpointer data) | |
582 { | |
583 GtkWidget *model = data; | |
584 FilterEntry *fe = data; | |
585 GtkTreePath *tpath; | |
586 GtkTreeIter iter; | |
587 | |
588 if (!new_text || strlen(new_text) < 1) return; | |
589 | |
590 tpath = gtk_tree_path_new_from_string(path_str); | |
591 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, tpath); | |
592 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 0, &fe, -1); | |
593 | |
594 g_free(fe->extensions); | |
595 fe->extensions = g_strdup(new_text); | |
596 | |
597 gtk_tree_path_free(tpath); | |
598 filter_rebuild(); | |
599 } | |
600 | |
601 static void filter_store_desc_edit_cb(GtkCellRendererText *cell, gchar *path_str, | |
602 gchar *new_text, gpointer data) | |
603 { | |
604 GtkWidget *model = data; | |
605 FilterEntry *fe; | |
606 GtkTreePath *tpath; | |
607 GtkTreeIter iter; | |
608 | |
609 if (!new_text || strlen(new_text) < 1) return; | |
610 | |
611 tpath = gtk_tree_path_new_from_string(path_str); | |
612 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, tpath); | |
613 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 0, &fe, -1); | |
614 | |
615 g_free(fe->description); | |
616 fe->description = g_strdup(new_text); | |
617 | |
618 gtk_tree_path_free(tpath); | |
619 } | |
620 | |
621 static void filter_store_enable_cb(GtkCellRendererToggle *renderer, | |
622 gchar *path_str, gpointer data) | |
623 { | |
624 GtkWidget *model = data; | |
625 FilterEntry *fe; | |
626 GtkTreePath *tpath; | |
627 GtkTreeIter iter; | |
628 | |
629 tpath = gtk_tree_path_new_from_string(path_str); | |
630 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, tpath); | |
631 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 0, &fe, -1); | |
632 | |
633 fe->enabled = !fe->enabled; | |
634 | |
635 gtk_tree_path_free(tpath); | |
636 filter_rebuild(); | |
637 } | |
638 | |
639 static void filter_set_func(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, | |
640 GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) | |
641 { | |
642 FilterEntry *fe; | |
643 | |
644 gtk_tree_model_get(tree_model, iter, 0, &fe, -1); | |
645 | |
646 switch(GPOINTER_TO_INT(data)) | |
647 { | |
648 case FE_ENABLE: | |
649 g_object_set(GTK_CELL_RENDERER(cell), | |
650 "active", fe->enabled, NULL); | |
651 break; | |
652 case FE_EXTENSION: | |
653 g_object_set(GTK_CELL_RENDERER(cell), | |
654 "text", fe->extensions, NULL); | |
655 break; | |
656 case FE_DESCRIPTION: | |
657 g_object_set(GTK_CELL_RENDERER(cell), | |
658 "text", fe->description, NULL); | |
659 break; | |
660 } | |
661 } | |
662 | |
663 static void filter_add_cb(GtkWidget *widget, gpointer data) | |
664 { | |
212
c7021159079d
differentiate among normal image, raw image and metadata
nadvornik
parents:
211
diff
changeset
|
665 filter_add_unique("description", ".new", FORMAT_CLASS_IMAGE, TRUE); |
9 | 666 filter_store_populate(); |
667 | |
668 /* FIXME: implement the scroll to/select row stuff for tree view */ | |
669 } | |
670 | |
671 static void filter_remove_cb(GtkWidget *widget, gpointer data) | |
672 { | |
673 GtkWidget *filter_view = data; | |
674 GtkTreeSelection *selection; | |
675 GtkTreeIter iter; | |
676 FilterEntry *fe; | |
677 | |
678 if (!filter_store) return; | |
679 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(filter_view)); | |
680 if (!gtk_tree_selection_get_selected(selection, NULL, &iter)) return; | |
681 gtk_tree_model_get(GTK_TREE_MODEL(filter_store), &iter, 0, &fe, -1); | |
682 if (!fe) return; | |
683 | |
684 filter_remove_entry(fe); | |
685 filter_rebuild(); | |
686 filter_store_populate(); | |
687 } | |
688 | |
689 static void filter_default_ok_cb(GenericDialog *gd, gpointer data) | |
690 { | |
691 filter_reset(); | |
692 filter_add_defaults(); | |
693 filter_rebuild(); | |
694 filter_store_populate(); | |
695 } | |
696 | |
697 static void dummy_cancel_cb(GenericDialog *gd, gpointer data) | |
698 { | |
699 /* no op, only so cancel button appears */ | |
700 } | |
701 | |
702 static void filter_default_cb(GtkWidget *widget, gpointer data) | |
703 { | |
704 GenericDialog *gd; | |
705 | |
706 gd = generic_dialog_new(_("Reset filters"), | |
254
9faf34f047b1
Make the wmclass value unique among the code by defining
zas_
parents:
231
diff
changeset
|
707 GQ_WMCLASS, "reset_filter", widget, TRUE, |
9 | 708 dummy_cancel_cb, NULL); |
709 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Reset filters"), | |
710 _("This will reset the file filters to the defaults.\nContinue?")); | |
711 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, filter_default_ok_cb, TRUE); | |
712 gtk_widget_show(gd->dialog); | |
713 } | |
714 | |
715 static void filter_disable_cb(GtkWidget* widget, gpointer data) | |
716 { | |
717 GtkWidget *frame = data; | |
718 | |
719 gtk_widget_set_sensitive(frame, | |
720 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))); | |
721 } | |
722 | |
723 static void editor_default_ok_cb(GenericDialog *gd, gpointer data) | |
724 { | |
725 gint i; | |
726 | |
727 editor_reset_defaults(); | |
728 if (!configwindow) return; | |
729 | |
283 | 730 for (i = 0; i < GQ_EDITOR_SLOTS; i++) |
9 | 731 { |
283 | 732 if (i < GQ_EDITOR_GENERIC_SLOTS) |
134
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
733 gtk_entry_set_text(GTK_ENTRY(editor_name_entry[i]), |
318 | 734 (options->editor_name[i]) ? options->editor_name[i] : ""); |
9 | 735 gtk_entry_set_text(GTK_ENTRY(editor_command_entry[i]), |
318 | 736 (options->editor_command[i]) ? options->editor_command[i] : ""); |
9 | 737 } |
738 } | |
739 | |
740 static void editor_default_cb(GtkWidget *widget, gpointer data) | |
741 { | |
742 GenericDialog *gd; | |
743 | |
744 gd = generic_dialog_new(_("Reset editors"), | |
254
9faf34f047b1
Make the wmclass value unique among the code by defining
zas_
parents:
231
diff
changeset
|
745 GQ_WMCLASS, "reset_filter", widget, TRUE, |
9 | 746 dummy_cancel_cb, NULL); |
747 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Reset editors"), | |
748 _("This will reset the edit commands to the defaults.\nContinue?")); | |
749 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, editor_default_ok_cb, TRUE); | |
750 gtk_widget_show(gd->dialog); | |
751 } | |
752 | |
753 static void editor_help_cb(GtkWidget *widget, gpointer data) | |
754 { | |
755 help_window_show("editors"); | |
756 } | |
757 | |
758 static void safe_delete_view_cb(GtkWidget* widget, gpointer data) | |
759 { | |
760 layout_set_path(NULL, gtk_entry_get_text(GTK_ENTRY(safe_delete_path_entry))); | |
761 } | |
762 | |
763 static void safe_delete_clear_ok_cb(GenericDialog *gd, gpointer data) | |
764 { | |
765 file_util_trash_clear(); | |
766 } | |
767 | |
768 static void safe_delete_clear_cb(GtkWidget* widget, gpointer data) | |
769 { | |
770 GenericDialog *gd; | |
771 GtkWidget *entry; | |
772 gd = generic_dialog_new(_("Clear trash"), | |
254
9faf34f047b1
Make the wmclass value unique among the code by defining
zas_
parents:
231
diff
changeset
|
773 GQ_WMCLASS, "clear_trash", widget, TRUE, |
9 | 774 dummy_cancel_cb, NULL); |
775 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Clear trash"), | |
776 _("This will remove the trash contents.")); | |
777 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, safe_delete_clear_ok_cb, TRUE); | |
778 entry = gtk_entry_new(); | |
779 GTK_WIDGET_UNSET_FLAGS(entry, GTK_CAN_FOCUS); | |
780 gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE); | |
341
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
781 if (options->file_ops.safe_delete_path) gtk_entry_set_text(GTK_ENTRY(entry), options->file_ops.safe_delete_path); |
9 | 782 gtk_box_pack_start(GTK_BOX(gd->vbox), entry, FALSE, FALSE, 0); |
783 gtk_widget_show(entry); | |
784 gtk_widget_show(gd->dialog); | |
785 } | |
786 | |
468
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
787 static void image_overlay_template_view_changed_cb(GtkWidget* widget, gpointer data) |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
788 { |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
789 GtkWidget *pTextView; |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
790 GtkTextBuffer* pTextBuffer; |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
791 GtkTextIter iStart; |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
792 GtkTextIter iEnd; |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
793 |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
794 pTextView = GTK_WIDGET(data); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
795 |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
796 pTextBuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(pTextView)); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
797 gtk_text_buffer_get_start_iter(pTextBuffer, &iStart); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
798 gtk_text_buffer_get_end_iter(pTextBuffer, &iEnd); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
799 |
468
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
800 if (c_options->image_overlay.common.template_string) g_free(c_options->image_overlay.common.template_string); |
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
801 c_options->image_overlay.common.template_string = gtk_text_buffer_get_text(pTextBuffer, &iStart, &iEnd, TRUE); |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
802 } |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
803 |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
804 static void image_overlay_default_template_ok_cb(GenericDialog *gd, gpointer data) |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
805 { |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
806 GtkTextView *text_view = data; |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
807 GtkTextBuffer *buffer; |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
808 |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
809 set_default_image_overlay_template_string(options); |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
810 if (!configwindow) return; |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
811 |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
812 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view)); |
468
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
813 gtk_text_buffer_set_text(buffer, options->image_overlay.common.template_string, -1); |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
814 } |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
815 |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
816 static void image_overlay_default_template_cb(GtkWidget *widget, gpointer data) |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
817 { |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
818 GenericDialog *gd; |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
819 |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
820 gd = generic_dialog_new(_("Reset image overlay template string"), |
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
821 GQ_WMCLASS, "reset_image_overlay_template_string", widget, TRUE, |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
822 dummy_cancel_cb, data); |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
823 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Reset image overlay template string"), |
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
824 _("This will reset the image overlay template string to the default.\nContinue?")); |
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
825 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, image_overlay_default_template_ok_cb, TRUE); |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
826 gtk_widget_show(gd->dialog); |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
827 } |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
828 |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
829 |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
830 /* general options tab */ |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
831 static void config_tab_general(GtkWidget *notebook) |
9 | 832 { |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
833 GtkWidget *label; |
9 | 834 GtkWidget *hbox; |
835 GtkWidget *vbox; | |
836 GtkWidget *group; | |
837 GtkWidget *subgroup; | |
838 GtkWidget *button; | |
839 GtkWidget *tabcomp; | |
840 GtkWidget *ct_button; | |
841 GtkWidget *table; | |
842 GtkWidget *spin; | |
843 | |
844 vbox = gtk_vbox_new(FALSE, 0); | |
845 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | |
846 gtk_widget_show(vbox); | |
847 label = gtk_label_new(_("General")); | |
512
f9bf33be53ff
Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents:
507
diff
changeset
|
848 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, label); |
9 | 849 |
850 group = pref_group_new(vbox, FALSE, _("Startup"), GTK_ORIENTATION_VERTICAL); | |
851 | |
852 button = pref_checkbox_new_int(group, _("Change to folder:"), | |
321 | 853 options->startup_path_enable, &c_options->startup_path_enable); |
9 | 854 |
855 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
856 pref_checkbox_link_sensitivity(button, hbox); | |
857 | |
318 | 858 tabcomp = tab_completion_new(&startup_path_entry, options->startup_path, NULL, NULL); |
9 | 859 tab_completion_add_select_button(startup_path_entry, NULL, TRUE); |
860 gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0); | |
861 gtk_widget_show(tabcomp); | |
862 | |
863 button = pref_button_new(hbox, NULL, _("Use current"), FALSE, | |
864 G_CALLBACK(startup_path_set_current), NULL); | |
865 | |
866 group = pref_group_new(vbox, FALSE, _("Thumbnails"), GTK_ORIENTATION_VERTICAL); | |
867 | |
868 table = pref_table_new(group, 2, 2, FALSE, FALSE); | |
869 add_thumb_size_menu(table, 0, 0, _("Size:")); | |
333 | 870 add_quality_menu(table, 0, 1, _("Quality:"), options->thumbnails.quality, &c_options->thumbnails.quality); |
9 | 871 |
872 ct_button = pref_checkbox_new_int(group, _("Cache thumbnails"), | |
333 | 873 options->thumbnails.enable_caching, &c_options->thumbnails.enable_caching); |
9 | 874 |
875 subgroup = pref_box_new(group, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | |
876 pref_checkbox_link_sensitivity(ct_button, subgroup); | |
877 | |
878 button = pref_checkbox_new_int(subgroup, _("Use shared thumbnail cache"), | |
333 | 879 options->thumbnails.spec_standard, &c_options->thumbnails.spec_standard); |
9 | 880 |
881 subgroup = pref_box_new(subgroup, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | |
882 pref_checkbox_link_sensitivity_swap(button, subgroup); | |
883 | |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
884 pref_checkbox_new_int(subgroup, _("Cache thumbnails into .thumbnails"), |
333 | 885 options->thumbnails.cache_into_dirs, &c_options->thumbnails.cache_into_dirs); |
9 | 886 |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
887 #if 0 |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
888 pref_checkbox_new_int(subgroup, _("Use xvpics thumbnails when found (read only)"), |
333 | 889 options->thumbnails.use_xvpics, &c_options->thumbnails.use_xvpics); |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
890 #endif |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
891 |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
892 pref_checkbox_new_int(group, _("Faster jpeg thumbnailing (may reduce quality)"), |
333 | 893 options->thumbnails.fast, &c_options->thumbnails.fast); |
9 | 894 |
895 group = pref_group_new(vbox, FALSE, _("Slide show"), GTK_ORIENTATION_VERTICAL); | |
896 | |
326 | 897 c_options->slideshow.delay = options->slideshow.delay; |
9 | 898 spin = pref_spin_new(group, _("Delay between image change:"), _("seconds"), |
899 SLIDESHOW_MIN_SECONDS, SLIDESHOW_MAX_SECONDS, 1.0, 1, | |
326 | 900 options->slideshow.delay ? (double)options->slideshow.delay / SLIDESHOW_SUBSECOND_PRECISION : 10.0, |
9 | 901 G_CALLBACK(slideshow_delay_cb), NULL); |
902 gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS); | |
903 | |
326 | 904 pref_checkbox_new_int(group, _("Random"), options->slideshow.random, &c_options->slideshow.random); |
905 pref_checkbox_new_int(group, _("Repeat"), options->slideshow.repeat, &c_options->slideshow.repeat); | |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
906 } |
9 | 907 |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
908 /* image tab */ |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
909 static void config_tab_image(GtkWidget *notebook) |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
910 { |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
911 GtkWidget *label; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
912 GtkWidget *hbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
913 GtkWidget *vbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
914 GtkWidget *group; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
915 GtkWidget *button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
916 GtkWidget *ct_button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
917 GtkWidget *table; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
918 GtkWidget *spin; |
9 | 919 |
920 vbox = gtk_vbox_new(FALSE, 0); | |
921 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | |
922 gtk_widget_show(vbox); | |
923 label = gtk_label_new(_("Image")); | |
512
f9bf33be53ff
Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents:
507
diff
changeset
|
924 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, label); |
9 | 925 |
926 group = pref_group_new(vbox, FALSE, _("Zoom"), GTK_ORIENTATION_VERTICAL); | |
927 | |
928 #if 0 | |
334 | 929 add_dither_menu(dither_quality, &c_options->image.dither_quality, _("Dithering method:"), group); |
9 | 930 #endif |
931 table = pref_table_new(group, 2, 1, FALSE, FALSE); | |
334 | 932 add_quality_menu(table, 0, 0, _("Quality:"), options->image.zoom_quality, &c_options->image.zoom_quality); |
9 | 933 |
934 pref_checkbox_new_int(group, _("Two pass zooming"), | |
334 | 935 options->image.zoom_2pass, &c_options->image.zoom_2pass); |
9 | 936 |
67
f63ecca6c087
Fri Oct 13 05:22:43 2006 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
937 pref_checkbox_new_int(group, _("Allow enlargement of image for zoom to fit"), |
334 | 938 options->image.zoom_to_fit_allow_expand, &c_options->image.zoom_to_fit_allow_expand); |
9 | 939 |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
940 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
941 ct_button = pref_checkbox_new_int(hbox, _("Limit image size when autofitting (%):"), |
334 | 942 options->image.limit_autofit_size, &c_options->image.limit_autofit_size); |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
943 spin = pref_spin_new_int(hbox, NULL, NULL, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
944 10, 150, 1, |
334 | 945 options->image.max_autofit_size, &c_options->image.max_autofit_size); |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
946 pref_checkbox_link_sensitivity(ct_button, spin); |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
947 |
334 | 948 c_options->image.zoom_increment = options->image.zoom_increment; |
9 | 949 spin = pref_spin_new(group, _("Zoom increment:"), NULL, |
334 | 950 0.1, 4.0, 0.1, 1, (double)options->image.zoom_increment / 10.0, |
9 | 951 G_CALLBACK(zoom_increment_cb), NULL); |
952 gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS); | |
953 | |
954 group = pref_group_new(vbox, FALSE, _("When new image is selected:"), GTK_ORIENTATION_VERTICAL); | |
955 | |
334 | 956 c_options->image.zoom_mode = options->image.zoom_mode; |
9 | 957 button = pref_radiobutton_new(group, NULL, _("Zoom to original size"), |
334 | 958 (options->image.zoom_mode == ZOOM_RESET_ORIGINAL), |
9 | 959 G_CALLBACK(zoom_mode_original_cb), NULL); |
960 button = pref_radiobutton_new(group, button, _("Fit image to window"), | |
334 | 961 (options->image.zoom_mode == ZOOM_RESET_FIT_WINDOW), |
9 | 962 G_CALLBACK(zoom_mode_fit_cb), NULL); |
963 button = pref_radiobutton_new(group, button, _("Leave Zoom at previous setting"), | |
334 | 964 (options->image.zoom_mode == ZOOM_RESET_NONE), |
9 | 965 G_CALLBACK(zoom_mode_none_cb), NULL); |
966 | |
967 group = pref_group_new(vbox, FALSE, _("Appearance"), GTK_ORIENTATION_VERTICAL); | |
968 | |
339
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
338
diff
changeset
|
969 pref_checkbox_new_int(group, _("Custom border color"), |
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
338
diff
changeset
|
970 options->image.use_custom_border_color, &c_options->image.use_custom_border_color); |
208
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
199
diff
changeset
|
971 |
339
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
338
diff
changeset
|
972 pref_color_button_new(group, _("Border color"), &options->image.border_color, |
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
338
diff
changeset
|
973 G_CALLBACK(pref_color_button_set_cb), &c_options->image.border_color); |
9 | 974 |
975 group = pref_group_new(vbox, FALSE, _("Convenience"), GTK_ORIENTATION_VERTICAL); | |
976 | |
977 pref_checkbox_new_int(group, _("Refresh on file change"), | |
321 | 978 options->update_on_time_change, &c_options->update_on_time_change); |
9 | 979 pref_checkbox_new_int(group, _("Preload next image"), |
334 | 980 options->image.enable_read_ahead, &c_options->image.enable_read_ahead); |
9 | 981 pref_checkbox_new_int(group, _("Auto rotate image using Exif information"), |
334 | 982 options->image.exif_rotate_enable, &c_options->image.exif_rotate_enable); |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
983 } |
9 | 984 |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
985 /* windows tab */ |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
986 static void config_tab_windows(GtkWidget *notebook) |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
987 { |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
988 GtkWidget *label; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
989 GtkWidget *hbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
990 GtkWidget *vbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
991 GtkWidget *group; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
992 GtkWidget *ct_button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
993 GtkWidget *spin; |
9 | 994 |
995 vbox = gtk_vbox_new(FALSE, 0); | |
996 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | |
997 gtk_widget_show(vbox); | |
998 label = gtk_label_new(_("Windows")); | |
999 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, label); | |
1000 | |
1001 group = pref_group_new(vbox, FALSE, _("State"), GTK_ORIENTATION_VERTICAL); | |
1002 | |
1003 pref_checkbox_new_int(group, _("Remember window positions"), | |
338
41c3cb73120f
Rename window options (moved to layout) and re-order rc file.
zas_
parents:
334
diff
changeset
|
1004 options->layout.save_window_positions, &c_options->layout.save_window_positions); |
9 | 1005 pref_checkbox_new_int(group, _("Remember tool state (float/hidden)"), |
338
41c3cb73120f
Rename window options (moved to layout) and re-order rc file.
zas_
parents:
334
diff
changeset
|
1006 options->layout.tools_restore_state, &c_options->layout.tools_restore_state); |
9 | 1007 |
1008 group = pref_group_new(vbox, FALSE, _("Size"), GTK_ORIENTATION_VERTICAL); | |
1009 | |
1010 pref_checkbox_new_int(group, _("Fit window to image when tools are hidden/floating"), | |
334 | 1011 options->image.fit_window_to_image, &c_options->image.fit_window_to_image); |
9 | 1012 |
1013 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
1014 ct_button = pref_checkbox_new_int(hbox, _("Limit size when auto-sizing window (%):"), | |
334 | 1015 options->image.limit_window_size, &c_options->image.limit_window_size); |
9 | 1016 spin = pref_spin_new_int(hbox, NULL, NULL, |
1017 10, 150, 1, | |
334 | 1018 options->image.max_window_size, &c_options->image.max_window_size); |
9 | 1019 pref_checkbox_link_sensitivity(ct_button, spin); |
1020 | |
1021 group = pref_group_new(vbox, FALSE, _("Layout"), GTK_ORIENTATION_VERTICAL); | |
1022 | |
1023 layout_widget = layout_config_new(); | |
327 | 1024 layout_config_set(layout_widget, options->layout.style, options->layout.order); |
9 | 1025 gtk_box_pack_start(GTK_BOX(group), layout_widget, FALSE, FALSE, 0); |
1026 gtk_widget_show(layout_widget); | |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1027 } |
9 | 1028 |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1029 /* filtering tab */ |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1030 static void config_tab_filtering(GtkWidget *notebook) |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1031 { |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1032 GtkWidget *hbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1033 GtkWidget *frame; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1034 GtkWidget *label; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1035 GtkWidget *vbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1036 GtkWidget *group; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1037 GtkWidget *button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1038 GtkWidget *ct_button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1039 GtkWidget *scrolled; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1040 GtkWidget *filter_view; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1041 GtkCellRenderer *renderer; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1042 GtkTreeSelection *selection; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1043 GtkTreeViewColumn *column; |
9 | 1044 |
1045 vbox = gtk_vbox_new(FALSE, 0); | |
513
985fdfebd89e
Remove whitespace between function name and first parenthesis for the sake of consistency. (pass 2)
zas_
parents:
512
diff
changeset
|
1046 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); |
9 | 1047 gtk_widget_show(vbox); |
1048 label = gtk_label_new(_("Filtering")); | |
1049 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, label); | |
1050 | |
1051 group = pref_box_new(vbox, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | |
1052 | |
356 | 1053 pref_checkbox_new_int(group, _("Show hidden files or folders"), |
1054 options->file_filter.show_hidden_files, &c_options->file_filter.show_hidden_files); | |
373
61a3c8b05b24
Add a new option in Preferences > Filtering to allow the
zas_
parents:
356
diff
changeset
|
1055 pref_checkbox_new_int(group, _("Show dot directory"), |
61a3c8b05b24
Add a new option in Preferences > Filtering to allow the
zas_
parents:
356
diff
changeset
|
1056 options->file_filter.show_dot_directory, &c_options->file_filter.show_dot_directory); |
9 | 1057 pref_checkbox_new_int(group, _("Case sensitive sort"), |
329 | 1058 options->file_sort.case_sensitive, &c_options->file_sort.case_sensitive); |
9 | 1059 |
1060 ct_button = pref_checkbox_new_int(group, _("Disable File Filtering"), | |
332 | 1061 options->file_filter.disable, &c_options->file_filter.disable); |
9 | 1062 |
170
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
1063 |
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
1064 group = pref_group_new(vbox, FALSE, _("Grouping sidecar extensions"), GTK_ORIENTATION_VERTICAL); |
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
1065 |
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
1066 sidecar_ext_entry = gtk_entry_new(); |
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
1067 gtk_entry_set_text(GTK_ENTRY(sidecar_ext_entry), sidecar_ext_to_string()); |
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
1068 gtk_box_pack_start(GTK_BOX(group), sidecar_ext_entry, FALSE, FALSE, 0); |
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
1069 gtk_widget_show(sidecar_ext_entry); |
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
1070 |
9 | 1071 group = pref_group_new(vbox, TRUE, _("File types"), GTK_ORIENTATION_VERTICAL); |
1072 | |
1073 frame = pref_group_parent(group); | |
1074 g_signal_connect(G_OBJECT(ct_button), "toggled", | |
1075 G_CALLBACK(filter_disable_cb), frame); | |
332 | 1076 gtk_widget_set_sensitive(frame, !options->file_filter.disable); |
9 | 1077 |
1078 scrolled = gtk_scrolled_window_new(NULL, NULL); | |
1079 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); | |
513
985fdfebd89e
Remove whitespace between function name and first parenthesis for the sake of consistency. (pass 2)
zas_
parents:
512
diff
changeset
|
1080 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
9 | 1081 gtk_box_pack_start(GTK_BOX(group), scrolled, TRUE, TRUE, 0); |
1082 gtk_widget_show(scrolled); | |
1083 | |
1084 filter_store = gtk_list_store_new(1, G_TYPE_POINTER); | |
1085 filter_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(filter_store)); | |
1086 g_object_unref(filter_store); | |
1087 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(filter_view)); | |
1088 gtk_tree_selection_set_mode(GTK_TREE_SELECTION(selection), GTK_SELECTION_SINGLE); | |
1089 | |
1090 gtk_tree_view_set_enable_search(GTK_TREE_VIEW(filter_view), FALSE); | |
1091 | |
1092 column = gtk_tree_view_column_new(); | |
1093 gtk_tree_view_column_set_title(column, _("Filter")); | |
1094 gtk_tree_view_column_set_resizable(column, TRUE); | |
1095 | |
1096 renderer = gtk_cell_renderer_toggle_new(); | |
1097 g_signal_connect(G_OBJECT(renderer), "toggled", | |
1098 G_CALLBACK(filter_store_enable_cb), filter_store); | |
1099 gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
1100 gtk_tree_view_column_set_cell_data_func(column, renderer, filter_set_func, | |
1101 GINT_TO_POINTER(FE_ENABLE), NULL); | |
442 | 1102 |
9 | 1103 renderer = gtk_cell_renderer_text_new(); |
1104 g_signal_connect(G_OBJECT(renderer), "edited", | |
1105 G_CALLBACK(filter_store_ext_edit_cb), filter_store); | |
1106 gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
1107 g_object_set(G_OBJECT(renderer), "editable", (gboolean)TRUE, NULL); | |
1108 gtk_tree_view_column_set_cell_data_func(column, renderer, filter_set_func, | |
1109 GINT_TO_POINTER(FE_EXTENSION), NULL); | |
1110 gtk_tree_view_append_column(GTK_TREE_VIEW(filter_view), column); | |
1111 | |
1112 column = gtk_tree_view_column_new(); | |
1113 gtk_tree_view_column_set_title(column, _("Description")); | |
1114 gtk_tree_view_column_set_resizable(column, TRUE); | |
1115 renderer = gtk_cell_renderer_text_new(); | |
1116 g_signal_connect(G_OBJECT(renderer), "edited", | |
1117 G_CALLBACK(filter_store_desc_edit_cb), filter_store); | |
1118 g_object_set(G_OBJECT(renderer), "editable", (gboolean)TRUE, NULL); | |
1119 gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
1120 gtk_tree_view_column_set_cell_data_func(column, renderer, filter_set_func, | |
1121 GINT_TO_POINTER(FE_DESCRIPTION), NULL); | |
1122 gtk_tree_view_append_column(GTK_TREE_VIEW(filter_view), column); | |
1123 | |
1124 filter_store_populate(); | |
1125 gtk_container_add(GTK_CONTAINER(scrolled), filter_view); | |
1126 gtk_widget_show(filter_view); | |
1127 | |
1128 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); | |
1129 | |
1130 button = pref_button_new(NULL, NULL, _("Defaults"), FALSE, | |
1131 G_CALLBACK(filter_default_cb), NULL); | |
1132 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1133 gtk_widget_show(button); | |
1134 | |
1135 button = pref_button_new(NULL, GTK_STOCK_REMOVE, NULL, FALSE, | |
1136 G_CALLBACK(filter_remove_cb), filter_view); | |
1137 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1138 gtk_widget_show(button); | |
1139 | |
1140 button = pref_button_new(NULL, GTK_STOCK_ADD, NULL, FALSE, | |
1141 G_CALLBACK(filter_add_cb), NULL); | |
1142 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1143 gtk_widget_show(button); | |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1144 } |
9 | 1145 |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1146 /* editors tab */ |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1147 static void config_tab_editors(GtkWidget *notebook) |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1148 { |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1149 GtkWidget *hbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1150 GtkWidget *label; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1151 GtkWidget *vbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1152 GtkWidget *button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1153 GtkWidget *table; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1154 gint i; |
9 | 1155 |
1156 vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP); | |
1157 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | |
1158 gtk_widget_show(vbox); | |
1159 label = gtk_label_new(_("Editors")); | |
1160 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, label); | |
1161 | |
1162 table = pref_table_new(vbox, 3, 9, FALSE, FALSE); | |
1163 gtk_table_set_col_spacings(GTK_TABLE(table), PREF_PAD_GAP); | |
1164 | |
1165 label = pref_table_label(table, 0, 0, _("#"), 1.0); | |
1166 pref_label_bold(label, TRUE, FALSE); | |
1167 | |
1168 label = pref_table_label(table, 1, 0, _("Menu name"), 0.0); | |
1169 pref_label_bold(label, TRUE, FALSE); | |
1170 | |
67
f63ecca6c087
Fri Oct 13 05:22:43 2006 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
1171 label = pref_table_label(table, 2, 0, _("Command Line"), 0.0); |
9 | 1172 pref_label_bold(label, TRUE, FALSE); |
1173 | |
283 | 1174 for (i = 0; i < GQ_EDITOR_SLOTS; i++) |
9 | 1175 { |
224 | 1176 GtkWidget *entry; |
9 | 1177 |
283 | 1178 if (i < GQ_EDITOR_GENERIC_SLOTS) |
134
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1179 { |
224 | 1180 gchar *buf; |
442 | 1181 |
134
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1182 buf = g_strdup_printf("%d", i+1); |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1183 pref_table_label(table, 0, i+1, buf, 1.0); |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1184 g_free(buf); |
224 | 1185 entry = gtk_entry_new(); |
1186 gtk_entry_set_max_length(GTK_ENTRY(entry), EDITOR_NAME_MAX_LENGTH); | |
1187 gtk_widget_set_size_request(entry, 80, -1); | |
318 | 1188 if (options->editor_name[i]) |
1189 gtk_entry_set_text(GTK_ENTRY(entry), options->editor_name[i]); | |
134
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1190 } |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1191 else |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1192 { |
318 | 1193 entry = gtk_label_new(options->editor_name[i]); |
225
649f7cb544e0
Make the preferences window resizeable, and try to improve
zas_
parents:
224
diff
changeset
|
1194 gtk_misc_set_alignment(GTK_MISC(entry), 0.0, 0.5); |
134
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1195 } |
442 | 1196 |
513
985fdfebd89e
Remove whitespace between function name and first parenthesis for the sake of consistency. (pass 2)
zas_
parents:
512
diff
changeset
|
1197 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, i+1, i+2, |
225
649f7cb544e0
Make the preferences window resizeable, and try to improve
zas_
parents:
224
diff
changeset
|
1198 GTK_FILL | GTK_SHRINK, 0, 0, 0); |
224 | 1199 gtk_widget_show(entry); |
1200 editor_name_entry[i] = entry; | |
9 | 1201 |
224 | 1202 entry = gtk_entry_new(); |
1203 gtk_entry_set_max_length(GTK_ENTRY(entry), EDITOR_COMMAND_MAX_LENGTH); | |
1204 gtk_widget_set_size_request(entry, 160, -1); | |
1205 tab_completion_add_to_entry(entry, NULL, NULL); | |
318 | 1206 if (options->editor_command[i]) |
1207 gtk_entry_set_text(GTK_ENTRY(entry), options->editor_command[i]); | |
513
985fdfebd89e
Remove whitespace between function name and first parenthesis for the sake of consistency. (pass 2)
zas_
parents:
512
diff
changeset
|
1208 gtk_table_attach(GTK_TABLE(table), entry, 2, 3, i+1, i+2, |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1209 GTK_FILL | GTK_EXPAND, 0, 0, 0); |
224 | 1210 gtk_widget_show(entry); |
1211 editor_command_entry[i] = entry; | |
9 | 1212 } |
1213 | |
1214 hbox = pref_box_new(vbox, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); | |
1215 | |
1216 button = pref_button_new(NULL, NULL, _("Defaults"), FALSE, | |
1217 G_CALLBACK(editor_default_cb), NULL); | |
1218 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1219 gtk_widget_show(button); | |
1220 | |
1221 button = pref_button_new(NULL, GTK_STOCK_HELP, NULL, FALSE, | |
1222 G_CALLBACK(editor_help_cb), NULL); | |
1223 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1224 gtk_widget_show(button); | |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1225 } |
9 | 1226 |
256
088b335f2d67
Rename exif preferences tab to "Properties", and name the
zas_
parents:
254
diff
changeset
|
1227 /* properties tab */ |
088b335f2d67
Rename exif preferences tab to "Properties", and name the
zas_
parents:
254
diff
changeset
|
1228 static void config_tab_properties(GtkWidget *notebook) |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1229 { |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1230 GtkWidget *label; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1231 GtkWidget *vbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1232 GtkWidget *group; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1233 GtkWidget *table; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1234 GtkWidget *scrolled; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1235 GtkWidget *viewport; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1236 gint i; |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1237 |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1238 scrolled = gtk_scrolled_window_new(NULL, NULL); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1239 gtk_container_set_border_width(GTK_CONTAINER(scrolled), PREF_PAD_BORDER); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1240 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1241 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1242 |
256
088b335f2d67
Rename exif preferences tab to "Properties", and name the
zas_
parents:
254
diff
changeset
|
1243 label = gtk_label_new(_("Properties")); |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1244 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scrolled, label); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1245 gtk_widget_show(scrolled); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1246 |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1247 viewport = gtk_viewport_new(NULL, NULL); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1248 gtk_viewport_set_shadow_type(GTK_VIEWPORT(viewport), GTK_SHADOW_NONE); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1249 gtk_container_add(GTK_CONTAINER(scrolled), viewport); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1250 gtk_widget_show(viewport); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1251 |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1252 vbox = gtk_vbox_new(FALSE, 0); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1253 gtk_container_add(GTK_CONTAINER(viewport), vbox); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1254 gtk_widget_show(vbox); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1255 |
442 | 1256 group = pref_group_new(vbox, FALSE, _("Exif"), |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1257 GTK_ORIENTATION_VERTICAL); |
442 | 1258 |
1259 | |
257
c5422b69b40e
Re-add "What to show in properties dialog:" label before the table.
zas_
parents:
256
diff
changeset
|
1260 pref_spacer(group, PREF_PAD_INDENT - PREF_PAD_SPACE); |
c5422b69b40e
Re-add "What to show in properties dialog:" label before the table.
zas_
parents:
256
diff
changeset
|
1261 label = pref_label_new(group, _("What to show in properties dialog:")); |
c5422b69b40e
Re-add "What to show in properties dialog:" label before the table.
zas_
parents:
256
diff
changeset
|
1262 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
c5422b69b40e
Re-add "What to show in properties dialog:" label before the table.
zas_
parents:
256
diff
changeset
|
1263 |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1264 table = pref_table_new(group, 2, 2, FALSE, FALSE); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1265 |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1266 for (i = 0; ExifUIList[i].key; i++) |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1267 { |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1268 const gchar *title; |
442 | 1269 |
1270 title = exif_get_description_by_key(ExifUIList[i].key); | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1271 exif_item(table, 0, i, title, ExifUIList[i].current, |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1272 &ExifUIList[i].temp); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1273 } |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1274 } |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1275 |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1276 /* advanced entry tab */ |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1277 static void config_tab_advanced(GtkWidget *notebook) |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1278 { |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1279 GtkWidget *label; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1280 GtkWidget *hbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1281 GtkWidget *vbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1282 GtkWidget *group; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1283 GtkWidget *button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1284 GtkWidget *tabcomp; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1285 GtkWidget *ct_button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1286 GtkWidget *table; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1287 GtkWidget *spin; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1288 GtkWidget *scrolled; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1289 GtkWidget *viewport; |
468
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
1290 GtkWidget *image_overlay_template_view; |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1291 GtkTextBuffer *buffer; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1292 gint i; |
9 | 1293 |
1294 scrolled = gtk_scrolled_window_new(NULL, NULL); | |
1295 gtk_container_set_border_width(GTK_CONTAINER(scrolled), PREF_PAD_BORDER); | |
1296 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), | |
1297 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
1298 label = gtk_label_new(_("Advanced")); | |
1299 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scrolled, label); | |
1300 gtk_widget_show(scrolled); | |
1301 | |
1302 viewport = gtk_viewport_new(NULL, NULL); | |
1303 gtk_viewport_set_shadow_type(GTK_VIEWPORT(viewport), GTK_SHADOW_NONE); | |
1304 gtk_container_add(GTK_CONTAINER(scrolled), viewport); | |
1305 gtk_widget_show(viewport); | |
1306 | |
1307 vbox = gtk_vbox_new(FALSE, 0); | |
1308 gtk_container_add(GTK_CONTAINER(viewport), vbox); | |
1309 gtk_widget_show(vbox); | |
1310 | |
1311 group = pref_group_new(vbox, FALSE, _("Full screen"), GTK_ORIENTATION_VERTICAL); | |
1312 | |
322 | 1313 c_options->fullscreen.screen = options->fullscreen.screen; |
1314 c_options->fullscreen.above = options->fullscreen.above; | |
1315 hbox = fullscreen_prefs_selection_new(_("Location:"), &c_options->fullscreen.screen, &c_options->fullscreen.above); | |
9 | 1316 gtk_box_pack_start(GTK_BOX(group), hbox, FALSE, FALSE, 0); |
1317 gtk_widget_show(hbox); | |
1318 | |
1319 pref_checkbox_new_int(group, _("Smooth image flip"), | |
322 | 1320 options->fullscreen.clean_flip, &c_options->fullscreen.clean_flip); |
9 | 1321 pref_checkbox_new_int(group, _("Disable screen saver"), |
322 | 1322 options->fullscreen.disable_saver, &c_options->fullscreen.disable_saver); |
468
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
1323 pref_checkbox_new_int(group, _("Always show image overlay at startup"), |
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
1324 options->image_overlay.common.show_at_startup, &c_options->image_overlay.common.show_at_startup); |
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
1325 pref_label_new(group, _("Image overlay template")); |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1326 |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1327 scrolled = gtk_scrolled_window_new(NULL, NULL); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1328 gtk_widget_set_size_request(scrolled, 200, 150); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1329 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1330 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1331 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1332 gtk_box_pack_start(GTK_BOX(group), scrolled, TRUE, TRUE, 5); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1333 gtk_widget_show(scrolled); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1334 |
468
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
1335 image_overlay_template_view = gtk_text_view_new(); |
267
a9adf9e1a746
Remove dependency on GTK 2.12, reported by John Vodden and Vladimir
zas_
parents:
257
diff
changeset
|
1336 |
a9adf9e1a746
Remove dependency on GTK 2.12, reported by John Vodden and Vladimir
zas_
parents:
257
diff
changeset
|
1337 #if GTK_CHECK_VERSION(2,12,0) |
468
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
1338 gtk_widget_set_tooltip_markup(image_overlay_template_view, |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1339 _("<i>%name%</i> results in the filename of the picture.\n" |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1340 "Also available: <i>%collection%</i>, <i>%number%</i>, <i>%total%</i>, <i>%date%</i>,\n" |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1341 "<i>%size%</i> (filesize), <i>%width%</i>, <i>%height%</i>, <i>%res%</i> (resolution)\n" |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1342 "To access exif data use the exif name, e. g. <i>%fCamera%</i> is the formatted camera name,\n" |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1343 "<i>%Exif.Photo.DateTimeOriginal%</i> the date of the original shot.\n" |
298
cb93a982fcdd
Add the possibility to truncate overlay infos displayed:
zas_
parents:
289
diff
changeset
|
1344 "<i>%fCamera:20</i> notation will truncate the displayed data to 20 characters and will add 3 dots at the end to denote the truncation.\n" |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1345 "If two or more variables are connected with the |-sign, it prints available variables with a separator.\n" |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1346 "<i>%fShutterSpeed%</i>|<i>%fISOSpeedRating%</i>|<i>%fFocalLength%</i> could show \"1/20s - 400 - 80 mm\" or \"1/200 - 80 mm\",\n" |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1347 "if there's no ISO information in the Exif data.\n" |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1348 "If a line is empty, it is removed. This allows to add lines that totally disappear when no data is available.\n" |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1349 )); |
267
a9adf9e1a746
Remove dependency on GTK 2.12, reported by John Vodden and Vladimir
zas_
parents:
257
diff
changeset
|
1350 #endif |
468
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
1351 gtk_container_add(GTK_CONTAINER(scrolled), image_overlay_template_view); |
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
1352 gtk_widget_show(image_overlay_template_view); |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1353 |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
1354 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
1355 |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
1356 button = pref_button_new(NULL, NULL, _("Defaults"), FALSE, |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
1357 G_CALLBACK(image_overlay_default_template_cb), image_overlay_template_view); |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
1358 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
1359 gtk_widget_show(button); |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
1360 |
468
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
1361 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(image_overlay_template_view)); |
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
1362 if (options->image_overlay.common.template_string) gtk_text_buffer_set_text(buffer, options->image_overlay.common.template_string, -1); |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1363 g_signal_connect(G_OBJECT(buffer), "changed", |
468
2df505c60459
Replace fullscreen.info and fullscreen.show_info options by:
zas_
parents:
458
diff
changeset
|
1364 G_CALLBACK(image_overlay_template_view_changed_cb), image_overlay_template_view); |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
212
diff
changeset
|
1365 |
9 | 1366 group = pref_group_new(vbox, FALSE, _("Delete"), GTK_ORIENTATION_VERTICAL); |
1367 | |
1368 pref_checkbox_new_int(group, _("Confirm file delete"), | |
341
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
1369 options->file_ops.confirm_delete, &c_options->file_ops.confirm_delete); |
9 | 1370 pref_checkbox_new_int(group, _("Enable Delete key"), |
341
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
1371 options->file_ops.enable_delete_key, &c_options->file_ops.enable_delete_key); |
9 | 1372 |
1373 ct_button = pref_checkbox_new_int(group, _("Safe delete"), | |
341
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
1374 options->file_ops.safe_delete_enable, &c_options->file_ops.safe_delete_enable); |
9 | 1375 |
1376 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
1377 pref_checkbox_link_sensitivity(ct_button, hbox); | |
1378 | |
1379 pref_spacer(hbox, PREF_PAD_INDENT - PREF_PAD_SPACE); | |
1380 pref_label_new(hbox, _("Folder:")); | |
1381 | |
341
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
1382 tabcomp = tab_completion_new(&safe_delete_path_entry, options->file_ops.safe_delete_path, NULL, NULL); |
9 | 1383 tab_completion_add_select_button(safe_delete_path_entry, NULL, TRUE); |
1384 gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0); | |
1385 gtk_widget_show(tabcomp); | |
1386 | |
1387 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); | |
1388 pref_checkbox_link_sensitivity(ct_button, hbox); | |
1389 | |
1390 pref_spacer(hbox, PREF_PAD_INDENT - PREF_PAD_GAP); | |
223
73efc1ba150f
Setting no limit size to trash directory is now possible using zero as value.
zas_
parents:
222
diff
changeset
|
1391 spin = pref_spin_new_int(hbox, _("Maximum size:"), _("MB"), |
442 | 1392 0, 2048, 1, options->file_ops.safe_delete_folder_maxsize, &c_options->file_ops.safe_delete_folder_maxsize); |
267
a9adf9e1a746
Remove dependency on GTK 2.12, reported by John Vodden and Vladimir
zas_
parents:
257
diff
changeset
|
1393 #if GTK_CHECK_VERSION(2,12,0) |
223
73efc1ba150f
Setting no limit size to trash directory is now possible using zero as value.
zas_
parents:
222
diff
changeset
|
1394 gtk_widget_set_tooltip_markup(spin, _("Set to 0 for unlimited size")); |
267
a9adf9e1a746
Remove dependency on GTK 2.12, reported by John Vodden and Vladimir
zas_
parents:
257
diff
changeset
|
1395 #endif |
9 | 1396 button = pref_button_new(NULL, NULL, _("View"), FALSE, |
1397 G_CALLBACK(safe_delete_view_cb), NULL); | |
1398 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1399 gtk_widget_show(button); | |
1400 | |
1401 button = pref_button_new(NULL, GTK_STOCK_CLEAR, NULL, FALSE, | |
1402 G_CALLBACK(safe_delete_clear_cb), NULL); | |
1403 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1404 gtk_widget_show(button); | |
1405 | |
497 | 1406 |
9 | 1407 group = pref_group_new(vbox, FALSE, _("Behavior"), GTK_ORIENTATION_VERTICAL); |
1408 | |
1409 pref_checkbox_new_int(group, _("Rectangular selection in icon view"), | |
330 | 1410 options->collections.rectangular_selection, &c_options->collections.rectangular_selection); |
9 | 1411 |
1412 pref_checkbox_new_int(group, _("Descend folders in tree view"), | |
321 | 1413 options->tree_descend_subdirs, &c_options->tree_descend_subdirs); |
9 | 1414 |
1415 pref_checkbox_new_int(group, _("In place renaming"), | |
341
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
1416 options->file_ops.enable_in_place_rename, &c_options->file_ops.enable_in_place_rename); |
9 | 1417 |
497 | 1418 pref_checkbox_new_int(group, _("Show \"Copy path\" menu item which write the path of selected files to clipboard"), |
1419 options->show_copy_path, &c_options->show_copy_path); | |
1420 | |
441
08eb7137cd94
Allow the user to change open_recent_list_maxsize option through
zas_
parents:
426
diff
changeset
|
1421 pref_spin_new_int(group, _("Open recent list maximum size"), NULL, |
08eb7137cd94
Allow the user to change open_recent_list_maxsize option through
zas_
parents:
426
diff
changeset
|
1422 1, 50, 1, options->open_recent_list_maxsize, &c_options->open_recent_list_maxsize); |
458
7a69309b91c8
Allow the user to set the drag'n drop icon size through
zas_
parents:
446
diff
changeset
|
1423 |
7a69309b91c8
Allow the user to set the drag'n drop icon size through
zas_
parents:
446
diff
changeset
|
1424 pref_spin_new_int(group, _("Drag'n drop icon size"), NULL, |
7a69309b91c8
Allow the user to set the drag'n drop icon size through
zas_
parents:
446
diff
changeset
|
1425 16, 256, 16, options->dnd_icon_size, &c_options->dnd_icon_size); |
441
08eb7137cd94
Allow the user to change open_recent_list_maxsize option through
zas_
parents:
426
diff
changeset
|
1426 |
9 | 1427 group = pref_group_new(vbox, FALSE, _("Navigation"), GTK_ORIENTATION_VERTICAL); |
1428 | |
1429 pref_checkbox_new_int(group, _("Progressive keyboard scrolling"), | |
321 | 1430 options->progressive_key_scrolling, &c_options->progressive_key_scrolling); |
9 | 1431 pref_checkbox_new_int(group, _("Mouse wheel scrolls image"), |
321 | 1432 options->mousewheel_scrolls, &c_options->mousewheel_scrolls); |
9 | 1433 |
1434 group = pref_group_new(vbox, FALSE, _("Miscellaneous"), GTK_ORIENTATION_VERTICAL); | |
1435 | |
1436 pref_checkbox_new_int(group, _("Store keywords and comments local to source images"), | |
321 | 1437 options->enable_metadata_dirs, &c_options->enable_metadata_dirs); |
9 | 1438 |
1439 pref_spin_new_int(group, _("Custom similarity threshold:"), NULL, | |
342
07490120df2d
Rename dupe_custom_threshold option to duplicates_similarity_threshold.
zas_
parents:
341
diff
changeset
|
1440 0, 100, 1, options->duplicates_similarity_threshold, &c_options->duplicates_similarity_threshold); |
9 | 1441 |
413
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
410
diff
changeset
|
1442 group = pref_group_new(vbox, FALSE, _("Image loading and caching"), GTK_ORIENTATION_VERTICAL); |
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
410
diff
changeset
|
1443 |
9 | 1444 pref_spin_new_int(group, _("Offscreen cache size (Mb per image):"), NULL, |
334 | 1445 0, 128, 1, options->image.tile_cache_max, &c_options->image.tile_cache_max); |
442 | 1446 |
413
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
410
diff
changeset
|
1447 pref_spin_new_int(group, _("Image read buffer size (bytes):"), NULL, |
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
410
diff
changeset
|
1448 IMAGE_LOADER_READ_BUFFER_SIZE_MIN, IMAGE_LOADER_READ_BUFFER_SIZE_MAX, 512, |
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
410
diff
changeset
|
1449 options->image.read_buffer_size, &c_options->image.read_buffer_size); |
442 | 1450 |
413
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
410
diff
changeset
|
1451 pref_spin_new_int(group, _("Image idle loop read count:"), NULL, |
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
410
diff
changeset
|
1452 IMAGE_LOADER_IDLE_READ_LOOP_COUNT_MIN, IMAGE_LOADER_IDLE_READ_LOOP_COUNT_MAX, 1, |
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
410
diff
changeset
|
1453 options->image.idle_read_loop_count, &c_options->image.idle_read_loop_count); |
9e521adbf312
Add two new options to control image read buffer at runtime.
zas_
parents:
410
diff
changeset
|
1454 |
9 | 1455 |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1456 group = pref_group_new(vbox, FALSE, _("Color profiles"), GTK_ORIENTATION_VERTICAL); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1457 #ifndef HAVE_LCMS |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1458 gtk_widget_set_sensitive(pref_group_parent(group), FALSE); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1459 #endif |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1460 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1461 table = pref_table_new(group, 3, COLOR_PROFILE_INPUTS + 2, FALSE, FALSE); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1462 gtk_table_set_col_spacings(GTK_TABLE(table), PREF_PAD_GAP); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1463 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1464 label = pref_table_label(table, 0, 0, _("Type"), 0.0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1465 pref_label_bold(label, TRUE, FALSE); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1466 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1467 label = pref_table_label(table, 1, 0, _("Menu name"), 0.0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1468 pref_label_bold(label, TRUE, FALSE); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1469 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1470 label = pref_table_label(table, 2, 0, _("File"), 0.0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1471 pref_label_bold(label, TRUE, FALSE); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1472 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1473 for (i = 0; i < COLOR_PROFILE_INPUTS; i++) |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1474 { |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1475 GtkWidget *entry; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1476 gchar *buf; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1477 |
426
9fe0ca1b5263
show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents:
413
diff
changeset
|
1478 buf = g_strdup_printf("Input %d:", i + COLOR_PROFILE_FILE); |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1479 pref_table_label(table, 0, i + 1, buf, 1.0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1480 g_free(buf); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1481 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1482 entry = gtk_entry_new(); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1483 gtk_entry_set_max_length(GTK_ENTRY(entry), EDITOR_NAME_MAX_LENGTH); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1484 gtk_widget_set_size_request(editor_name_entry[i], 30, -1); |
327 | 1485 if (options->color_profile.input_name[i]) |
320 | 1486 { |
327 | 1487 gtk_entry_set_text(GTK_ENTRY(entry), options->color_profile.input_name[i]); |
320 | 1488 } |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1489 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, i + 1, i + 2, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1490 GTK_FILL | GTK_EXPAND, 0, 0, 0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1491 gtk_widget_show(entry); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1492 color_profile_input_name_entry[i] = entry; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1493 |
327 | 1494 tabcomp = tab_completion_new(&entry, options->color_profile.input_file[i], NULL, NULL); |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1495 tab_completion_add_select_button(entry, _("Select color profile"), FALSE); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1496 gtk_widget_set_size_request(entry, 160, -1); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1497 gtk_table_attach(GTK_TABLE(table), tabcomp, 2, 3, i + 1, i + 2, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1498 GTK_FILL | GTK_EXPAND, 0, 0, 0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1499 gtk_widget_show(tabcomp); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1500 color_profile_input_file_entry[i] = entry; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1501 } |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1502 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1503 pref_table_label(table, 0, COLOR_PROFILE_INPUTS + 1, _("Screen:"), 1.0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1504 tabcomp = tab_completion_new(&color_profile_screen_file_entry, |
327 | 1505 options->color_profile.screen_file, NULL, NULL); |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1506 tab_completion_add_select_button(color_profile_screen_file_entry, _("Select color profile"), FALSE); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1507 gtk_widget_set_size_request(color_profile_screen_file_entry, 160, -1); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1508 gtk_table_attach(GTK_TABLE(table), tabcomp, 2, 3, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1509 COLOR_PROFILE_INPUTS + 1, COLOR_PROFILE_INPUTS + 2, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1510 GTK_FILL | GTK_EXPAND, 0, 0, 0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1511 gtk_widget_show(tabcomp); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1512 |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
1513 #ifdef DEBUG |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
1514 group = pref_group_new(vbox, FALSE, _("Debugging"), GTK_ORIENTATION_VERTICAL); |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
1515 |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
1516 pref_spin_new_int(group, _("Debug level:"), NULL, |
507 | 1517 DEBUG_LEVEL_MIN, DEBUG_LEVEL_MAX, 1, get_debug_level(), &debug_c); |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
1518 #endif |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1519 } |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1520 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1521 /* Main preferences window */ |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1522 static void config_window_create(void) |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1523 { |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1524 GtkWidget *win_vbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1525 GtkWidget *hbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1526 GtkWidget *notebook; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1527 GtkWidget *button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1528 GtkWidget *ct_button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1529 |
321 | 1530 if (!c_options) c_options = init_options(NULL); |
318 | 1531 |
289
6a7298988a7a
Simplify and unify gtk_window creation with the help of
zas_
parents:
288
diff
changeset
|
1532 configwindow = window_new(GTK_WINDOW_TOPLEVEL, "preferences", PIXBUF_INLINE_ICON_CONFIG, NULL, _("Preferences")); |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1533 gtk_window_set_type_hint(GTK_WINDOW(configwindow), GDK_WINDOW_TYPE_HINT_DIALOG); |
513
985fdfebd89e
Remove whitespace between function name and first parenthesis for the sake of consistency. (pass 2)
zas_
parents:
512
diff
changeset
|
1534 g_signal_connect(G_OBJECT(configwindow), "delete_event", |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1535 G_CALLBACK(config_window_delete), NULL); |
442 | 1536 gtk_window_set_default_size(GTK_WINDOW(configwindow), CONFIG_WINDOW_DEF_WIDTH, CONFIG_WINDOW_DEF_HEIGHT); |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1537 gtk_window_set_resizable(GTK_WINDOW(configwindow), TRUE); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1538 gtk_container_set_border_width(GTK_CONTAINER(configwindow), PREF_PAD_BORDER); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1539 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1540 win_vbox = gtk_vbox_new(FALSE, PREF_PAD_SPACE); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1541 gtk_container_add(GTK_CONTAINER(configwindow), win_vbox); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1542 gtk_widget_show(win_vbox); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1543 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1544 hbox = gtk_hbutton_box_new(); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1545 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_END); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1546 gtk_box_set_spacing(GTK_BOX(hbox), PREF_PAD_BUTTON_GAP); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1547 gtk_box_pack_end(GTK_BOX(win_vbox), hbox, FALSE, FALSE, 0); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1548 gtk_widget_show(hbox); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1549 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1550 button = pref_button_new(NULL, GTK_STOCK_OK, NULL, FALSE, |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1551 G_CALLBACK(config_window_ok_cb), NULL); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1552 gtk_container_add(GTK_CONTAINER(hbox), button); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1553 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1554 gtk_widget_grab_default(button); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1555 gtk_widget_show(button); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1556 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1557 ct_button = button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1558 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1559 button = pref_button_new(NULL, GTK_STOCK_APPLY, NULL, FALSE, |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1560 G_CALLBACK(config_window_apply_cb), NULL); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1561 gtk_container_add(GTK_CONTAINER(hbox), button); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1562 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1563 gtk_widget_show(button); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1564 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1565 button = pref_button_new(NULL, GTK_STOCK_CANCEL, NULL, FALSE, |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1566 G_CALLBACK(config_window_close_cb), NULL); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1567 gtk_container_add(GTK_CONTAINER(hbox), button); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1568 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1569 gtk_widget_show(button); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1570 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1571 if (!generic_dialog_get_alternative_button_order(configwindow)) |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1572 { |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1573 gtk_box_reorder_child(GTK_BOX(hbox), ct_button, -1); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1574 } |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1575 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1576 notebook = gtk_notebook_new(); |
512
f9bf33be53ff
Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents:
507
diff
changeset
|
1577 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP); |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1578 gtk_box_pack_start(GTK_BOX(win_vbox), notebook, TRUE, TRUE, 0); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1579 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1580 config_tab_general(notebook); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1581 config_tab_image(notebook); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1582 config_tab_windows(notebook); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1583 config_tab_filtering(notebook); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1584 config_tab_editors(notebook); |
256
088b335f2d67
Rename exif preferences tab to "Properties", and name the
zas_
parents:
254
diff
changeset
|
1585 config_tab_properties(notebook); |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1586 config_tab_advanced(notebook); |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
1587 |
9 | 1588 gtk_widget_show(notebook); |
1589 | |
1590 gtk_widget_show(configwindow); | |
1591 } | |
1592 | |
1593 /* | |
1594 *----------------------------------------------------------------------------- | |
1595 * config window show (public) | |
1596 *----------------------------------------------------------------------------- | |
442 | 1597 */ |
9 | 1598 |
1599 void show_config_window(void) | |
1600 { | |
1601 if (configwindow) | |
1602 { | |
1603 gtk_window_present(GTK_WINDOW(configwindow)); | |
1604 return; | |
1605 } | |
1606 | |
1607 config_window_create(); | |
1608 } | |
1609 | |
1610 /* | |
1611 *----------------- | |
1612 * about window | |
1613 *----------------- | |
1614 */ | |
1615 | |
1616 static GtkWidget *about = NULL; | |
1617 | |
1618 static gint about_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data) | |
1619 { | |
1620 gtk_widget_destroy(about); | |
1621 about = NULL; | |
1622 | |
1623 return TRUE; | |
1624 } | |
1625 | |
1626 static void about_window_close(GtkWidget *widget, gpointer data) | |
1627 { | |
1628 if (!about) return; | |
1629 | |
1630 gtk_widget_destroy(about); | |
1631 about = NULL; | |
1632 } | |
1633 | |
1634 static void about_credits_cb(GtkWidget *widget, gpointer data) | |
1635 { | |
1636 help_window_show("credits"); | |
1637 } | |
1638 | |
1639 void show_about_window(void) | |
1640 { | |
1641 GtkWidget *vbox; | |
1642 GtkWidget *hbox; | |
1643 GtkWidget *label; | |
1644 GtkWidget *button; | |
1645 GdkPixbuf *pixbuf; | |
1646 | |
1647 gchar *buf; | |
1648 | |
1649 if (about) | |
1650 { | |
1651 gtk_window_present(GTK_WINDOW(about)); | |
1652 return; | |
1653 } | |
1654 | |
289
6a7298988a7a
Simplify and unify gtk_window creation with the help of
zas_
parents:
288
diff
changeset
|
1655 about = window_new(GTK_WINDOW_TOPLEVEL, "about", NULL, NULL, _("About")); |
9 | 1656 gtk_window_set_type_hint(GTK_WINDOW(about), GDK_WINDOW_TYPE_HINT_DIALOG); |
1657 g_signal_connect(G_OBJECT(about), "delete_event", | |
1658 G_CALLBACK(about_delete_cb), NULL); | |
1659 | |
1660 gtk_container_set_border_width(GTK_CONTAINER(about), PREF_PAD_BORDER); | |
1661 | |
1662 vbox = gtk_vbox_new(FALSE, PREF_PAD_SPACE); | |
1663 gtk_container_add(GTK_CONTAINER(about), vbox); | |
1664 gtk_widget_show(vbox); | |
1665 | |
1666 pixbuf = pixbuf_inline(PIXBUF_INLINE_LOGO); | |
1667 button = gtk_image_new_from_pixbuf(pixbuf); | |
1668 g_object_unref(pixbuf); | |
1669 gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, 0); | |
1670 gtk_widget_show(button); | |
1671 | |
475 | 1672 buf = g_strdup_printf(_("%s %s\n\nCopyright (c) 2006 John Ellis\nCopyright (c) %s The Geeqie Team\nwebsite: %s\nemail: %s\n\nReleased under the GNU General Public License"), |
288
d1f74154463e
Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents:
283
diff
changeset
|
1673 GQ_APPNAME, |
9 | 1674 VERSION, |
475 | 1675 "2008", |
288
d1f74154463e
Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents:
283
diff
changeset
|
1676 GQ_WEBSITE, |
d1f74154463e
Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents:
283
diff
changeset
|
1677 GQ_EMAIL_ADDRESS); |
9 | 1678 label = gtk_label_new(buf); |
1679 g_free(buf); | |
1680 | |
1681 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER); | |
1682 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0); | |
1683 gtk_widget_show(label); | |
1684 | |
1685 hbox = gtk_hbutton_box_new(); | |
1686 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_END); | |
1687 gtk_box_set_spacing(GTK_BOX(hbox), PREF_PAD_BUTTON_GAP); | |
1688 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
1689 gtk_widget_show(hbox); | |
1690 | |
1691 button = pref_button_new(NULL, NULL, _("Credits..."), FALSE, | |
1692 G_CALLBACK(about_credits_cb), NULL); | |
1693 gtk_container_add(GTK_CONTAINER(hbox), button); | |
1694 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
1695 gtk_widget_show(button); | |
1696 | |
1697 button = pref_button_new(NULL, GTK_STOCK_CLOSE, NULL, FALSE, | |
1698 G_CALLBACK(about_window_close), NULL); | |
1699 gtk_container_add(GTK_CONTAINER(hbox), button); | |
1700 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
1701 gtk_widget_grab_default(button); | |
1702 gtk_widget_show(button); | |
1703 | |
1704 gtk_widget_show(about); | |
1705 } |