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