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