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