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