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