Mercurial > geeqie
annotate src/preferences.c @ 1746:a0e47436b552
editor fixes
- fixed editor loading order
- fixed EditorWindow->modified flag handling
author | nadvornik |
---|---|
date | Sat, 12 Sep 2009 15:51:37 +0000 |
parents | 59c72fd324ce |
children | 956aab097ea7 |
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 |
1284 | 4 * Copyright (C) 2008 - 2009 The Geeqie Team |
9 | 5 * |
6 * Author: John Ellis | |
7 * | |
8 * This software is released under the GNU General Public License (GNU GPL). | |
9 * Please read the included file COPYING for more information. | |
10 * This software comes with no warranty of any kind, use at your own risk! | |
11 */ | |
12 | |
13 | |
281 | 14 #include "main.h" |
9 | 15 #include "preferences.h" |
16 | |
648
e34c1002e553
Move some functions from main.[ch] to new window.[ch].
zas_
parents:
630
diff
changeset
|
17 #include "bar_exif.h" |
1599 | 18 #include "cache.h" |
9 | 19 #include "cache_maint.h" |
20 #include "editors.h" | |
648
e34c1002e553
Move some functions from main.[ch] to new window.[ch].
zas_
parents:
630
diff
changeset
|
21 #include "exif.h" |
586 | 22 #include "filedata.h" |
23 #include "filefilter.h" | |
9 | 24 #include "fullscreen.h" |
26
acd9885ebd78
Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents:
15
diff
changeset
|
25 #include "image.h" |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
26 #include "image-overlay.h" |
426
9fe0ca1b5263
show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents:
413
diff
changeset
|
27 #include "color-man.h" |
9 | 28 #include "img-view.h" |
29 #include "layout_config.h" | |
30 #include "layout_util.h" | |
31 #include "pixbuf_util.h" | |
32 #include "slideshow.h" | |
597 | 33 #include "trash.h" |
9 | 34 #include "utilops.h" |
35 #include "ui_fileops.h" | |
36 #include "ui_misc.h" | |
37 #include "ui_tabcomp.h" | |
38 #include "ui_utildlg.h" | |
648
e34c1002e553
Move some functions from main.[ch] to new window.[ch].
zas_
parents:
630
diff
changeset
|
39 #include "window.h" |
9 | 40 |
41 #include <math.h> | |
42 | |
43 | |
44 #define EDITOR_NAME_MAX_LENGTH 32 | |
45 #define EDITOR_COMMAND_MAX_LENGTH 1024 | |
46 | |
47 | |
48 typedef struct _ThumbSize ThumbSize; | |
49 struct _ThumbSize | |
50 { | |
51 gint w; | |
52 gint h; | |
53 }; | |
54 | |
55 static ThumbSize thumb_size_list[] = | |
56 { | |
57 { 24, 24 }, | |
58 { 32, 32 }, | |
59 { 48, 48 }, | |
60 { 64, 64 }, | |
61 { 96, 72 }, | |
62 { 96, 96 }, | |
63 { 128, 96 }, | |
64 { 128, 128 }, | |
65 { 160, 120 }, | |
66 { 160, 160 }, | |
67 { 192, 144 }, | |
68 { 192, 192 }, | |
69 { 256, 192 }, | |
70 { 256, 256 } | |
71 }; | |
72 | |
73 enum { | |
74 FE_ENABLE, | |
75 FE_EXTENSION, | |
1216 | 76 FE_DESCRIPTION, |
1239
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
77 FE_CLASS, |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
78 FE_WRITABLE, |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
79 FE_ALLOW_SIDECAR |
9 | 80 }; |
81 | |
1601 | 82 enum { |
83 AE_ACTION, | |
84 AE_KEY, | |
85 AE_TOOLTIP, | |
86 AE_ACCEL | |
87 }; | |
1216 | 88 |
89 static gchar *format_class_list[] = { | |
90 N_("Unknown"), | |
91 N_("Image"), | |
92 N_("RAW Image"), | |
93 N_("Metadata") | |
94 }; | |
95 | |
9 | 96 /* config memory values */ |
321 | 97 static ConfOptions *c_options = NULL; |
9 | 98 |
99 | |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
100 #ifdef DEBUG |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
101 static gint debug_c; |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
102 #endif |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
103 |
9 | 104 static GtkWidget *configwindow = NULL; |
105 static GtkListStore *filter_store = NULL; | |
1601 | 106 static GtkTreeStore *accel_store = NULL; |
9 | 107 |
108 static GtkWidget *safe_delete_path_entry; | |
109 | |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
110 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
|
111 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
|
112 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
|
113 |
170
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
114 static GtkWidget *sidecar_ext_entry; |
225
649f7cb544e0
Make the preferences window resizeable, and try to improve
zas_
parents:
224
diff
changeset
|
115 |
649f7cb544e0
Make the preferences window resizeable, and try to improve
zas_
parents:
224
diff
changeset
|
116 |
649f7cb544e0
Make the preferences window resizeable, and try to improve
zas_
parents:
224
diff
changeset
|
117 #define CONFIG_WINDOW_DEF_WIDTH 700 |
1039
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
118 #define CONFIG_WINDOW_DEF_HEIGHT 600 |
225
649f7cb544e0
Make the preferences window resizeable, and try to improve
zas_
parents:
224
diff
changeset
|
119 |
9 | 120 /* |
121 *----------------------------------------------------------------------------- | |
122 * option widget callbacks (private) | |
123 *----------------------------------------------------------------------------- | |
442 | 124 */ |
9 | 125 |
1039
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
126 static void zoom_mode_cb(GtkWidget *widget, gpointer data) |
9 | 127 { |
128 if (GTK_TOGGLE_BUTTON (widget)->active) | |
1039
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
129 c_options->image.zoom_mode = GPOINTER_TO_INT(data); |
9 | 130 } |
131 | |
1038
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
132 static void scroll_reset_cb(GtkWidget *widget, gpointer data) |
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
133 { |
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
134 if (GTK_TOGGLE_BUTTON (widget)->active) |
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
135 c_options->image.scroll_reset_method = GPOINTER_TO_INT(data); |
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
136 } |
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
137 |
9 | 138 static void zoom_increment_cb(GtkWidget *spin, gpointer data) |
139 { | |
334 | 140 c_options->image.zoom_increment = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * 10.0 + 0.01); |
9 | 141 } |
142 | |
143 static void slideshow_delay_cb(GtkWidget *spin, gpointer data) | |
144 { | |
326 | 145 c_options->slideshow.delay = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
995
diff
changeset
|
146 (gdouble)SLIDESHOW_SUBSECOND_PRECISION + 0.01); |
9 | 147 } |
148 | |
149 /* | |
150 *----------------------------------------------------------------------------- | |
151 * sync progam to config window routine (private) | |
152 *----------------------------------------------------------------------------- | |
442 | 153 */ |
9 | 154 |
1436
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1400
diff
changeset
|
155 void config_entry_to_option(GtkWidget *entry, gchar **option, gchar *(*func)(const gchar *)) |
9 | 156 { |
157 const gchar *buf; | |
1042
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
158 |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
159 g_free(*option); |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
160 *option = NULL; |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
161 buf = gtk_entry_get_text(GTK_ENTRY(entry)); |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
162 if (buf && strlen(buf) > 0) |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
163 { |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
164 if (func) |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
165 *option = func(buf); |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
166 else |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
167 *option = g_strdup(buf); |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
168 } |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
169 } |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
170 |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
171 |
1601 | 172 static gboolean accel_apply_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
173 { | |
174 gchar *accel_path, *accel; | |
175 | |
176 gtk_tree_model_get(model, iter, AE_ACCEL, &accel_path, AE_KEY, &accel, -1); | |
177 | |
178 if (accel_path && accel_path[0]) | |
179 { | |
180 GtkAccelKey key; | |
181 gtk_accelerator_parse(accel, &key.accel_key, &key.accel_mods); | |
182 gtk_accel_map_change_entry(accel_path, key.accel_key, key.accel_mods, TRUE); | |
183 } | |
184 | |
185 g_free(accel_path); | |
186 g_free(accel); | |
187 | |
188 return FALSE; | |
189 } | |
190 | |
191 | |
1042
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
192 static void config_window_apply(void) |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
193 { |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
194 gint i; |
1437 | 195 gboolean refresh = FALSE; |
1042
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
196 |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
197 config_entry_to_option(safe_delete_path_entry, &options->file_ops.safe_delete_path, remove_trailing_slash); |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
198 |
356 | 199 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
|
200 if (options->file_filter.show_dot_directory != c_options->file_filter.show_dot_directory) refresh = TRUE; |
329 | 201 if (options->file_sort.case_sensitive != c_options->file_sort.case_sensitive) refresh = TRUE; |
332 | 202 if (options->file_filter.disable != c_options->file_filter.disable) refresh = TRUE; |
9 | 203 |
341
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
204 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
|
205 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
|
206 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
|
207 options->file_ops.safe_delete_folder_maxsize = c_options->file_ops.safe_delete_folder_maxsize; |
1436
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1400
diff
changeset
|
208 options->tools_restore_state = c_options->tools_restore_state; |
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1400
diff
changeset
|
209 options->save_window_positions = c_options->save_window_positions; |
334 | 210 options->image.zoom_mode = c_options->image.zoom_mode; |
1038
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
211 options->image.scroll_reset_method = c_options->image.scroll_reset_method; |
334 | 212 options->image.zoom_2pass = c_options->image.zoom_2pass; |
213 options->image.fit_window_to_image = c_options->image.fit_window_to_image; | |
214 options->image.limit_window_size = c_options->image.limit_window_size; | |
215 options->image.zoom_to_fit_allow_expand = c_options->image.zoom_to_fit_allow_expand; | |
216 options->image.max_window_size = c_options->image.max_window_size; | |
217 options->image.limit_autofit_size = c_options->image.limit_autofit_size; | |
218 options->image.max_autofit_size = c_options->image.max_autofit_size; | |
321 | 219 options->progressive_key_scrolling = c_options->progressive_key_scrolling; |
1506
d352a44545a6
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
zas_
parents:
1443
diff
changeset
|
220 if (options->thumbnails.max_width != c_options->thumbnails.max_width |
d352a44545a6
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
zas_
parents:
1443
diff
changeset
|
221 || options->thumbnails.max_height != c_options->thumbnails.max_height |
d352a44545a6
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
zas_
parents:
1443
diff
changeset
|
222 || options->thumbnails.quality != c_options->thumbnails.quality) |
d352a44545a6
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
zas_
parents:
1443
diff
changeset
|
223 { |
d352a44545a6
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
zas_
parents:
1443
diff
changeset
|
224 thumb_format_changed = TRUE; |
d352a44545a6
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
zas_
parents:
1443
diff
changeset
|
225 refresh = TRUE; |
d352a44545a6
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
zas_
parents:
1443
diff
changeset
|
226 options->thumbnails.max_width = c_options->thumbnails.max_width; |
d352a44545a6
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
zas_
parents:
1443
diff
changeset
|
227 options->thumbnails.max_height = c_options->thumbnails.max_height; |
d352a44545a6
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
zas_
parents:
1443
diff
changeset
|
228 options->thumbnails.quality = c_options->thumbnails.quality; |
d352a44545a6
Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
zas_
parents:
1443
diff
changeset
|
229 } |
333 | 230 options->thumbnails.enable_caching = c_options->thumbnails.enable_caching; |
231 options->thumbnails.cache_into_dirs = c_options->thumbnails.cache_into_dirs; | |
1060 | 232 options->thumbnails.use_exif = c_options->thumbnails.use_exif; |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
233 #if 0 |
333 | 234 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
|
235 #endif |
333 | 236 options->thumbnails.spec_standard = c_options->thumbnails.spec_standard; |
1208 | 237 options->metadata.enable_metadata_dirs = c_options->metadata.enable_metadata_dirs; |
356 | 238 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
|
239 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
|
240 |
329 | 241 options->file_sort.case_sensitive = c_options->file_sort.case_sensitive; |
332 | 242 options->file_filter.disable = c_options->file_filter.disable; |
9 | 243 |
1229
878718372aca
sidecar files grouping was made case-insensitive
nadvornik
parents:
1216
diff
changeset
|
244 config_entry_to_option(sidecar_ext_entry, &options->sidecar.ext, NULL); |
1327 | 245 sidecar_ext_parse(options->sidecar.ext); |
170
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
246 |
326 | 247 options->slideshow.random = c_options->slideshow.random; |
248 options->slideshow.repeat = c_options->slideshow.repeat; | |
249 options->slideshow.delay = c_options->slideshow.delay; | |
9 | 250 |
321 | 251 options->mousewheel_scrolls = c_options->mousewheel_scrolls; |
9 | 252 |
341
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
253 options->file_ops.enable_in_place_rename = c_options->file_ops.enable_in_place_rename; |
9 | 254 |
330 | 255 options->collections.rectangular_selection = c_options->collections.rectangular_selection; |
9 | 256 |
334 | 257 options->image.tile_cache_max = c_options->image.tile_cache_max; |
848 | 258 options->image.image_cache_max = c_options->image.image_cache_max; |
442 | 259 |
334 | 260 options->image.zoom_quality = c_options->image.zoom_quality; |
9 | 261 |
334 | 262 options->image.zoom_increment = c_options->image.zoom_increment; |
9 | 263 |
334 | 264 options->image.enable_read_ahead = c_options->image.enable_read_ahead; |
9 | 265 |
1626
1d7941c147be
Add an option to Image preferences to restrict custom border to fullscreen mode only. Bug 2798062.
zas_
parents:
1625
diff
changeset
|
266 |
339
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
338
diff
changeset
|
267 if (options->image.use_custom_border_color != c_options->image.use_custom_border_color |
1644
b8235f919d6b
the options for custom border color were made independent
nadvornik
parents:
1626
diff
changeset
|
268 || options->image.use_custom_border_color_in_fullscreen != c_options->image.use_custom_border_color_in_fullscreen |
339
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
338
diff
changeset
|
269 || !gdk_color_equal(&options->image.border_color, &c_options->image.border_color)) |
9 | 270 { |
1644
b8235f919d6b
the options for custom border color were made independent
nadvornik
parents:
1626
diff
changeset
|
271 options->image.use_custom_border_color_in_fullscreen = c_options->image.use_custom_border_color_in_fullscreen; |
339
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
338
diff
changeset
|
272 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
|
273 options->image.border_color = c_options->image.border_color; |
9 | 274 layout_colors_update(); |
275 view_window_colors_update(); | |
276 } | |
277 | |
322 | 278 options->fullscreen.screen = c_options->fullscreen.screen; |
279 options->fullscreen.clean_flip = c_options->fullscreen.clean_flip; | |
280 options->fullscreen.disable_saver = c_options->fullscreen.disable_saver; | |
281 options->fullscreen.above = c_options->fullscreen.above; | |
1336 | 282 if (c_options->image_overlay.template_string) |
283 set_image_overlay_template_string(&options->image_overlay.template_string, | |
284 c_options->image_overlay.template_string); | |
733
57f759d012c7
Modify set_default_image_overlay_template_string() to accept the pointer to
zas_
parents:
730
diff
changeset
|
285 |
321 | 286 options->update_on_time_change = c_options->update_on_time_change; |
334 | 287 options->image.exif_rotate_enable = c_options->image.exif_rotate_enable; |
9 | 288 |
342
07490120df2d
Rename dupe_custom_threshold option to duplicates_similarity_threshold.
zas_
parents:
341
diff
changeset
|
289 options->duplicates_similarity_threshold = c_options->duplicates_similarity_threshold; |
9 | 290 |
321 | 291 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
|
292 |
08eb7137cd94
Allow the user to change open_recent_list_maxsize option through
zas_
parents:
426
diff
changeset
|
293 options->open_recent_list_maxsize = c_options->open_recent_list_maxsize; |
458
7a69309b91c8
Allow the user to set the drag'n drop icon size through
zas_
parents:
446
diff
changeset
|
294 options->dnd_icon_size = c_options->dnd_icon_size; |
497 | 295 |
1208 | 296 options->metadata.save_in_image_file = c_options->metadata.save_in_image_file; |
1213 | 297 options->metadata.save_legacy_IPTC = c_options->metadata.save_legacy_IPTC; |
298 options->metadata.warn_on_write_problems = c_options->metadata.warn_on_write_problems; | |
299 options->metadata.save_legacy_format = c_options->metadata.save_legacy_format; | |
300 options->metadata.sync_grouped_files = c_options->metadata.sync_grouped_files; | |
301 options->metadata.confirm_write = c_options->metadata.confirm_write; | |
302 options->metadata.confirm_timeout = c_options->metadata.confirm_timeout; | |
1244 | 303 options->metadata.confirm_after_timeout = c_options->metadata.confirm_after_timeout; |
1213 | 304 options->metadata.confirm_on_image_change = c_options->metadata.confirm_on_image_change; |
305 options->metadata.confirm_on_dir_change = c_options->metadata.confirm_on_dir_change; | |
1590
1a5a3b7ca2cd
use "keywords" instead of "tags" in option name, it is more consistent
nadvornik
parents:
1567
diff
changeset
|
306 options->metadata.keywords_case_sensitive = c_options->metadata.keywords_case_sensitive; |
1567
c776b1310ca6
added an option to write image orientation to the metadata
nadvornik
parents:
1548
diff
changeset
|
307 options->metadata.write_orientation = c_options->metadata.write_orientation; |
594
4cfce4ed35e0
Use a dedicated option to enable keywords and comment saving as XMP tags
zas_
parents:
586
diff
changeset
|
308 |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
309 #ifdef DEBUG |
507 | 310 set_debug_level(debug_c); |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
311 #endif |
9 | 312 |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
313 #ifdef HAVE_LCMS |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
314 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
|
315 { |
1042
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
316 config_entry_to_option(color_profile_input_name_entry[i], &options->color_profile.input_name[i], NULL); |
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
317 config_entry_to_option(color_profile_input_file_entry[i], &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
|
318 } |
1042
e59a9c96d290
Shorten config_window_apply() a bit, reduce code redunancy.
zas_
parents:
1039
diff
changeset
|
319 config_entry_to_option(color_profile_screen_file_entry, &options->color_profile.screen_file, NULL); |
1548 | 320 options->color_profile.use_x11_screen_profile = c_options->color_profile.use_x11_screen_profile; |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
321 #endif |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
322 |
1353 | 323 #if 0 |
520 | 324 for (i = 0; ExifUIList[i].key; i++) |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
325 { |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
326 ExifUIList[i].current = ExifUIList[i].temp; |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
327 } |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
328 |
1353 | 329 #endif |
26
acd9885ebd78
Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents:
15
diff
changeset
|
330 image_options_sync(); |
acd9885ebd78
Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents:
15
diff
changeset
|
331 |
9 | 332 if (refresh) |
333 { | |
334 filter_rebuild(); | |
335 layout_refresh(NULL); | |
336 } | |
1601 | 337 |
338 if (accel_store) gtk_tree_model_foreach(GTK_TREE_MODEL(accel_store), accel_apply_cb, NULL); | |
9 | 339 } |
340 | |
341 /* | |
342 *----------------------------------------------------------------------------- | |
343 * config window main button callbacks (private) | |
344 *----------------------------------------------------------------------------- | |
442 | 345 */ |
9 | 346 |
347 static void config_window_close_cb(GtkWidget *widget, gpointer data) | |
348 { | |
349 gtk_widget_destroy(configwindow); | |
350 configwindow = NULL; | |
351 filter_store = NULL; | |
352 } | |
353 | |
1443 | 354 static gboolean config_window_delete(GtkWidget *widget, GdkEventAny *event, gpointer data) |
9 | 355 { |
356 config_window_close_cb(NULL, NULL); | |
357 return TRUE; | |
358 } | |
359 | |
360 static void config_window_ok_cb(GtkWidget *widget, gpointer data) | |
361 { | |
362 config_window_apply(); | |
363 config_window_close_cb(NULL, NULL); | |
364 } | |
365 | |
366 static void config_window_apply_cb(GtkWidget *widget, gpointer data) | |
367 { | |
368 config_window_apply(); | |
369 } | |
370 | |
1024
c92e5a5c3bfa
Add a Save button to Preferences dialog, which allow to save options to file without quitting the application.
zas_
parents:
1001
diff
changeset
|
371 static void config_window_save_cb(GtkWidget *widget, gpointer data) |
c92e5a5c3bfa
Add a Save button to Preferences dialog, which allow to save options to file without quitting the application.
zas_
parents:
1001
diff
changeset
|
372 { |
c92e5a5c3bfa
Add a Save button to Preferences dialog, which allow to save options to file without quitting the application.
zas_
parents:
1001
diff
changeset
|
373 config_window_apply(); |
c92e5a5c3bfa
Add a Save button to Preferences dialog, which allow to save options to file without quitting the application.
zas_
parents:
1001
diff
changeset
|
374 save_options(options); |
c92e5a5c3bfa
Add a Save button to Preferences dialog, which allow to save options to file without quitting the application.
zas_
parents:
1001
diff
changeset
|
375 } |
c92e5a5c3bfa
Add a Save button to Preferences dialog, which allow to save options to file without quitting the application.
zas_
parents:
1001
diff
changeset
|
376 |
9 | 377 /* |
378 *----------------------------------------------------------------------------- | |
379 * config window setup (private) | |
380 *----------------------------------------------------------------------------- | |
442 | 381 */ |
9 | 382 |
383 static void quality_menu_cb(GtkWidget *combo, gpointer data) | |
384 { | |
385 gint *option = data; | |
386 | |
387 switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo))) | |
388 { | |
389 case 0: | |
390 default: | |
391 *option = GDK_INTERP_NEAREST; | |
392 break; | |
393 case 1: | |
394 *option = GDK_INTERP_TILES; | |
395 break; | |
396 case 2: | |
397 *option = GDK_INTERP_BILINEAR; | |
398 break; | |
399 case 3: | |
400 *option = GDK_INTERP_HYPER; | |
401 break; | |
402 } | |
403 } | |
404 | |
405 static void add_quality_menu(GtkWidget *table, gint column, gint row, const gchar *text, | |
1188 | 406 guint option, guint *option_c) |
9 | 407 { |
408 GtkWidget *combo; | |
409 gint current = 0; | |
410 | |
411 *option_c = option; | |
412 | |
413 pref_table_label(table, column, row, text, 0.0); | |
414 | |
415 combo = gtk_combo_box_new_text(); | |
416 | |
417 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Nearest (worst, but fastest)")); | |
418 if (option == GDK_INTERP_NEAREST) current = 0; | |
419 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Tiles")); | |
420 if (option == GDK_INTERP_TILES) current = 1; | |
421 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Bilinear")); | |
422 if (option == GDK_INTERP_BILINEAR) current = 2; | |
423 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Hyper (best, but slowest)")); | |
424 if (option == GDK_INTERP_HYPER) current = 3; | |
425 | |
426 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current); | |
427 | |
428 g_signal_connect(G_OBJECT(combo), "changed", | |
429 G_CALLBACK(quality_menu_cb), option_c); | |
430 | |
431 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
|
432 GTK_EXPAND | GTK_FILL, 0, 0, 0); |
9 | 433 gtk_widget_show(combo); |
434 } | |
435 | |
436 #if 0 | |
437 static void add_dither_menu(gint option, gint *option_c, gchar *text, GtkWidget *box) | |
438 { | |
439 GtkWidget *hbox; | |
440 GtkWidget *omenu; | |
441 GtkWidget *menu; | |
442 | |
443 *option_c = option; | |
444 | |
445 hbox = pref_box_new(box, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
446 pref_label_new(hbox, text); | |
447 | |
448 omenu = gtk_option_menu_new(); | |
449 menu = gtk_menu_new(); | |
450 | |
451 add_menu_item(menu, _("None"), option_c, (gint)GDK_RGB_DITHER_NONE); | |
452 add_menu_item(menu, _("Normal"), option_c, (gint)GDK_RGB_DITHER_NORMAL); | |
453 add_menu_item(menu, _("Best"), option_c, (gint)GDK_RGB_DITHER_MAX); | |
454 | |
455 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
456 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), *option_c); | |
457 | |
458 gtk_box_pack_start(GTK_BOX(hbox), omenu, FALSE, FALSE, 0); | |
459 gtk_widget_show(omenu); | |
460 } | |
461 #endif | |
462 | |
463 static void thumb_size_menu_cb(GtkWidget *combo, gpointer data) | |
464 { | |
465 gint n; | |
466 | |
467 n = gtk_combo_box_get_active(GTK_COMBO_BOX(combo)); | |
736 | 468 if (n < 0) return; |
9 | 469 |
736 | 470 if ((guint) n < sizeof(thumb_size_list) / sizeof(ThumbSize)) |
9 | 471 { |
333 | 472 c_options->thumbnails.max_width = thumb_size_list[n].w; |
473 c_options->thumbnails.max_height = thumb_size_list[n].h; | |
9 | 474 } |
736 | 475 else |
9 | 476 { |
333 | 477 c_options->thumbnails.max_width = options->thumbnails.max_width; |
478 c_options->thumbnails.max_height = options->thumbnails.max_height; | |
9 | 479 } |
480 } | |
481 | |
482 static void add_thumb_size_menu(GtkWidget *table, gint column, gint row, gchar *text) | |
483 { | |
484 GtkWidget *combo; | |
485 gint current; | |
486 gint i; | |
487 | |
333 | 488 c_options->thumbnails.max_width = options->thumbnails.max_width; |
489 c_options->thumbnails.max_height = options->thumbnails.max_height; | |
9 | 490 |
491 pref_table_label(table, column, row, text, 0.0); | |
492 | |
493 combo = gtk_combo_box_new_text(); | |
494 | |
495 current = -1; | |
736 | 496 for (i = 0; (guint) i < sizeof(thumb_size_list) / sizeof(ThumbSize); i++) |
9 | 497 { |
498 gint w, h; | |
226
3c89da4aef95
Fix and simplify thumbnails size combo box related code.
zas_
parents:
225
diff
changeset
|
499 gchar *buf; |
9 | 500 |
501 w = thumb_size_list[i].w; | |
502 h = thumb_size_list[i].h; | |
503 | |
226
3c89da4aef95
Fix and simplify thumbnails size combo box related code.
zas_
parents:
225
diff
changeset
|
504 buf = g_strdup_printf("%d x %d", w, h); |
3c89da4aef95
Fix and simplify thumbnails size combo box related code.
zas_
parents:
225
diff
changeset
|
505 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
|
506 g_free(buf); |
442 | 507 |
333 | 508 if (w == options->thumbnails.max_width && h == options->thumbnails.max_height) current = i; |
9 | 509 } |
510 | |
511 if (current == -1) | |
512 { | |
513 gchar *buf; | |
514 | |
333 | 515 buf = g_strdup_printf("%s %d x %d", _("Custom"), options->thumbnails.max_width, options->thumbnails.max_height); |
9 | 516 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), buf); |
517 g_free(buf); | |
518 | |
226
3c89da4aef95
Fix and simplify thumbnails size combo box related code.
zas_
parents:
225
diff
changeset
|
519 current = i; |
9 | 520 } |
521 | |
522 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current); | |
523 g_signal_connect(G_OBJECT(combo), "changed", | |
524 G_CALLBACK(thumb_size_menu_cb), NULL); | |
525 | |
526 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
|
527 GTK_EXPAND | GTK_FILL, 0, 0, 0); |
9 | 528 gtk_widget_show(combo); |
529 } | |
530 | |
531 static void filter_store_populate(void) | |
532 { | |
533 GList *work; | |
534 | |
535 if (!filter_store) return; | |
536 | |
537 gtk_list_store_clear(filter_store); | |
538 | |
539 work = filter_get_list(); | |
540 while (work) | |
541 { | |
542 FilterEntry *fe; | |
543 GtkTreeIter iter; | |
544 | |
545 fe = work->data; | |
546 work = work->next; | |
547 | |
548 gtk_list_store_append(filter_store, &iter); | |
549 gtk_list_store_set(filter_store, &iter, 0, fe, -1); | |
550 } | |
551 } | |
552 | |
553 static void filter_store_ext_edit_cb(GtkCellRendererText *cell, gchar *path_str, | |
554 gchar *new_text, gpointer data) | |
555 { | |
556 GtkWidget *model = data; | |
557 FilterEntry *fe = data; | |
558 GtkTreePath *tpath; | |
559 GtkTreeIter iter; | |
560 | |
561 if (!new_text || strlen(new_text) < 1) return; | |
562 | |
563 tpath = gtk_tree_path_new_from_string(path_str); | |
564 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, tpath); | |
565 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 0, &fe, -1); | |
566 | |
567 g_free(fe->extensions); | |
568 fe->extensions = g_strdup(new_text); | |
569 | |
570 gtk_tree_path_free(tpath); | |
571 filter_rebuild(); | |
572 } | |
573 | |
1216 | 574 static void filter_store_class_edit_cb(GtkCellRendererText *cell, gchar *path_str, |
1443 | 575 gchar *new_text, gpointer data) |
1216 | 576 { |
577 GtkWidget *model = data; | |
578 FilterEntry *fe = data; | |
579 GtkTreePath *tpath; | |
580 GtkTreeIter iter; | |
581 gint i; | |
582 | |
1443 | 583 if (!new_text || !new_text[0]) return; |
1216 | 584 |
585 tpath = gtk_tree_path_new_from_string(path_str); | |
586 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, tpath); | |
587 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 0, &fe, -1); | |
588 | |
589 for (i = 0; i < FILE_FORMAT_CLASSES; i++) | |
590 { | |
591 if (strcmp(new_text, _(format_class_list[i])) == 0) | |
592 { | |
593 fe->file_class = i; | |
594 break; | |
595 } | |
596 } | |
597 | |
598 gtk_tree_path_free(tpath); | |
599 filter_rebuild(); | |
600 } | |
601 | |
9 | 602 static void filter_store_desc_edit_cb(GtkCellRendererText *cell, gchar *path_str, |
603 gchar *new_text, gpointer data) | |
604 { | |
605 GtkWidget *model = data; | |
606 FilterEntry *fe; | |
607 GtkTreePath *tpath; | |
608 GtkTreeIter iter; | |
609 | |
1443 | 610 if (!new_text || !new_text[0]) return; |
9 | 611 |
612 tpath = gtk_tree_path_new_from_string(path_str); | |
613 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, tpath); | |
614 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 0, &fe, -1); | |
615 | |
616 g_free(fe->description); | |
617 fe->description = g_strdup(new_text); | |
618 | |
619 gtk_tree_path_free(tpath); | |
620 } | |
621 | |
622 static void filter_store_enable_cb(GtkCellRendererToggle *renderer, | |
623 gchar *path_str, gpointer data) | |
624 { | |
625 GtkWidget *model = data; | |
626 FilterEntry *fe; | |
627 GtkTreePath *tpath; | |
628 GtkTreeIter iter; | |
629 | |
630 tpath = gtk_tree_path_new_from_string(path_str); | |
631 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, tpath); | |
632 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 0, &fe, -1); | |
633 | |
634 fe->enabled = !fe->enabled; | |
635 | |
636 gtk_tree_path_free(tpath); | |
637 filter_rebuild(); | |
638 } | |
639 | |
1239
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
640 static void filter_store_writable_cb(GtkCellRendererToggle *renderer, |
1443 | 641 gchar *path_str, gpointer data) |
1239
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
642 { |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
643 GtkWidget *model = data; |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
644 FilterEntry *fe; |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
645 GtkTreePath *tpath; |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
646 GtkTreeIter iter; |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
647 |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
648 tpath = gtk_tree_path_new_from_string(path_str); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
649 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, tpath); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
650 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 0, &fe, -1); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
651 |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
652 fe->writable = !fe->writable; |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
653 if (fe->writable) fe->allow_sidecar = FALSE; |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
654 |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
655 gtk_tree_path_free(tpath); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
656 filter_rebuild(); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
657 } |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
658 |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
659 static void filter_store_sidecar_cb(GtkCellRendererToggle *renderer, |
1443 | 660 gchar *path_str, gpointer data) |
1239
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
661 { |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
662 GtkWidget *model = data; |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
663 FilterEntry *fe; |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
664 GtkTreePath *tpath; |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
665 GtkTreeIter iter; |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
666 |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
667 tpath = gtk_tree_path_new_from_string(path_str); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
668 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, tpath); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
669 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 0, &fe, -1); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
670 |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
671 fe->allow_sidecar = !fe->allow_sidecar; |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
672 if (fe->allow_sidecar) fe->writable = FALSE; |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
673 |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
674 gtk_tree_path_free(tpath); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
675 filter_rebuild(); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
676 } |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
677 |
9 | 678 static void filter_set_func(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, |
679 GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) | |
680 { | |
681 FilterEntry *fe; | |
682 | |
683 gtk_tree_model_get(tree_model, iter, 0, &fe, -1); | |
684 | |
1347
79937bc55f3a
Add missing space between switch and first parenthesis.
zas_
parents:
1346
diff
changeset
|
685 switch (GPOINTER_TO_INT(data)) |
9 | 686 { |
687 case FE_ENABLE: | |
688 g_object_set(GTK_CELL_RENDERER(cell), | |
689 "active", fe->enabled, NULL); | |
690 break; | |
691 case FE_EXTENSION: | |
692 g_object_set(GTK_CELL_RENDERER(cell), | |
693 "text", fe->extensions, NULL); | |
694 break; | |
695 case FE_DESCRIPTION: | |
696 g_object_set(GTK_CELL_RENDERER(cell), | |
697 "text", fe->description, NULL); | |
698 break; | |
1216 | 699 case FE_CLASS: |
700 g_object_set(GTK_CELL_RENDERER(cell), | |
701 "text", _(format_class_list[fe->file_class]), NULL); | |
702 break; | |
1239
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
703 case FE_WRITABLE: |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
704 g_object_set(GTK_CELL_RENDERER(cell), |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
705 "active", fe->writable, NULL); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
706 break; |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
707 case FE_ALLOW_SIDECAR: |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
708 g_object_set(GTK_CELL_RENDERER(cell), |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
709 "active", fe->allow_sidecar, NULL); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
710 break; |
9 | 711 } |
712 } | |
713 | |
714 static void filter_add_cb(GtkWidget *widget, gpointer data) | |
715 { | |
1239
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
716 filter_add_unique("description", ".new", FORMAT_CLASS_IMAGE, TRUE, FALSE, TRUE); |
9 | 717 filter_store_populate(); |
718 | |
719 /* FIXME: implement the scroll to/select row stuff for tree view */ | |
720 } | |
721 | |
722 static void filter_remove_cb(GtkWidget *widget, gpointer data) | |
723 { | |
724 GtkWidget *filter_view = data; | |
725 GtkTreeSelection *selection; | |
726 GtkTreeIter iter; | |
727 FilterEntry *fe; | |
728 | |
729 if (!filter_store) return; | |
995 | 730 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(filter_view)); |
9 | 731 if (!gtk_tree_selection_get_selected(selection, NULL, &iter)) return; |
732 gtk_tree_model_get(GTK_TREE_MODEL(filter_store), &iter, 0, &fe, -1); | |
733 if (!fe) return; | |
734 | |
735 filter_remove_entry(fe); | |
736 filter_rebuild(); | |
737 filter_store_populate(); | |
738 } | |
739 | |
740 static void filter_default_ok_cb(GenericDialog *gd, gpointer data) | |
741 { | |
742 filter_reset(); | |
743 filter_add_defaults(); | |
744 filter_rebuild(); | |
745 filter_store_populate(); | |
746 } | |
747 | |
748 static void dummy_cancel_cb(GenericDialog *gd, gpointer data) | |
749 { | |
750 /* no op, only so cancel button appears */ | |
751 } | |
752 | |
753 static void filter_default_cb(GtkWidget *widget, gpointer data) | |
754 { | |
755 GenericDialog *gd; | |
756 | |
757 gd = generic_dialog_new(_("Reset filters"), | |
1174
0bea79d87065
Drop useless wmclass stuff. Gtk will take care of it and as said in the documentation using gtk_window_set_wmclass() is sort of pointless.
zas_
parents:
1060
diff
changeset
|
758 "reset_filter", widget, TRUE, |
9 | 759 dummy_cancel_cb, NULL); |
760 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Reset filters"), | |
761 _("This will reset the file filters to the defaults.\nContinue?")); | |
762 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, filter_default_ok_cb, TRUE); | |
763 gtk_widget_show(gd->dialog); | |
764 } | |
765 | |
1001 | 766 static void filter_disable_cb(GtkWidget *widget, gpointer data) |
9 | 767 { |
768 GtkWidget *frame = data; | |
769 | |
770 gtk_widget_set_sensitive(frame, | |
771 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))); | |
772 } | |
773 | |
1001 | 774 static void safe_delete_view_cb(GtkWidget *widget, gpointer data) |
9 | 775 { |
776 layout_set_path(NULL, gtk_entry_get_text(GTK_ENTRY(safe_delete_path_entry))); | |
777 } | |
778 | |
779 static void safe_delete_clear_ok_cb(GenericDialog *gd, gpointer data) | |
780 { | |
781 file_util_trash_clear(); | |
782 } | |
783 | |
1001 | 784 static void safe_delete_clear_cb(GtkWidget *widget, gpointer data) |
9 | 785 { |
786 GenericDialog *gd; | |
787 GtkWidget *entry; | |
788 gd = generic_dialog_new(_("Clear trash"), | |
1174
0bea79d87065
Drop useless wmclass stuff. Gtk will take care of it and as said in the documentation using gtk_window_set_wmclass() is sort of pointless.
zas_
parents:
1060
diff
changeset
|
789 "clear_trash", widget, TRUE, |
9 | 790 dummy_cancel_cb, NULL); |
791 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Clear trash"), | |
792 _("This will remove the trash contents.")); | |
793 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, safe_delete_clear_ok_cb, TRUE); | |
794 entry = gtk_entry_new(); | |
795 GTK_WIDGET_UNSET_FLAGS(entry, GTK_CAN_FOCUS); | |
796 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
|
797 if (options->file_ops.safe_delete_path) gtk_entry_set_text(GTK_ENTRY(entry), options->file_ops.safe_delete_path); |
9 | 798 gtk_box_pack_start(GTK_BOX(gd->vbox), entry, FALSE, FALSE, 0); |
799 gtk_widget_show(entry); | |
800 gtk_widget_show(gd->dialog); | |
801 } | |
802 | |
1001 | 803 static void image_overlay_template_view_changed_cb(GtkWidget *widget, gpointer data) |
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
|
804 { |
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
|
805 GtkWidget *pTextView; |
1001 | 806 GtkTextBuffer *pTextBuffer; |
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
|
807 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
|
808 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
|
809 |
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
|
810 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
|
811 |
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
|
812 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
|
813 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
|
814 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
|
815 |
1336 | 816 set_image_overlay_template_string(&c_options->image_overlay.template_string, |
733
57f759d012c7
Modify set_default_image_overlay_template_string() to accept the pointer to
zas_
parents:
730
diff
changeset
|
817 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
|
818 } |
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
|
819 |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
820 static void image_overlay_default_template_ok_cb(GenericDialog *gd, gpointer data) |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
821 { |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
822 GtkTextView *text_view = data; |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
823 GtkTextBuffer *buffer; |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
824 |
1336 | 825 set_default_image_overlay_template_string(&options->image_overlay.template_string); |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
826 if (!configwindow) return; |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
827 |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
828 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view)); |
1336 | 829 gtk_text_buffer_set_text(buffer, options->image_overlay.template_string, -1); |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
830 } |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
831 |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
832 static void image_overlay_default_template_cb(GtkWidget *widget, gpointer data) |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
833 { |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
834 GenericDialog *gd; |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
835 |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
836 gd = generic_dialog_new(_("Reset image overlay template string"), |
1174
0bea79d87065
Drop useless wmclass stuff. Gtk will take care of it and as said in the documentation using gtk_window_set_wmclass() is sort of pointless.
zas_
parents:
1060
diff
changeset
|
837 "reset_image_overlay_template_string", widget, TRUE, |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
838 dummy_cancel_cb, data); |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
839 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Reset image overlay template string"), |
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
840 _("This will reset the image overlay template string to the default.\nContinue?")); |
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
841 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, image_overlay_default_template_ok_cb, TRUE); |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
842 gtk_widget_show(gd->dialog); |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
843 } |
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
844 |
625
076e6f7e9ecb
Add an help button to OSD info configuration in Preferences dialog.
zas_
parents:
597
diff
changeset
|
845 static void image_overlay_help_cb(GtkWidget *widget, gpointer data) |
076e6f7e9ecb
Add an help button to OSD info configuration in Preferences dialog.
zas_
parents:
597
diff
changeset
|
846 { |
076e6f7e9ecb
Add an help button to OSD info configuration in Preferences dialog.
zas_
parents:
597
diff
changeset
|
847 help_window_show("overlay"); |
076e6f7e9ecb
Add an help button to OSD info configuration in Preferences dialog.
zas_
parents:
597
diff
changeset
|
848 } |
354
5c82855feba7
Add a button to reset fullscreen info string to default value.
zas_
parents:
342
diff
changeset
|
849 |
1606 | 850 #if GTK_CHECK_VERSION(2, 10, 0) |
1601 | 851 static void accel_store_populate(void) |
852 { | |
853 LayoutWindow *lw; | |
854 GList *groups, *actions; | |
855 GtkAction *action; | |
856 const gchar *accel_path; | |
857 GtkAccelKey key; | |
858 GtkTreeIter iter; | |
859 | |
860 if (!accel_store || !layout_window_list || !layout_window_list->data) return; | |
861 | |
862 gtk_tree_store_clear(accel_store); | |
863 lw = layout_window_list->data; /* get the actions from the first window, it should not matter, they should be the same in all windows */ | |
864 | |
865 g_assert(lw && lw->ui_manager); | |
866 groups = gtk_ui_manager_get_action_groups(lw->ui_manager); | |
867 while (groups) | |
868 { | |
869 actions = gtk_action_group_list_actions(GTK_ACTION_GROUP(groups->data)); | |
870 while (actions) | |
871 { | |
872 action = GTK_ACTION(actions->data); | |
873 accel_path = gtk_action_get_accel_path(action); | |
874 if (accel_path && gtk_accel_map_lookup_entry(accel_path, &key)) | |
875 { | |
876 gchar *label, *label2, *tooltip, *accel; | |
877 g_object_get(action, | |
878 "tooltip", &tooltip, | |
879 "label", &label, | |
880 NULL); | |
881 | |
882 if (pango_parse_markup(label, -1, '_', NULL, &label2, NULL, NULL) && label2) | |
883 { | |
884 g_free(label); | |
885 label = label2; | |
886 } | |
887 | |
888 accel = gtk_accelerator_name(key.accel_key, key.accel_mods); | |
1619
d35a0836c6b5
do not display menus ("FileMenu" etc.) in accelerator configuration
nadvornik
parents:
1606
diff
changeset
|
889 |
d35a0836c6b5
do not display menus ("FileMenu" etc.) in accelerator configuration
nadvornik
parents:
1606
diff
changeset
|
890 if (tooltip) |
d35a0836c6b5
do not display menus ("FileMenu" etc.) in accelerator configuration
nadvornik
parents:
1606
diff
changeset
|
891 { |
d35a0836c6b5
do not display menus ("FileMenu" etc.) in accelerator configuration
nadvornik
parents:
1606
diff
changeset
|
892 gtk_tree_store_append(accel_store, &iter, NULL); |
d35a0836c6b5
do not display menus ("FileMenu" etc.) in accelerator configuration
nadvornik
parents:
1606
diff
changeset
|
893 gtk_tree_store_set(accel_store, &iter, |
d35a0836c6b5
do not display menus ("FileMenu" etc.) in accelerator configuration
nadvornik
parents:
1606
diff
changeset
|
894 AE_ACTION, label, |
d35a0836c6b5
do not display menus ("FileMenu" etc.) in accelerator configuration
nadvornik
parents:
1606
diff
changeset
|
895 AE_KEY, accel, |
d35a0836c6b5
do not display menus ("FileMenu" etc.) in accelerator configuration
nadvornik
parents:
1606
diff
changeset
|
896 AE_TOOLTIP, tooltip ? tooltip : "", |
d35a0836c6b5
do not display menus ("FileMenu" etc.) in accelerator configuration
nadvornik
parents:
1606
diff
changeset
|
897 AE_ACCEL, accel_path, |
d35a0836c6b5
do not display menus ("FileMenu" etc.) in accelerator configuration
nadvornik
parents:
1606
diff
changeset
|
898 -1); |
d35a0836c6b5
do not display menus ("FileMenu" etc.) in accelerator configuration
nadvornik
parents:
1606
diff
changeset
|
899 } |
1601 | 900 |
901 g_free(accel); | |
902 g_free(label); | |
903 g_free(tooltip); | |
904 } | |
905 actions = actions->next; | |
906 } | |
907 | |
908 groups = groups->next; | |
909 } | |
910 } | |
911 | |
912 static void accel_store_cleared_cb(GtkCellRendererAccel *accel, gchar *path_string, gpointer user_data) | |
913 { | |
914 | |
915 } | |
916 | |
917 static gboolean accel_remove_key_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) | |
918 { | |
919 gchar *accel1 = data; | |
920 gchar *accel2; | |
921 GtkAccelKey key1; | |
922 GtkAccelKey key2; | |
923 | |
924 gtk_tree_model_get(model, iter, AE_KEY, &accel2, -1); | |
925 | |
926 gtk_accelerator_parse(accel1, &key1.accel_key, &key1.accel_mods); | |
927 gtk_accelerator_parse(accel2, &key2.accel_key, &key2.accel_mods); | |
928 | |
929 if (key1.accel_key == key2.accel_key && key1.accel_mods == key2.accel_mods) | |
930 { | |
931 gtk_tree_store_set(accel_store, iter, AE_KEY, "", -1); | |
932 DEBUG_1("accelerator key '%s' is already used, removing.", accel1); | |
933 } | |
934 | |
935 g_free(accel2); | |
936 | |
937 return FALSE; | |
938 } | |
939 | |
940 | |
941 static void accel_store_edited_cb(GtkCellRendererAccel *accel, gchar *path_string, guint accel_key, GdkModifierType accel_mods, guint hardware_keycode, gpointer user_data) | |
942 { | |
943 GtkTreeModel *model = (GtkTreeModel *)accel_store; | |
944 GtkTreeIter iter; | |
945 gchar *acc; | |
1664 | 946 gchar *accel_path; |
947 GtkAccelKey old_key, key; | |
1601 | 948 GtkTreePath *path = gtk_tree_path_new_from_string(path_string); |
949 | |
950 gtk_tree_model_get_iter(model, &iter, path); | |
1664 | 951 gtk_tree_model_get(model, &iter, AE_ACCEL, &accel_path, -1); |
952 | |
953 /* test if the accelerator can be stored without conflicts*/ | |
954 gtk_accel_map_lookup_entry(accel_path, &old_key); | |
1601 | 955 |
1664 | 956 /* change the key and read it back (change may fail on keys hardcoded in gtk)*/ |
957 gtk_accel_map_change_entry(accel_path, accel_key, accel_mods, TRUE); | |
958 gtk_accel_map_lookup_entry(accel_path, &key); | |
959 | |
960 /* restore the original for now, the key will be really changed when the changes are confirmed */ | |
961 gtk_accel_map_change_entry(accel_path, old_key.accel_key, old_key.accel_mods, TRUE); | |
962 | |
963 acc = gtk_accelerator_name(key.accel_key, key.accel_mods); | |
1601 | 964 gtk_tree_model_foreach(GTK_TREE_MODEL(accel_store), accel_remove_key_cb, acc); |
965 | |
966 gtk_tree_store_set(accel_store, &iter, AE_KEY, acc, -1); | |
967 gtk_tree_path_free(path); | |
968 g_free(acc); | |
969 } | |
970 | |
971 static void accel_default_cb(GtkWidget *widget, gpointer data) | |
972 { | |
973 accel_store_populate(); | |
974 | |
975 /* FIXME: implement the scroll to/select row stuff for tree view */ | |
976 } | |
977 | |
978 void accel_remove_selection(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) | |
979 { | |
980 gtk_tree_store_set(accel_store, iter, AE_KEY, "", -1); | |
981 } | |
982 | |
983 #if 0 | |
984 static void accel_remove_cb(GtkWidget *widget, gpointer data) | |
985 { | |
986 GtkTreeSelection *selection; | |
987 | |
988 if (!accel_store) return; | |
989 | |
990 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(data)); | |
991 gtk_tree_selection_selected_foreach(selection, &accel_remove_selection, NULL); | |
992 } | |
993 #endif | |
994 | |
995 void accel_reset_selection(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) | |
996 { | |
997 GtkAccelKey key; | |
998 gchar *accel_path, *accel; | |
999 | |
1000 gtk_tree_model_get(model, iter, AE_ACCEL, &accel_path, -1); | |
1001 gtk_accel_map_lookup_entry(accel_path, &key); | |
1002 accel = gtk_accelerator_name(key.accel_key, key.accel_mods); | |
1003 | |
1004 gtk_tree_model_foreach(GTK_TREE_MODEL(accel_store), accel_remove_key_cb, accel); | |
1005 | |
1006 gtk_tree_store_set(accel_store, iter, AE_KEY, accel, -1); | |
1007 g_free(accel_path); | |
1008 g_free(accel); | |
1009 } | |
1010 | |
1011 static void accel_reset_cb(GtkWidget *widget, gpointer data) | |
1012 { | |
1013 GtkTreeSelection *selection; | |
1014 | |
1015 if (!accel_store) return; | |
1016 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(data)); | |
1017 gtk_tree_selection_selected_foreach(selection, &accel_reset_selection, NULL); | |
1018 } | |
1019 | |
1020 | |
1021 #if 0 | |
1022 static void accel_alternate_activate_cb(GtkWidget *widget, gpointer data) | |
1023 { | |
1024 gtk_action_activate((GtkAction*)data); | |
1025 } | |
1026 | |
1027 #define DUPL "-alt-" | |
1028 | |
1029 void accel_add_alt_selection(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) | |
1030 { | |
1031 LayoutWindow *lw; | |
1032 GList *groups, *actions; | |
1033 GtkAction *action; | |
1034 GtkAccelKey key, *key2; | |
1035 GtkAccelMap *map; | |
1036 gchar *accel_path2, *accel; | |
1037 const gchar *accel_path; | |
1038 gint freeduplnum = 1; | |
1039 gint len; | |
1040 GClosure* closure; | |
1041 GtkAccelGroup *group; | |
1042 GtkAction *action_new, *action_new2; | |
1043 gchar *name, *accel_path_new, *accel_path_new2; | |
1044 | |
1045 if (!accel_store || !layout_window_list || !layout_window_list->data) return; | |
1046 | |
1047 gtk_tree_model_get(model, iter, AE_ACCEL, &accel_path2, -1); | |
1048 len = strlen(accel_path2); | |
1049 | |
1050 gtk_tree_store_clear(accel_store); | |
1051 lw = layout_window_list->data; | |
1052 | |
1053 g_assert(lw && lw->ui_manager); | |
1054 groups = gtk_ui_manager_get_action_groups(lw->ui_manager); | |
1055 group = gtk_ui_manager_get_accel_group(lw->ui_manager); | |
1056 | |
1057 while (groups) | |
1058 { | |
1059 actions = gtk_action_group_list_actions(GTK_ACTION_GROUP(groups->data)); | |
1060 while (actions) | |
1061 { | |
1062 gchar *dupl; | |
1063 guint64 num; | |
1064 | |
1065 action = GTK_ACTION(actions->data); | |
1066 actions = actions->next; | |
1067 | |
1068 accel_path = gtk_action_get_accel_path(action); | |
1069 if (!accel_path) continue; | |
1070 | |
1071 dupl = g_strrstr(accel_path, DUPL); | |
1072 | |
1073 printf("D: %s %s %s\n", accel_path, accel_path2, dupl); | |
1074 | |
1075 if ((dupl && (len != (dupl - accel_path)) ) || | |
1076 g_ascii_strncasecmp(accel_path, accel_path2, len) != 0) | |
1077 continue; | |
1078 | |
1079 if (dupl && (num = g_ascii_strtoull(dupl + strlen(DUPL), NULL, 10)) > 0 && | |
1080 num > freeduplnum) | |
1081 { | |
1082 freeduplnum = num + 1; | |
1083 } | |
1084 else | |
1085 { | |
1086 closure = gtk_action_get_accel_closure(action); | |
1087 name = gtk_action_get_name(action); | |
1088 accel_path_new = g_strdup(accel_path); | |
1089 action_new2 = action; | |
1090 } | |
1091 } | |
1092 groups = groups->next; | |
1093 } | |
1094 | |
1095 action_new = gtk_action_new(name, NULL, NULL, NULL); | |
1096 gtk_action_set_accel_group(action_new, group); | |
1097 | |
1098 g_signal_connect(G_OBJECT(action_new), "activate", | |
1099 G_CALLBACK(accel_alternate_activate_cb), action_new2); | |
1100 | |
1101 // accel_path_new2 = g_strdup_printf("%s%s%d", accel_path_new, dupl, freeduplnum); | |
1102 g_free(accel_path_new); | |
1103 | |
1104 gtk_action_set_accel_path(action_new, accel_path_new); | |
1105 | |
1106 // gtk_tree_store_set(accel_store, iter, AE_KEY, "", -1); | |
1107 printf("D: %s\n", accel_path_new2); | |
1108 | |
1109 g_free(accel_path_new2); | |
1110 gtk_action_connect_accelerator(action_new); | |
1111 } | |
1112 | |
1113 static void accel_add_alt_cb(GtkWidget *widget, gpointer data) | |
1114 { | |
1115 GtkWidget *accel_view = data; | |
1116 GtkTreeSelection *selection; | |
1117 | |
1118 if (!accel_store) return; | |
1119 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(data)); | |
1120 gtk_tree_selection_selected_foreach(selection, &accel_add_alt_selection, NULL); | |
1121 } | |
1122 | |
1123 static void accel_default_ok_cb(GenericDialog *gd, gpointer data) | |
1124 { | |
1125 accel_store_populate(); | |
1126 } | |
1127 | |
1128 #endif | |
1606 | 1129 #endif |
1601 | 1130 |
1039
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1131 static GtkWidget *scrolled_notebook_page(GtkWidget *notebook, const gchar *title) |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1132 { |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1133 GtkWidget *label; |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1134 GtkWidget *vbox; |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1135 GtkWidget *scrolled; |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1136 GtkWidget *viewport; |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1137 |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1138 scrolled = gtk_scrolled_window_new(NULL, NULL); |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1139 gtk_container_set_border_width(GTK_CONTAINER(scrolled), PREF_PAD_BORDER); |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1140 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1141 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1142 label = gtk_label_new(title); |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1143 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scrolled, label); |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1144 gtk_widget_show(scrolled); |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1145 |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1146 viewport = gtk_viewport_new(NULL, NULL); |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1147 gtk_viewport_set_shadow_type(GTK_VIEWPORT(viewport), GTK_SHADOW_NONE); |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1148 gtk_container_add(GTK_CONTAINER(scrolled), viewport); |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1149 gtk_widget_show(viewport); |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1150 |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1151 vbox = gtk_vbox_new(FALSE, 0); |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1152 gtk_container_add(GTK_CONTAINER(viewport), vbox); |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1153 gtk_widget_show(vbox); |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1154 |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1155 return vbox; |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1156 } |
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1157 |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1158 /* general options tab */ |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1159 static void config_tab_general(GtkWidget *notebook) |
9 | 1160 { |
1161 GtkWidget *vbox; | |
1162 GtkWidget *group; | |
1163 GtkWidget *subgroup; | |
1164 GtkWidget *button; | |
1165 GtkWidget *ct_button; | |
1166 GtkWidget *table; | |
1167 GtkWidget *spin; | |
1168 | |
1039
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1169 vbox = scrolled_notebook_page(notebook, _("General")); |
9 | 1170 |
1171 group = pref_group_new(vbox, FALSE, _("Thumbnails"), GTK_ORIENTATION_VERTICAL); | |
1172 | |
1173 table = pref_table_new(group, 2, 2, FALSE, FALSE); | |
1174 add_thumb_size_menu(table, 0, 0, _("Size:")); | |
333 | 1175 add_quality_menu(table, 0, 1, _("Quality:"), options->thumbnails.quality, &c_options->thumbnails.quality); |
9 | 1176 |
1177 ct_button = pref_checkbox_new_int(group, _("Cache thumbnails"), | |
333 | 1178 options->thumbnails.enable_caching, &c_options->thumbnails.enable_caching); |
9 | 1179 |
1180 subgroup = pref_box_new(group, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | |
1181 pref_checkbox_link_sensitivity(ct_button, subgroup); | |
1182 | |
1522 | 1183 button = pref_checkbox_new_int(subgroup, _("Use standard thumbnail cache, shared with other applications"), |
333 | 1184 options->thumbnails.spec_standard, &c_options->thumbnails.spec_standard); |
9 | 1185 |
1186 subgroup = pref_box_new(subgroup, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | |
1187 pref_checkbox_link_sensitivity_swap(button, subgroup); | |
1188 | |
1522 | 1189 pref_checkbox_new_int(subgroup, _("Store thumbnails in '.thumbnails' folder, local to image folder (non-standard)"), |
333 | 1190 options->thumbnails.cache_into_dirs, &c_options->thumbnails.cache_into_dirs); |
9 | 1191 |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
1192 #if 0 |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
1193 pref_checkbox_new_int(subgroup, _("Use xvpics thumbnails when found (read only)"), |
333 | 1194 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
|
1195 #endif |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
1196 |
1522 | 1197 pref_checkbox_new_int(group, _("Use EXIF thumbnails when available (EXIF thumbnails may be outdated)"), |
1060 | 1198 options->thumbnails.use_exif, &c_options->thumbnails.use_exif); |
1199 | |
9 | 1200 group = pref_group_new(vbox, FALSE, _("Slide show"), GTK_ORIENTATION_VERTICAL); |
1201 | |
326 | 1202 c_options->slideshow.delay = options->slideshow.delay; |
9 | 1203 spin = pref_spin_new(group, _("Delay between image change:"), _("seconds"), |
1204 SLIDESHOW_MIN_SECONDS, SLIDESHOW_MAX_SECONDS, 1.0, 1, | |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
995
diff
changeset
|
1205 options->slideshow.delay ? (gdouble)options->slideshow.delay / SLIDESHOW_SUBSECOND_PRECISION : 10.0, |
9 | 1206 G_CALLBACK(slideshow_delay_cb), NULL); |
1207 gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS); | |
1208 | |
326 | 1209 pref_checkbox_new_int(group, _("Random"), options->slideshow.random, &c_options->slideshow.random); |
1210 pref_checkbox_new_int(group, _("Repeat"), options->slideshow.repeat, &c_options->slideshow.repeat); | |
1510 | 1211 |
1212 group = pref_group_new(vbox, FALSE, _("Image loading and caching"), GTK_ORIENTATION_VERTICAL); | |
1213 | |
1522 | 1214 #if 0 |
1510 | 1215 pref_spin_new_int(group, _("Offscreen cache size (Mb per image):"), NULL, |
1216 0, 128, 1, options->image.tile_cache_max, &c_options->image.tile_cache_max); | |
1522 | 1217 #endif |
1510 | 1218 |
1219 pref_spin_new_int(group, _("Decoded image cache size (Mb):"), NULL, | |
1220 0, 1024, 1, options->image.image_cache_max, &c_options->image.image_cache_max); | |
1522 | 1221 pref_checkbox_new_int(group, _("Preload next image"), |
1222 options->image.enable_read_ahead, &c_options->image.enable_read_ahead); | |
1223 | |
1224 pref_checkbox_new_int(group, _("Refresh on file change"), | |
1225 options->update_on_time_change, &c_options->update_on_time_change); | |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1226 } |
9 | 1227 |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1228 /* image tab */ |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1229 static void config_tab_image(GtkWidget *notebook) |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1230 { |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1231 GtkWidget *hbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1232 GtkWidget *vbox; |
1516
c30965f99b3c
improved Scroll reset method in preferences dialog
nadvornik
parents:
1515
diff
changeset
|
1233 GtkWidget *vbox2; |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1234 GtkWidget *group; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1235 GtkWidget *button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1236 GtkWidget *ct_button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1237 GtkWidget *table; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1238 GtkWidget *spin; |
9 | 1239 |
1039
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1240 vbox = scrolled_notebook_page(notebook, _("Image")); |
9 | 1241 |
1242 group = pref_group_new(vbox, FALSE, _("Zoom"), GTK_ORIENTATION_VERTICAL); | |
1243 | |
1244 #if 0 | |
334 | 1245 add_dither_menu(dither_quality, &c_options->image.dither_quality, _("Dithering method:"), group); |
9 | 1246 #endif |
1247 table = pref_table_new(group, 2, 1, FALSE, FALSE); | |
334 | 1248 add_quality_menu(table, 0, 0, _("Quality:"), options->image.zoom_quality, &c_options->image.zoom_quality); |
9 | 1249 |
1515
3e6cd9243162
disabled 2-pass rendering also affect color correction
nadvornik
parents:
1513
diff
changeset
|
1250 pref_checkbox_new_int(group, _("Two pass rendering (apply HQ zoom and color correction in second pass)"), |
334 | 1251 options->image.zoom_2pass, &c_options->image.zoom_2pass); |
9 | 1252 |
67
f63ecca6c087
Fri Oct 13 05:22:43 2006 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
1253 pref_checkbox_new_int(group, _("Allow enlargement of image for zoom to fit"), |
334 | 1254 options->image.zoom_to_fit_allow_expand, &c_options->image.zoom_to_fit_allow_expand); |
9 | 1255 |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
1256 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
|
1257 ct_button = pref_checkbox_new_int(hbox, _("Limit image size when autofitting (%):"), |
334 | 1258 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
|
1259 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
|
1260 10, 150, 1, |
334 | 1261 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
|
1262 pref_checkbox_link_sensitivity(ct_button, spin); |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
1263 |
334 | 1264 c_options->image.zoom_increment = options->image.zoom_increment; |
9 | 1265 spin = pref_spin_new(group, _("Zoom increment:"), NULL, |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
995
diff
changeset
|
1266 0.1, 4.0, 0.1, 1, (gdouble)options->image.zoom_increment / 10.0, |
9 | 1267 G_CALLBACK(zoom_increment_cb), NULL); |
1268 gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS); | |
1269 | |
1516
c30965f99b3c
improved Scroll reset method in preferences dialog
nadvornik
parents:
1515
diff
changeset
|
1270 group = pref_group_new(vbox, FALSE, _("When new image is selected:"), GTK_ORIENTATION_HORIZONTAL); |
9 | 1271 |
1516
c30965f99b3c
improved Scroll reset method in preferences dialog
nadvornik
parents:
1515
diff
changeset
|
1272 vbox2 = pref_box_new(group, TRUE, GTK_ORIENTATION_VERTICAL, PREF_PAD_SPACE); |
334 | 1273 c_options->image.zoom_mode = options->image.zoom_mode; |
1516
c30965f99b3c
improved Scroll reset method in preferences dialog
nadvornik
parents:
1515
diff
changeset
|
1274 button = pref_radiobutton_new(vbox2, NULL, _("Zoom to original size"), |
334 | 1275 (options->image.zoom_mode == ZOOM_RESET_ORIGINAL), |
1039
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1276 G_CALLBACK(zoom_mode_cb), GINT_TO_POINTER(ZOOM_RESET_ORIGINAL)); |
1516
c30965f99b3c
improved Scroll reset method in preferences dialog
nadvornik
parents:
1515
diff
changeset
|
1277 button = pref_radiobutton_new(vbox2, button, _("Fit image to window"), |
334 | 1278 (options->image.zoom_mode == ZOOM_RESET_FIT_WINDOW), |
1039
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1279 G_CALLBACK(zoom_mode_cb), GINT_TO_POINTER(ZOOM_RESET_FIT_WINDOW)); |
1516
c30965f99b3c
improved Scroll reset method in preferences dialog
nadvornik
parents:
1515
diff
changeset
|
1280 button = pref_radiobutton_new(vbox2, button, _("Leave Zoom at previous setting"), |
334 | 1281 (options->image.zoom_mode == ZOOM_RESET_NONE), |
1039
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1282 G_CALLBACK(zoom_mode_cb), GINT_TO_POINTER(ZOOM_RESET_NONE)); |
9 | 1283 |
1516
c30965f99b3c
improved Scroll reset method in preferences dialog
nadvornik
parents:
1515
diff
changeset
|
1284 vbox2 = pref_box_new(group, TRUE, GTK_ORIENTATION_VERTICAL, PREF_PAD_SPACE); |
1038
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
1285 c_options->image.scroll_reset_method = options->image.scroll_reset_method; |
1516
c30965f99b3c
improved Scroll reset method in preferences dialog
nadvornik
parents:
1515
diff
changeset
|
1286 button = pref_radiobutton_new(vbox2, NULL, _("Scroll to top left corner"), |
1038
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
1287 (options->image.scroll_reset_method == SCROLL_RESET_TOPLEFT), |
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
1288 G_CALLBACK(scroll_reset_cb), GINT_TO_POINTER(SCROLL_RESET_TOPLEFT)); |
1516
c30965f99b3c
improved Scroll reset method in preferences dialog
nadvornik
parents:
1515
diff
changeset
|
1289 button = pref_radiobutton_new(vbox2, button, _("Scroll to image center"), |
1038
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
1290 (options->image.scroll_reset_method == SCROLL_RESET_CENTER), |
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
1291 G_CALLBACK(scroll_reset_cb), GINT_TO_POINTER(SCROLL_RESET_CENTER)); |
1516
c30965f99b3c
improved Scroll reset method in preferences dialog
nadvornik
parents:
1515
diff
changeset
|
1292 button = pref_radiobutton_new(vbox2, button, _("Keep the region from previous image"), |
1038
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
1293 (options->image.scroll_reset_method == SCROLL_RESET_NOCHANGE), |
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
1294 G_CALLBACK(scroll_reset_cb), GINT_TO_POINTER(SCROLL_RESET_NOCHANGE)); |
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
1295 |
db720c5a9169
Allow to change image.scroll_reset_method in Preferences > Image.
zas_
parents:
1024
diff
changeset
|
1296 |
9 | 1297 group = pref_group_new(vbox, FALSE, _("Appearance"), GTK_ORIENTATION_VERTICAL); |
1298 | |
1644
b8235f919d6b
the options for custom border color were made independent
nadvornik
parents:
1626
diff
changeset
|
1299 pref_checkbox_new_int(group, _("Use custom border color in window mode"), |
339
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
338
diff
changeset
|
1300 options->image.use_custom_border_color, &c_options->image.use_custom_border_color); |
1626
1d7941c147be
Add an option to Image preferences to restrict custom border to fullscreen mode only. Bug 2798062.
zas_
parents:
1625
diff
changeset
|
1301 |
1644
b8235f919d6b
the options for custom border color were made independent
nadvornik
parents:
1626
diff
changeset
|
1302 pref_checkbox_new_int(group, _("Use custom border color in fullscreen mode"), |
b8235f919d6b
the options for custom border color were made independent
nadvornik
parents:
1626
diff
changeset
|
1303 options->image.use_custom_border_color_in_fullscreen, &c_options->image.use_custom_border_color_in_fullscreen); |
208
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
199
diff
changeset
|
1304 |
339
de1c2cd06fce
Rename user_specified_window_background and window_background_color
zas_
parents:
338
diff
changeset
|
1305 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
|
1306 G_CALLBACK(pref_color_button_set_cb), &c_options->image.border_color); |
9 | 1307 |
1308 group = pref_group_new(vbox, FALSE, _("Convenience"), GTK_ORIENTATION_VERTICAL); | |
1309 | |
1310 pref_checkbox_new_int(group, _("Auto rotate image using Exif information"), | |
334 | 1311 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
|
1312 } |
9 | 1313 |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1314 /* windows tab */ |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1315 static void config_tab_windows(GtkWidget *notebook) |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1316 { |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1317 GtkWidget *hbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1318 GtkWidget *vbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1319 GtkWidget *group; |
1510 | 1320 GtkWidget *button; |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1321 GtkWidget *ct_button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1322 GtkWidget *spin; |
1510 | 1323 GtkWidget *image_overlay_template_view; |
1324 GtkWidget *scrolled; | |
1325 GtkTextBuffer *buffer; | |
9 | 1326 |
1039
9c8d7ba674cf
Allow all Preferences pages to scroll vertically. Reduce code redundancy.
zas_
parents:
1038
diff
changeset
|
1327 vbox = scrolled_notebook_page(notebook, _("Windows")); |
9 | 1328 |
1329 group = pref_group_new(vbox, FALSE, _("State"), GTK_ORIENTATION_VERTICAL); | |
1330 | |
1331 pref_checkbox_new_int(group, _("Remember window positions"), | |
1436
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1400
diff
changeset
|
1332 options->save_window_positions, &c_options->save_window_positions); |
9 | 1333 pref_checkbox_new_int(group, _("Remember tool state (float/hidden)"), |
1436
d7a6fb7a90dd
completely separated global and layout window options
nadvornik
parents:
1400
diff
changeset
|
1334 options->tools_restore_state, &c_options->tools_restore_state); |
9 | 1335 |
1336 group = pref_group_new(vbox, FALSE, _("Size"), GTK_ORIENTATION_VERTICAL); | |
1337 | |
1338 pref_checkbox_new_int(group, _("Fit window to image when tools are hidden/floating"), | |
334 | 1339 options->image.fit_window_to_image, &c_options->image.fit_window_to_image); |
9 | 1340 |
1341 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
1342 ct_button = pref_checkbox_new_int(hbox, _("Limit size when auto-sizing window (%):"), | |
334 | 1343 options->image.limit_window_size, &c_options->image.limit_window_size); |
9 | 1344 spin = pref_spin_new_int(hbox, NULL, NULL, |
1345 10, 150, 1, | |
334 | 1346 options->image.max_window_size, &c_options->image.max_window_size); |
9 | 1347 pref_checkbox_link_sensitivity(ct_button, spin); |
1510 | 1348 |
1349 group = pref_group_new(vbox, FALSE, _("Full screen"), GTK_ORIENTATION_VERTICAL); | |
1350 | |
1351 c_options->fullscreen.screen = options->fullscreen.screen; | |
1352 c_options->fullscreen.above = options->fullscreen.above; | |
1353 hbox = fullscreen_prefs_selection_new(_("Location:"), &c_options->fullscreen.screen, &c_options->fullscreen.above); | |
1354 gtk_box_pack_start(GTK_BOX(group), hbox, FALSE, FALSE, 0); | |
1355 gtk_widget_show(hbox); | |
1356 | |
1357 pref_checkbox_new_int(group, _("Smooth image flip"), | |
1358 options->fullscreen.clean_flip, &c_options->fullscreen.clean_flip); | |
1359 pref_checkbox_new_int(group, _("Disable screen saver"), | |
1360 options->fullscreen.disable_saver, &c_options->fullscreen.disable_saver); | |
1361 | |
1362 | |
1363 group = pref_group_new(vbox, FALSE, _("Overlay Screen Display"), GTK_ORIENTATION_VERTICAL); | |
1364 | |
1365 pref_label_new(group, _("Image overlay template")); | |
1366 | |
1367 scrolled = gtk_scrolled_window_new(NULL, NULL); | |
1368 gtk_widget_set_size_request(scrolled, 200, 150); | |
1369 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); | |
1370 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), | |
1371 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1372 gtk_box_pack_start(GTK_BOX(group), scrolled, TRUE, TRUE, 5); | |
1373 gtk_widget_show(scrolled); | |
1374 | |
1375 image_overlay_template_view = gtk_text_view_new(); | |
1376 | |
1377 #if GTK_CHECK_VERSION(2,12,0) | |
1378 gtk_widget_set_tooltip_markup(image_overlay_template_view, | |
1379 _("<i>%name%</i> results in the filename of the picture.\n" | |
1380 "Also available: <i>%collection%</i>, <i>%number%</i>, <i>%total%</i>, <i>%date%</i>,\n" | |
1381 "<i>%size%</i> (filesize), <i>%width%</i>, <i>%height%</i>, <i>%res%</i> (resolution)\n" | |
1382 "To access exif data use the exif name, e. g. <i>%formatted.Camera%</i> is the formatted camera name,\n" | |
1383 "<i>%Exif.Photo.DateTimeOriginal%</i> the date of the original shot.\n" | |
1384 "<i>%formatted.Camera:20</i> notation will truncate the displayed data to 20 characters and will add 3 dots at the end to denote the truncation.\n" | |
1385 "If two or more variables are connected with the |-sign, it prints available variables with a separator.\n" | |
1386 "<i>%formatted.ShutterSpeed%</i>|<i>%formatted.ISOSpeedRating%</i>|<i>%formatted.FocalLength%</i> could show \"1/20s - 400 - 80 mm\" or \"1/200 - 80 mm\",\n" | |
1387 "if there's no ISO information in the Exif data.\n" | |
1388 "If a line is empty, it is removed. This allows to add lines that totally disappear when no data is available.\n" | |
1389 )); | |
1390 #endif | |
1391 gtk_container_add(GTK_CONTAINER(scrolled), image_overlay_template_view); | |
1392 gtk_widget_show(image_overlay_template_view); | |
1393 | |
1394 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); | |
1395 | |
1396 button = pref_button_new(NULL, NULL, _("Defaults"), FALSE, | |
1397 G_CALLBACK(image_overlay_default_template_cb), image_overlay_template_view); | |
1398 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1399 gtk_widget_show(button); | |
1400 | |
1401 button = pref_button_new(NULL, GTK_STOCK_HELP, NULL, FALSE, | |
1402 G_CALLBACK(image_overlay_help_cb), NULL); | |
1403 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1404 gtk_widget_show(button); | |
1405 | |
1406 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(image_overlay_template_view)); | |
1407 if (options->image_overlay.template_string) gtk_text_buffer_set_text(buffer, options->image_overlay.template_string, -1); | |
1408 g_signal_connect(G_OBJECT(buffer), "changed", | |
1409 G_CALLBACK(image_overlay_template_view_changed_cb), image_overlay_template_view); | |
1410 | |
1411 | |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1412 } |
9 | 1413 |
1216 | 1414 static GtkTreeModel *create_class_model(void) |
1415 { | |
1416 GtkListStore *model; | |
1417 GtkTreeIter iter; | |
1418 gint i; | |
1419 | |
1420 /* create list store */ | |
1346
c9949c19a6d0
No space between function name and first parenthesis, it eases greping (see CODING).
zas_
parents:
1336
diff
changeset
|
1421 model = gtk_list_store_new(1, G_TYPE_STRING); |
1216 | 1422 for (i = 0; i < FILE_FORMAT_CLASSES; i++) |
1423 { | |
1346
c9949c19a6d0
No space between function name and first parenthesis, it eases greping (see CODING).
zas_
parents:
1336
diff
changeset
|
1424 gtk_list_store_append(model, &iter); |
1216 | 1425 gtk_list_store_set(model, &iter, 0, _(format_class_list[i]), -1); |
1426 } | |
1427 return GTK_TREE_MODEL (model); | |
1428 } | |
1429 | |
1430 | |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1431 /* filtering tab */ |
1522 | 1432 static void config_tab_files(GtkWidget *notebook) |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1433 { |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1434 GtkWidget *hbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1435 GtkWidget *frame; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1436 GtkWidget *vbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1437 GtkWidget *group; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1438 GtkWidget *button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1439 GtkWidget *ct_button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1440 GtkWidget *scrolled; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1441 GtkWidget *filter_view; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1442 GtkCellRenderer *renderer; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1443 GtkTreeSelection *selection; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1444 GtkTreeViewColumn *column; |
9 | 1445 |
1522 | 1446 vbox = scrolled_notebook_page(notebook, _("Files")); |
9 | 1447 |
1448 group = pref_box_new(vbox, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | |
1449 | |
356 | 1450 pref_checkbox_new_int(group, _("Show hidden files or folders"), |
1451 options->file_filter.show_hidden_files, &c_options->file_filter.show_hidden_files); | |
1522 | 1452 #if 0 |
373
61a3c8b05b24
Add a new option in Preferences > Filtering to allow the
zas_
parents:
356
diff
changeset
|
1453 pref_checkbox_new_int(group, _("Show dot directory"), |
61a3c8b05b24
Add a new option in Preferences > Filtering to allow the
zas_
parents:
356
diff
changeset
|
1454 options->file_filter.show_dot_directory, &c_options->file_filter.show_dot_directory); |
1522 | 1455 #endif |
9 | 1456 pref_checkbox_new_int(group, _("Case sensitive sort"), |
329 | 1457 options->file_sort.case_sensitive, &c_options->file_sort.case_sensitive); |
9 | 1458 |
1459 ct_button = pref_checkbox_new_int(group, _("Disable File Filtering"), | |
332 | 1460 options->file_filter.disable, &c_options->file_filter.disable); |
9 | 1461 |
170
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
1462 |
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
1463 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
|
1464 |
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
1465 sidecar_ext_entry = gtk_entry_new(); |
1229
878718372aca
sidecar files grouping was made case-insensitive
nadvornik
parents:
1216
diff
changeset
|
1466 gtk_entry_set_text(GTK_ENTRY(sidecar_ext_entry), options->sidecar.ext); |
170
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
1467 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
|
1468 gtk_widget_show(sidecar_ext_entry); |
9a56e3d13e67
basic sidecar files configuration via preferences dialog
nadvornik
parents:
134
diff
changeset
|
1469 |
9 | 1470 group = pref_group_new(vbox, TRUE, _("File types"), GTK_ORIENTATION_VERTICAL); |
1471 | |
1472 frame = pref_group_parent(group); | |
1473 g_signal_connect(G_OBJECT(ct_button), "toggled", | |
1474 G_CALLBACK(filter_disable_cb), frame); | |
332 | 1475 gtk_widget_set_sensitive(frame, !options->file_filter.disable); |
9 | 1476 |
1477 scrolled = gtk_scrolled_window_new(NULL, NULL); | |
1478 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); | |
513
985fdfebd89e
Remove whitespace between function name and first parenthesis for the sake of consistency. (pass 2)
zas_
parents:
512
diff
changeset
|
1479 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
9 | 1480 gtk_box_pack_start(GTK_BOX(group), scrolled, TRUE, TRUE, 0); |
1481 gtk_widget_show(scrolled); | |
1482 | |
1483 filter_store = gtk_list_store_new(1, G_TYPE_POINTER); | |
1484 filter_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(filter_store)); | |
1485 g_object_unref(filter_store); | |
1486 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(filter_view)); | |
1487 gtk_tree_selection_set_mode(GTK_TREE_SELECTION(selection), GTK_SELECTION_SINGLE); | |
1488 | |
1489 gtk_tree_view_set_enable_search(GTK_TREE_VIEW(filter_view), FALSE); | |
1490 | |
1491 column = gtk_tree_view_column_new(); | |
1492 gtk_tree_view_column_set_title(column, _("Filter")); | |
1493 gtk_tree_view_column_set_resizable(column, TRUE); | |
1494 | |
1495 renderer = gtk_cell_renderer_toggle_new(); | |
1496 g_signal_connect(G_OBJECT(renderer), "toggled", | |
1497 G_CALLBACK(filter_store_enable_cb), filter_store); | |
1498 gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
1499 gtk_tree_view_column_set_cell_data_func(column, renderer, filter_set_func, | |
1500 GINT_TO_POINTER(FE_ENABLE), NULL); | |
442 | 1501 |
9 | 1502 renderer = gtk_cell_renderer_text_new(); |
1503 g_signal_connect(G_OBJECT(renderer), "edited", | |
1504 G_CALLBACK(filter_store_ext_edit_cb), filter_store); | |
1505 gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
1506 g_object_set(G_OBJECT(renderer), "editable", (gboolean)TRUE, NULL); | |
1507 gtk_tree_view_column_set_cell_data_func(column, renderer, filter_set_func, | |
1508 GINT_TO_POINTER(FE_EXTENSION), NULL); | |
1509 gtk_tree_view_append_column(GTK_TREE_VIEW(filter_view), column); | |
1510 | |
1511 column = gtk_tree_view_column_new(); | |
1512 gtk_tree_view_column_set_title(column, _("Description")); | |
1513 gtk_tree_view_column_set_resizable(column, TRUE); | |
1514 renderer = gtk_cell_renderer_text_new(); | |
1515 g_signal_connect(G_OBJECT(renderer), "edited", | |
1516 G_CALLBACK(filter_store_desc_edit_cb), filter_store); | |
1517 g_object_set(G_OBJECT(renderer), "editable", (gboolean)TRUE, NULL); | |
1518 gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
1519 gtk_tree_view_column_set_cell_data_func(column, renderer, filter_set_func, | |
1520 GINT_TO_POINTER(FE_DESCRIPTION), NULL); | |
1521 gtk_tree_view_append_column(GTK_TREE_VIEW(filter_view), column); | |
1522 | |
1216 | 1523 column = gtk_tree_view_column_new(); |
1524 gtk_tree_view_column_set_title(column, _("Class")); | |
1525 gtk_tree_view_column_set_resizable(column, TRUE); | |
1526 renderer = gtk_cell_renderer_combo_new(); | |
1527 g_object_set(G_OBJECT(renderer), "editable", (gboolean)TRUE, | |
1528 "model", create_class_model(), | |
1529 "text-column", 0, | |
1530 "has-entry", FALSE, | |
1531 NULL); | |
1532 | |
1533 g_signal_connect(G_OBJECT(renderer), "edited", | |
1534 G_CALLBACK(filter_store_class_edit_cb), filter_store); | |
1535 gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
1536 gtk_tree_view_column_set_cell_data_func(column, renderer, filter_set_func, | |
1537 GINT_TO_POINTER(FE_CLASS), NULL); | |
1538 gtk_tree_view_append_column(GTK_TREE_VIEW(filter_view), column); | |
1539 | |
1239
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1540 column = gtk_tree_view_column_new(); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1541 gtk_tree_view_column_set_title(column, _("Writable")); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1542 gtk_tree_view_column_set_resizable(column, FALSE); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1543 renderer = gtk_cell_renderer_toggle_new(); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1544 g_signal_connect(G_OBJECT(renderer), "toggled", |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1545 G_CALLBACK(filter_store_writable_cb), filter_store); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1546 gtk_tree_view_column_pack_start(column, renderer, FALSE); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1547 gtk_tree_view_column_set_cell_data_func(column, renderer, filter_set_func, |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1548 GINT_TO_POINTER(FE_WRITABLE), NULL); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1549 gtk_tree_view_append_column(GTK_TREE_VIEW(filter_view), column); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1550 |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1551 column = gtk_tree_view_column_new(); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1552 gtk_tree_view_column_set_title(column, _("Sidecar is allowed")); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1553 gtk_tree_view_column_set_resizable(column, FALSE); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1554 renderer = gtk_cell_renderer_toggle_new(); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1555 g_signal_connect(G_OBJECT(renderer), "toggled", |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1556 G_CALLBACK(filter_store_sidecar_cb), filter_store); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1557 gtk_tree_view_column_pack_start(column, renderer, FALSE); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1558 gtk_tree_view_column_set_cell_data_func(column, renderer, filter_set_func, |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1559 GINT_TO_POINTER(FE_ALLOW_SIDECAR), NULL); |
254b09942e68
metadata write mode (direct or sidecar) made configurable for each file
nadvornik
parents:
1229
diff
changeset
|
1560 gtk_tree_view_append_column(GTK_TREE_VIEW(filter_view), column); |
1216 | 1561 |
1562 | |
9 | 1563 filter_store_populate(); |
1564 gtk_container_add(GTK_CONTAINER(scrolled), filter_view); | |
1565 gtk_widget_show(filter_view); | |
1566 | |
1567 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); | |
1568 | |
1569 button = pref_button_new(NULL, NULL, _("Defaults"), FALSE, | |
1570 G_CALLBACK(filter_default_cb), NULL); | |
1571 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1572 gtk_widget_show(button); | |
1573 | |
1574 button = pref_button_new(NULL, GTK_STOCK_REMOVE, NULL, FALSE, | |
1575 G_CALLBACK(filter_remove_cb), filter_view); | |
1576 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1577 gtk_widget_show(button); | |
1578 | |
1579 button = pref_button_new(NULL, GTK_STOCK_ADD, NULL, FALSE, | |
1580 G_CALLBACK(filter_add_cb), NULL); | |
1581 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1582 gtk_widget_show(button); | |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1583 } |
1510 | 1584 |
1585 /* metadata tab */ | |
1586 static void config_tab_metadata(GtkWidget *notebook) | |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1587 { |
1510 | 1588 GtkWidget *vbox; |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1589 GtkWidget *hbox; |
1510 | 1590 GtkWidget *group; |
1591 GtkWidget *ct_button; | |
1596
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1592 GtkWidget *label; |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1593 gchar *text; |
1510 | 1594 |
1595 vbox = scrolled_notebook_page(notebook, _("Metadata")); | |
1596 | |
1597 | |
1596
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1598 group = pref_group_new(vbox, FALSE, _("Metadata writing process"), GTK_ORIENTATION_VERTICAL); |
1686 | 1599 #ifndef HAVE_EXIV2 |
1600 label = pref_label_new(group, _("Warning: Geeqie is built without Exiv2. Some options are disabled.")); | |
1601 #endif | |
1596
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1602 label = pref_label_new(group, _("Metadata are written in the following order. The process ends after first success.")); |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1603 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1604 |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1605 ct_button = pref_checkbox_new_int(group, _("1) Save metadata in image files, resp. sidecar files, according to the XMP standard"), |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1606 options->metadata.save_in_image_file, &c_options->metadata.save_in_image_file); |
1686 | 1607 #ifndef HAVE_EXIV2 |
1608 gtk_widget_set_sensitive(ct_button, FALSE); | |
1609 #endif | |
1596
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1610 |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1611 pref_checkbox_new_int(group, _("2) Save metadata in '.metadata' folder, local to image folder (non-standard)"), |
1510 | 1612 options->metadata.enable_metadata_dirs, &c_options->metadata.enable_metadata_dirs); |
1613 | |
1596
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1614 text = g_strdup_printf(_("3) Save metadata in Geeqie private directory '%s'"), get_metadata_cache_dir()); |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1615 label = pref_label_new(group, text); |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1616 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1617 g_free(text); |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1618 |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1619 group = pref_group_new(vbox, FALSE, _("Step 1: Write to image files"), GTK_ORIENTATION_VERTICAL); |
1686 | 1620 #ifndef HAVE_EXIV2 |
1621 gtk_widget_set_sensitive(group, FALSE); | |
1622 #endif | |
1510 | 1623 |
1624 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_SPACE); | |
1625 pref_checkbox_link_sensitivity(ct_button, hbox); | |
1626 | |
1596
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1627 pref_checkbox_new_int(hbox, _("Store metadata also in legacy IPTC tags (converted according to IPTC4XMP standard)"), |
1510 | 1628 options->metadata.save_legacy_IPTC, &c_options->metadata.save_legacy_IPTC); |
1629 | |
1630 pref_checkbox_new_int(hbox, _("Warn if the image files are unwritable"), | |
1631 options->metadata.warn_on_write_problems, &c_options->metadata.warn_on_write_problems); | |
1632 | |
1633 pref_checkbox_new_int(hbox, _("Ask before writing to image files"), | |
1634 options->metadata.confirm_write, &c_options->metadata.confirm_write); | |
1635 | |
1596
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1636 group = pref_group_new(vbox, FALSE, _("Step 2 and 3: write to Geeqie private files"), GTK_ORIENTATION_VERTICAL); |
1686 | 1637 #ifndef HAVE_EXIV2 |
1638 gtk_widget_set_sensitive(group, FALSE); | |
1639 #endif | |
1596
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1640 |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1641 pref_checkbox_new_int(group, _("Use GQview legacy metadata format (supports only keywords and comments) instead of XMP"), |
1510 | 1642 options->metadata.save_legacy_format, &c_options->metadata.save_legacy_format); |
1643 | |
1596
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1644 |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1645 group = pref_group_new(vbox, FALSE, _("Miscellaneous"), GTK_ORIENTATION_VERTICAL); |
1663 | 1646 pref_checkbox_new_int(group, _("Write the same description tags (keywords, comment, etc.) to all grouped sidecars"), |
1510 | 1647 options->metadata.sync_grouped_files, &c_options->metadata.sync_grouped_files); |
1648 | |
1596
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1649 pref_checkbox_new_int(group, _("Allow keywords to differ only in case"), |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1650 options->metadata.keywords_case_sensitive, &c_options->metadata.keywords_case_sensitive); |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1651 |
1686 | 1652 ct_button = pref_checkbox_new_int(group, _("Write altered image orientation to the metadata"), |
1596
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1653 options->metadata.write_orientation, &c_options->metadata.write_orientation); |
1686 | 1654 #ifndef HAVE_EXIV2 |
1655 gtk_widget_set_sensitive(ct_button, FALSE); | |
1656 #endif | |
1596
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1657 |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1658 group = pref_group_new(vbox, FALSE, _("Auto-save options"), GTK_ORIENTATION_VERTICAL); |
cc74cb8bbe3f
added some structure to the metadata preferences dialog
nadvornik
parents:
1590
diff
changeset
|
1659 |
1510 | 1660 ct_button = pref_checkbox_new_int(group, _("Write metadata after timeout"), |
1661 options->metadata.confirm_after_timeout, &c_options->metadata.confirm_after_timeout); | |
1662 | |
1663 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
1664 pref_checkbox_link_sensitivity(ct_button, hbox); | |
1665 | |
1666 pref_spin_new_int(hbox, _("Timeout (seconds):"), NULL, 0, 900, 1, | |
1667 options->metadata.confirm_timeout, &c_options->metadata.confirm_timeout); | |
1668 | |
1669 pref_checkbox_new_int(group, _("Write metadata on image change"), | |
1670 options->metadata.confirm_on_image_change, &c_options->metadata.confirm_on_image_change); | |
1671 | |
1672 pref_checkbox_new_int(group, _("Write metadata on directory change"), | |
1673 options->metadata.confirm_on_dir_change, &c_options->metadata.confirm_on_dir_change); | |
1674 } | |
1675 | |
1676 /* metadata tab */ | |
1677 static void config_tab_color(GtkWidget *notebook) | |
1678 { | |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1679 GtkWidget *label; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1680 GtkWidget *vbox; |
1510 | 1681 GtkWidget *group; |
1682 GtkWidget *tabcomp; | |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1683 GtkWidget *table; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1684 gint i; |
9 | 1685 |
1522 | 1686 vbox = scrolled_notebook_page(notebook, _("Color management")); |
9 | 1687 |
1548 | 1688 group = pref_group_new(vbox, FALSE, _("Input profiles"), GTK_ORIENTATION_VERTICAL); |
1510 | 1689 #ifndef HAVE_LCMS |
1690 gtk_widget_set_sensitive(pref_group_parent(group), FALSE); | |
1691 #endif | |
1692 | |
1548 | 1693 table = pref_table_new(group, 3, COLOR_PROFILE_INPUTS + 1, FALSE, FALSE); |
9 | 1694 gtk_table_set_col_spacings(GTK_TABLE(table), PREF_PAD_GAP); |
1695 | |
1510 | 1696 label = pref_table_label(table, 0, 0, _("Type"), 0.0); |
9 | 1697 pref_label_bold(label, TRUE, FALSE); |
1698 | |
1699 label = pref_table_label(table, 1, 0, _("Menu name"), 0.0); | |
1700 pref_label_bold(label, TRUE, FALSE); | |
1701 | |
1510 | 1702 label = pref_table_label(table, 2, 0, _("File"), 0.0); |
9 | 1703 pref_label_bold(label, TRUE, FALSE); |
1704 | |
1510 | 1705 for (i = 0; i < COLOR_PROFILE_INPUTS; i++) |
9 | 1706 { |
224 | 1707 GtkWidget *entry; |
1510 | 1708 gchar *buf; |
442 | 1709 |
1625 | 1710 buf = g_strdup_printf(_("Input %d:"), i + COLOR_PROFILE_FILE); |
1510 | 1711 pref_table_label(table, 0, i + 1, buf, 1.0); |
1712 g_free(buf); | |
9 | 1713 |
224 | 1714 entry = gtk_entry_new(); |
1510 | 1715 gtk_entry_set_max_length(GTK_ENTRY(entry), EDITOR_NAME_MAX_LENGTH); |
1716 // gtk_widget_set_size_request(editor_name_entry[i], 30, -1); | |
1717 if (options->color_profile.input_name[i]) | |
1718 { | |
1719 gtk_entry_set_text(GTK_ENTRY(entry), options->color_profile.input_name[i]); | |
1720 } | |
1721 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, i + 1, i + 2, | |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1722 GTK_FILL | GTK_EXPAND, 0, 0, 0); |
224 | 1723 gtk_widget_show(entry); |
1510 | 1724 color_profile_input_name_entry[i] = entry; |
1725 | |
1726 tabcomp = tab_completion_new(&entry, options->color_profile.input_file[i], NULL, NULL); | |
1727 tab_completion_add_select_button(entry, _("Select color profile"), FALSE); | |
1728 gtk_widget_set_size_request(entry, 160, -1); | |
1729 gtk_table_attach(GTK_TABLE(table), tabcomp, 2, 3, i + 1, i + 2, | |
1730 GTK_FILL | GTK_EXPAND, 0, 0, 0); | |
1731 gtk_widget_show(tabcomp); | |
1732 color_profile_input_file_entry[i] = entry; | |
9 | 1733 } |
1734 | |
1548 | 1735 group = pref_group_new(vbox, FALSE, _("Screen profile"), GTK_ORIENTATION_VERTICAL); |
1736 #ifndef HAVE_LCMS | |
1737 gtk_widget_set_sensitive(pref_group_parent(group), FALSE); | |
1738 #endif | |
1739 pref_checkbox_new_int(group, _("Use system screen profile if available"), | |
1740 options->color_profile.use_x11_screen_profile, &c_options->color_profile.use_x11_screen_profile); | |
1741 | |
1742 table = pref_table_new(group, 2, 1, FALSE, FALSE); | |
1743 | |
1744 pref_table_label(table, 0, 0, _("Screen:"), 1.0); | |
1510 | 1745 tabcomp = tab_completion_new(&color_profile_screen_file_entry, |
1746 options->color_profile.screen_file, NULL, NULL); | |
1747 tab_completion_add_select_button(color_profile_screen_file_entry, _("Select color profile"), FALSE); | |
1748 gtk_widget_set_size_request(color_profile_screen_file_entry, 160, -1); | |
1548 | 1749 gtk_table_attach(GTK_TABLE(table), tabcomp, 1, 2, |
1750 0, 1, | |
1510 | 1751 GTK_FILL | GTK_EXPAND, 0, 0, 0); |
1752 gtk_widget_show(tabcomp); | |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1753 } |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
218
diff
changeset
|
1754 |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1755 /* advanced entry tab */ |
1510 | 1756 static void config_tab_behavior(GtkWidget *notebook) |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1757 { |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1758 GtkWidget *hbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1759 GtkWidget *vbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1760 GtkWidget *group; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1761 GtkWidget *button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1762 GtkWidget *tabcomp; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1763 GtkWidget *ct_button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1764 GtkWidget *spin; |
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
|
1765 |
1510 | 1766 vbox = scrolled_notebook_page(notebook, _("Behavior")); |
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
|
1767 |
1685 | 1768 group = pref_group_new(vbox, FALSE, _("Delete"), GTK_ORIENTATION_VERTICAL); |
9 | 1769 |
1770 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
|
1771 options->file_ops.confirm_delete, &c_options->file_ops.confirm_delete); |
9 | 1772 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
|
1773 options->file_ops.enable_delete_key, &c_options->file_ops.enable_delete_key); |
9 | 1774 |
1775 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
|
1776 options->file_ops.safe_delete_enable, &c_options->file_ops.safe_delete_enable); |
9 | 1777 |
1778 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
1779 pref_checkbox_link_sensitivity(ct_button, hbox); | |
1780 | |
1781 pref_spacer(hbox, PREF_PAD_INDENT - PREF_PAD_SPACE); | |
1782 pref_label_new(hbox, _("Folder:")); | |
1783 | |
341
15c6b94545a2
Move safe_delete* and in place rename options to file_ops
zas_
parents:
339
diff
changeset
|
1784 tabcomp = tab_completion_new(&safe_delete_path_entry, options->file_ops.safe_delete_path, NULL, NULL); |
9 | 1785 tab_completion_add_select_button(safe_delete_path_entry, NULL, TRUE); |
1786 gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0); | |
1787 gtk_widget_show(tabcomp); | |
1788 | |
1789 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); | |
1790 pref_checkbox_link_sensitivity(ct_button, hbox); | |
1791 | |
1792 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
|
1793 spin = pref_spin_new_int(hbox, _("Maximum size:"), _("MB"), |
442 | 1794 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
|
1795 #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
|
1796 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
|
1797 #endif |
9 | 1798 button = pref_button_new(NULL, NULL, _("View"), FALSE, |
1799 G_CALLBACK(safe_delete_view_cb), NULL); | |
1800 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1801 gtk_widget_show(button); | |
1802 | |
1803 button = pref_button_new(NULL, GTK_STOCK_CLEAR, NULL, FALSE, | |
1804 G_CALLBACK(safe_delete_clear_cb), NULL); | |
1805 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1806 gtk_widget_show(button); | |
1807 | |
497 | 1808 |
9 | 1809 group = pref_group_new(vbox, FALSE, _("Behavior"), GTK_ORIENTATION_VERTICAL); |
1810 | |
1811 pref_checkbox_new_int(group, _("Rectangular selection in icon view"), | |
330 | 1812 options->collections.rectangular_selection, &c_options->collections.rectangular_selection); |
9 | 1813 |
1814 pref_checkbox_new_int(group, _("Descend folders in tree view"), | |
321 | 1815 options->tree_descend_subdirs, &c_options->tree_descend_subdirs); |
9 | 1816 |
1817 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
|
1818 options->file_ops.enable_in_place_rename, &c_options->file_ops.enable_in_place_rename); |
9 | 1819 |
441
08eb7137cd94
Allow the user to change open_recent_list_maxsize option through
zas_
parents:
426
diff
changeset
|
1820 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
|
1821 1, 50, 1, options->open_recent_list_maxsize, &c_options->open_recent_list_maxsize); |
458
7a69309b91c8
Allow the user to set the drag'n drop icon size through
zas_
parents:
446
diff
changeset
|
1822 |
7a69309b91c8
Allow the user to set the drag'n drop icon size through
zas_
parents:
446
diff
changeset
|
1823 pref_spin_new_int(group, _("Drag'n drop icon size"), NULL, |
7a69309b91c8
Allow the user to set the drag'n drop icon size through
zas_
parents:
446
diff
changeset
|
1824 16, 256, 16, options->dnd_icon_size, &c_options->dnd_icon_size); |
441
08eb7137cd94
Allow the user to change open_recent_list_maxsize option through
zas_
parents:
426
diff
changeset
|
1825 |
9 | 1826 group = pref_group_new(vbox, FALSE, _("Navigation"), GTK_ORIENTATION_VERTICAL); |
1827 | |
1828 pref_checkbox_new_int(group, _("Progressive keyboard scrolling"), | |
321 | 1829 options->progressive_key_scrolling, &c_options->progressive_key_scrolling); |
9 | 1830 pref_checkbox_new_int(group, _("Mouse wheel scrolls image"), |
321 | 1831 options->mousewheel_scrolls, &c_options->mousewheel_scrolls); |
9 | 1832 |
1213 | 1833 group = pref_group_new(vbox, FALSE, _("Miscellaneous"), GTK_ORIENTATION_VERTICAL); |
1834 | |
9 | 1835 pref_spin_new_int(group, _("Custom similarity threshold:"), NULL, |
1188 | 1836 0, 100, 1, options->duplicates_similarity_threshold, (int *)&c_options->duplicates_similarity_threshold); |
9 | 1837 |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1838 |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
1839 #ifdef DEBUG |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
1840 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
|
1841 |
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
1842 pref_spin_new_int(group, _("Debug level:"), NULL, |
507 | 1843 DEBUG_LEVEL_MIN, DEBUG_LEVEL_MAX, 1, get_debug_level(), &debug_c); |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
1844 #endif |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1845 } |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1846 |
1601 | 1847 /* accelerators tab */ |
1848 static void config_tab_accelerators(GtkWidget *notebook) | |
1849 { | |
1606 | 1850 #if GTK_CHECK_VERSION(2, 10, 0) |
1601 | 1851 GtkWidget *hbox; |
1852 GtkWidget *vbox; | |
1853 GtkWidget *group; | |
1854 GtkWidget *button; | |
1855 GtkWidget *scrolled; | |
1856 GtkWidget *accel_view; | |
1857 GtkCellRenderer *renderer; | |
1858 GtkTreeSelection *selection; | |
1859 GtkTreeViewColumn *column; | |
1860 | |
1861 vbox = scrolled_notebook_page(notebook, _("Keyboard")); | |
1862 | |
1863 group = pref_group_new(vbox, TRUE, _("Accelerators"), GTK_ORIENTATION_VERTICAL); | |
1864 | |
1865 scrolled = gtk_scrolled_window_new(NULL, NULL); | |
1866 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); | |
1867 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); | |
1868 gtk_box_pack_start(GTK_BOX(group), scrolled, TRUE, TRUE, 0); | |
1869 gtk_widget_show(scrolled); | |
1870 | |
1871 accel_store = gtk_tree_store_new(4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); | |
1872 | |
1873 accel_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(accel_store)); | |
1874 g_object_unref(accel_store); | |
1875 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(accel_view)); | |
1876 gtk_tree_selection_set_mode(GTK_TREE_SELECTION(selection), GTK_SELECTION_MULTIPLE); | |
1877 | |
1878 gtk_tree_view_set_enable_search(GTK_TREE_VIEW(accel_view), FALSE); | |
1879 | |
1880 renderer = gtk_cell_renderer_text_new(); | |
1881 | |
1882 column = gtk_tree_view_column_new_with_attributes(_("Action"), | |
1883 renderer, | |
1884 "text", AE_ACTION, | |
1885 NULL); | |
1886 | |
1887 gtk_tree_view_column_set_sort_column_id(column, AE_ACTION); | |
1888 gtk_tree_view_column_set_resizable(column, TRUE); | |
1889 gtk_tree_view_append_column(GTK_TREE_VIEW(accel_view), column); | |
1890 | |
1891 | |
1892 renderer = gtk_cell_renderer_accel_new(); | |
1893 g_signal_connect(G_OBJECT(renderer), "accel-cleared", | |
1894 G_CALLBACK(accel_store_cleared_cb), accel_store); | |
1895 g_signal_connect(G_OBJECT(renderer), "accel-edited", | |
1896 G_CALLBACK(accel_store_edited_cb), accel_store); | |
1897 | |
1898 | |
1899 g_object_set (renderer, | |
1900 "editable", TRUE, | |
1901 "accel-mode", GTK_CELL_RENDERER_ACCEL_MODE_OTHER, | |
1902 NULL); | |
1903 | |
1904 column = gtk_tree_view_column_new_with_attributes(_("KEY"), | |
1905 renderer, | |
1906 "text", AE_KEY, | |
1907 NULL); | |
1908 | |
1909 gtk_tree_view_column_set_sort_column_id(column, AE_KEY); | |
1910 gtk_tree_view_column_set_resizable(column, TRUE); | |
1911 gtk_tree_view_append_column(GTK_TREE_VIEW(accel_view), column); | |
1912 | |
1913 renderer = gtk_cell_renderer_text_new(); | |
1914 | |
1915 column = gtk_tree_view_column_new_with_attributes(_("Tooltip"), | |
1916 renderer, | |
1917 "text", AE_TOOLTIP, | |
1918 NULL); | |
1919 | |
1920 gtk_tree_view_column_set_sort_column_id(column, AE_TOOLTIP); | |
1921 gtk_tree_view_column_set_resizable(column, TRUE); | |
1922 gtk_tree_view_append_column(GTK_TREE_VIEW(accel_view), column); | |
1923 | |
1924 renderer = gtk_cell_renderer_text_new(); | |
1925 | |
1926 column = gtk_tree_view_column_new_with_attributes("Accel", | |
1927 renderer, | |
1928 "text", AE_ACCEL, | |
1929 NULL); | |
1930 | |
1931 gtk_tree_view_column_set_sort_column_id(column, AE_ACCEL); | |
1932 gtk_tree_view_column_set_resizable(column, TRUE); | |
1933 gtk_tree_view_append_column(GTK_TREE_VIEW(accel_view), column); | |
1934 | |
1935 accel_store_populate(); | |
1936 gtk_container_add(GTK_CONTAINER(scrolled), accel_view); | |
1937 gtk_widget_show(accel_view); | |
1938 | |
1939 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); | |
1940 | |
1941 button = pref_button_new(NULL, NULL, _("Defaults"), FALSE, | |
1942 G_CALLBACK(accel_default_cb), NULL); | |
1943 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1944 gtk_widget_show(button); | |
1945 | |
1946 #if 0 | |
1947 button = pref_button_new(NULL, GTK_STOCK_REMOVE, NULL, FALSE, | |
1948 G_CALLBACK(accel_remove_cb), accel_view); | |
1949 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1950 gtk_widget_show(button); | |
1951 #endif | |
1952 | |
1953 button = pref_button_new(NULL, NULL, _("Reset selected"), FALSE, | |
1954 G_CALLBACK(accel_reset_cb), accel_view); | |
1955 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1956 gtk_widget_show(button); | |
1957 | |
1958 #if 0 | |
1959 button = pref_button_new(NULL, _("Add Alt"), NULL, FALSE, | |
1960 G_CALLBACK(accel_add_alt_cb), accel_view); | |
1961 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1962 gtk_widget_show(button); | |
1963 #endif | |
1606 | 1964 #endif |
1601 | 1965 } |
1966 | |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1967 /* Main preferences window */ |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1968 static void config_window_create(void) |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1969 { |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1970 GtkWidget *win_vbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1971 GtkWidget *hbox; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1972 GtkWidget *notebook; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1973 GtkWidget *button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1974 GtkWidget *ct_button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1975 |
321 | 1976 if (!c_options) c_options = init_options(NULL); |
318 | 1977 |
289
6a7298988a7a
Simplify and unify gtk_window creation with the help of
zas_
parents:
288
diff
changeset
|
1978 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
|
1979 gtk_window_set_type_hint(GTK_WINDOW(configwindow), GDK_WINDOW_TYPE_HINT_DIALOG); |
513
985fdfebd89e
Remove whitespace between function name and first parenthesis for the sake of consistency. (pass 2)
zas_
parents:
512
diff
changeset
|
1980 g_signal_connect(G_OBJECT(configwindow), "delete_event", |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1981 G_CALLBACK(config_window_delete), NULL); |
442 | 1982 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
|
1983 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
|
1984 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
|
1985 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1986 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
|
1987 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
|
1988 gtk_widget_show(win_vbox); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1989 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1990 hbox = gtk_hbutton_box_new(); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1991 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
|
1992 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
|
1993 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
|
1994 gtk_widget_show(hbox); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1995 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1996 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
|
1997 G_CALLBACK(config_window_ok_cb), NULL); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1998 gtk_container_add(GTK_CONTAINER(hbox), button); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
1999 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
|
2000 gtk_widget_grab_default(button); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2001 gtk_widget_show(button); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2002 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2003 ct_button = button; |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2004 |
1024
c92e5a5c3bfa
Add a Save button to Preferences dialog, which allow to save options to file without quitting the application.
zas_
parents:
1001
diff
changeset
|
2005 button = pref_button_new(NULL, GTK_STOCK_SAVE, NULL, FALSE, |
c92e5a5c3bfa
Add a Save button to Preferences dialog, which allow to save options to file without quitting the application.
zas_
parents:
1001
diff
changeset
|
2006 G_CALLBACK(config_window_save_cb), NULL); |
c92e5a5c3bfa
Add a Save button to Preferences dialog, which allow to save options to file without quitting the application.
zas_
parents:
1001
diff
changeset
|
2007 gtk_container_add(GTK_CONTAINER(hbox), button); |
c92e5a5c3bfa
Add a Save button to Preferences dialog, which allow to save options to file without quitting the application.
zas_
parents:
1001
diff
changeset
|
2008 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); |
c92e5a5c3bfa
Add a Save button to Preferences dialog, which allow to save options to file without quitting the application.
zas_
parents:
1001
diff
changeset
|
2009 gtk_widget_show(button); |
c92e5a5c3bfa
Add a Save button to Preferences dialog, which allow to save options to file without quitting the application.
zas_
parents:
1001
diff
changeset
|
2010 |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2011 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
|
2012 G_CALLBACK(config_window_apply_cb), NULL); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2013 gtk_container_add(GTK_CONTAINER(hbox), button); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2014 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
|
2015 gtk_widget_show(button); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2016 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2017 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
|
2018 G_CALLBACK(config_window_close_cb), NULL); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2019 gtk_container_add(GTK_CONTAINER(hbox), button); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2020 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
|
2021 gtk_widget_show(button); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2022 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2023 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
|
2024 { |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2025 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
|
2026 } |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2027 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2028 notebook = gtk_notebook_new(); |
512
f9bf33be53ff
Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents:
507
diff
changeset
|
2029 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP); |
230
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2030 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
|
2031 |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2032 config_tab_general(notebook); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2033 config_tab_image(notebook); |
4b2fbfafa511
Move tabs code from config_window_create() to new smaller functions.
zas_
parents:
227
diff
changeset
|
2034 config_tab_windows(notebook); |
1601 | 2035 config_tab_accelerators(notebook); |
1522 | 2036 config_tab_files(notebook); |
1510 | 2037 config_tab_metadata(notebook); |
2038 config_tab_color(notebook); | |
2039 config_tab_behavior(notebook); | |
227
41fc4bfc8b25
Add a debug level spinner at the end of Preferences > Advanced.
zas_
parents:
226
diff
changeset
|
2040 |
9 | 2041 gtk_widget_show(notebook); |
2042 | |
2043 gtk_widget_show(configwindow); | |
2044 } | |
2045 | |
2046 /* | |
2047 *----------------------------------------------------------------------------- | |
2048 * config window show (public) | |
2049 *----------------------------------------------------------------------------- | |
442 | 2050 */ |
9 | 2051 |
2052 void show_config_window(void) | |
2053 { | |
2054 if (configwindow) | |
2055 { | |
2056 gtk_window_present(GTK_WINDOW(configwindow)); | |
2057 return; | |
2058 } | |
2059 | |
2060 config_window_create(); | |
2061 } | |
2062 | |
2063 /* | |
2064 *----------------- | |
2065 * about window | |
2066 *----------------- | |
2067 */ | |
2068 | |
2069 static GtkWidget *about = NULL; | |
2070 | |
1443 | 2071 static gboolean about_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data) |
9 | 2072 { |
2073 gtk_widget_destroy(about); | |
2074 about = NULL; | |
2075 | |
2076 return TRUE; | |
2077 } | |
2078 | |
2079 static void about_window_close(GtkWidget *widget, gpointer data) | |
2080 { | |
2081 if (!about) return; | |
2082 | |
2083 gtk_widget_destroy(about); | |
2084 about = NULL; | |
2085 } | |
2086 | |
2087 static void about_credits_cb(GtkWidget *widget, gpointer data) | |
2088 { | |
2089 help_window_show("credits"); | |
2090 } | |
2091 | |
2092 void show_about_window(void) | |
2093 { | |
2094 GtkWidget *vbox; | |
2095 GtkWidget *hbox; | |
2096 GtkWidget *label; | |
2097 GtkWidget *button; | |
2098 GdkPixbuf *pixbuf; | |
2099 | |
2100 gchar *buf; | |
2101 | |
2102 if (about) | |
2103 { | |
2104 gtk_window_present(GTK_WINDOW(about)); | |
2105 return; | |
2106 } | |
2107 | |
289
6a7298988a7a
Simplify and unify gtk_window creation with the help of
zas_
parents:
288
diff
changeset
|
2108 about = window_new(GTK_WINDOW_TOPLEVEL, "about", NULL, NULL, _("About")); |
9 | 2109 gtk_window_set_type_hint(GTK_WINDOW(about), GDK_WINDOW_TYPE_HINT_DIALOG); |
2110 g_signal_connect(G_OBJECT(about), "delete_event", | |
2111 G_CALLBACK(about_delete_cb), NULL); | |
2112 | |
2113 gtk_container_set_border_width(GTK_CONTAINER(about), PREF_PAD_BORDER); | |
2114 | |
2115 vbox = gtk_vbox_new(FALSE, PREF_PAD_SPACE); | |
2116 gtk_container_add(GTK_CONTAINER(about), vbox); | |
2117 gtk_widget_show(vbox); | |
2118 | |
2119 pixbuf = pixbuf_inline(PIXBUF_INLINE_LOGO); | |
2120 button = gtk_image_new_from_pixbuf(pixbuf); | |
2121 g_object_unref(pixbuf); | |
2122 gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, 0); | |
2123 gtk_widget_show(button); | |
2124 | |
475 | 2125 buf = g_strdup_printf(_("%s %s\n\nCopyright (c) 2006 John Ellis\nCopyright (c) %s The Geeqie Team\nwebsite: %s\nemail: %s\n\nReleased under the GNU General Public License"), |
288
d1f74154463e
Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents:
283
diff
changeset
|
2126 GQ_APPNAME, |
9 | 2127 VERSION, |
1284 | 2128 "2008 - 2009", |
288
d1f74154463e
Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents:
283
diff
changeset
|
2129 GQ_WEBSITE, |
d1f74154463e
Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents:
283
diff
changeset
|
2130 GQ_EMAIL_ADDRESS); |
9 | 2131 label = gtk_label_new(buf); |
2132 g_free(buf); | |
2133 | |
2134 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER); | |
2135 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0); | |
2136 gtk_widget_show(label); | |
2137 | |
2138 hbox = gtk_hbutton_box_new(); | |
2139 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_END); | |
2140 gtk_box_set_spacing(GTK_BOX(hbox), PREF_PAD_BUTTON_GAP); | |
2141 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
2142 gtk_widget_show(hbox); | |
2143 | |
2144 button = pref_button_new(NULL, NULL, _("Credits..."), FALSE, | |
2145 G_CALLBACK(about_credits_cb), NULL); | |
2146 gtk_container_add(GTK_CONTAINER(hbox), button); | |
2147 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
2148 gtk_widget_show(button); | |
2149 | |
2150 button = pref_button_new(NULL, GTK_STOCK_CLOSE, NULL, FALSE, | |
2151 G_CALLBACK(about_window_close), NULL); | |
2152 gtk_container_add(GTK_CONTAINER(hbox), button); | |
2153 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
2154 gtk_widget_grab_default(button); | |
2155 gtk_widget_show(button); | |
2156 | |
2157 gtk_widget_show(about); | |
2158 } | |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
1053
diff
changeset
|
2159 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |