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