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