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