Mercurial > geeqie.yaz
annotate src/preferences.c @ 158:63f202592bb1
removed unused variable
author | nadvornik |
---|---|
date | Mon, 17 Dec 2007 19:34:43 +0000 |
parents | 9009856628f7 |
children | 9a56e3d13e67 |
rev | line source |
---|---|
9 | 1 /* |
2 * GQview | |
67
f63ecca6c087
Fri Oct 13 05:22:43 2006 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
3 * (C) 2006 John Ellis |
9 | 4 * |
5 * Author: John Ellis | |
6 * | |
7 * This software is released under the GNU General Public License (GNU GPL). | |
8 * Please read the included file COPYING for more information. | |
9 * This software comes with no warranty of any kind, use at your own risk! | |
10 */ | |
11 | |
12 | |
13 #include "gqview.h" | |
14 #include "preferences.h" | |
15 | |
16 #include "cache_maint.h" | |
17 #include "editors.h" | |
18 #include "filelist.h" | |
19 #include "fullscreen.h" | |
26
acd9885ebd78
Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents:
15
diff
changeset
|
20 #include "image.h" |
9 | 21 #include "img-view.h" |
22 #include "layout_config.h" | |
23 #include "layout_util.h" | |
24 #include "pixbuf_util.h" | |
25 #include "slideshow.h" | |
26 #include "utilops.h" | |
27 #include "ui_fileops.h" | |
28 #include "ui_misc.h" | |
29 #include "ui_tabcomp.h" | |
30 #include "ui_utildlg.h" | |
31 | |
32 #include <math.h> | |
33 | |
34 | |
35 #define EDITOR_NAME_MAX_LENGTH 32 | |
36 #define EDITOR_COMMAND_MAX_LENGTH 1024 | |
37 | |
38 | |
39 typedef struct _ThumbSize ThumbSize; | |
40 struct _ThumbSize | |
41 { | |
42 gint w; | |
43 gint h; | |
44 }; | |
45 | |
46 static ThumbSize thumb_size_list[] = | |
47 { | |
48 { 24, 24 }, | |
49 { 32, 32 }, | |
50 { 48, 48 }, | |
51 { 64, 64 }, | |
52 { 96, 72 }, | |
53 { 96, 96 }, | |
54 { 128, 96 }, | |
55 { 128, 128 }, | |
56 { 160, 120 }, | |
57 { 160, 160 }, | |
58 { 192, 144 }, | |
59 { 192, 192 }, | |
60 { 256, 192 }, | |
61 { 256, 256 } | |
62 }; | |
63 | |
64 enum { | |
65 FE_ENABLE, | |
66 FE_EXTENSION, | |
67 FE_DESCRIPTION | |
68 }; | |
69 | |
70 /* config memory values */ | |
71 static gint startup_path_enable_c; | |
72 static gint confirm_delete_c; | |
73 static gint enable_delete_key_c; | |
74 static gint safe_delete_enable_c; | |
75 static gint safe_delete_size_c; | |
76 static gint restore_tool_c; | |
77 static gint save_window_positions_c; | |
78 static gint zoom_mode_c; | |
79 static gint two_pass_zoom_c; | |
80 static gint fit_window_c; | |
81 static gint limit_window_size_c; | |
82 static gint zoom_to_fit_expands_c; | |
83 static gint max_window_size_c; | |
84 static gint progressive_key_scrolling_c; | |
85 static gint thumb_max_width_c; | |
86 static gint thumb_max_height_c; | |
87 static gint enable_thumb_caching_c; | |
88 static gint enable_thumb_dirs_c; | |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
89 static gint thumbnail_fast_c; |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
90 #if 0 |
9 | 91 static gint use_xvpics_thumbnails_c; |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
92 #endif |
9 | 93 static gint thumbnail_spec_standard_c; |
94 static gint enable_metadata_dirs_c; | |
95 static gint show_dot_files_c; | |
96 static gint file_filter_disable_c; | |
97 static gint file_sort_case_sensitive_c; | |
98 static gint slideshow_delay_c; | |
99 static gint slideshow_random_c; | |
100 static gint slideshow_repeat_c; | |
101 | |
102 static gint mousewheel_scrolls_c; | |
103 | |
104 static gint enable_in_place_rename_c; | |
105 | |
106 static gint collection_rectangular_selection_c; | |
107 | |
108 static gint tile_cache_max_c; | |
109 | |
110 static gint thumbnail_quality_c; | |
111 static gint zoom_quality_c; | |
112 | |
113 static gint zoom_increment_c; | |
114 | |
115 static gint enable_read_ahead_c; | |
116 | |
117 static gint black_window_background_c; | |
118 | |
119 static gint fullscreen_screen_c; | |
120 static gint fullscreen_clean_flip_c; | |
121 static gint fullscreen_disable_saver_c; | |
122 static gint fullscreen_above_c; | |
123 | |
124 static gint dupe_custom_threshold_c; | |
125 | |
126 static GtkWidget *configwindow = NULL; | |
127 static GtkWidget *startup_path_entry; | |
128 static GtkListStore *filter_store = NULL; | |
129 static GtkWidget *editor_name_entry[GQVIEW_EDITOR_SLOTS]; | |
130 static GtkWidget *editor_command_entry[GQVIEW_EDITOR_SLOTS]; | |
131 | |
132 static GtkWidget *layout_widget; | |
133 | |
134 static GtkWidget *safe_delete_path_entry; | |
135 | |
136 static gint tree_descend_subdirs_c; | |
137 | |
138 static gint update_on_time_change_c; | |
139 static gint exif_rotate_enable_c; | |
140 | |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
141 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
|
142 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
|
143 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
|
144 |
9 | 145 |
146 /* | |
147 *----------------------------------------------------------------------------- | |
148 * option widget callbacks (private) | |
149 *----------------------------------------------------------------------------- | |
150 */ | |
151 | |
152 static void startup_path_set_current(GtkWidget *widget, gpointer data) | |
153 { | |
154 gtk_entry_set_text(GTK_ENTRY(startup_path_entry), layout_get_path(NULL)); | |
155 } | |
156 | |
157 static void zoom_mode_original_cb(GtkWidget *widget, gpointer data) | |
158 { | |
159 if (GTK_TOGGLE_BUTTON (widget)->active) | |
160 zoom_mode_c = ZOOM_RESET_ORIGINAL; | |
161 } | |
162 | |
163 static void zoom_mode_fit_cb(GtkWidget *widget, gpointer data) | |
164 { | |
165 if (GTK_TOGGLE_BUTTON (widget)->active) | |
166 zoom_mode_c = ZOOM_RESET_FIT_WINDOW; | |
167 } | |
168 | |
169 static void zoom_mode_none_cb(GtkWidget *widget, gpointer data) | |
170 { | |
171 if (GTK_TOGGLE_BUTTON (widget)->active) | |
172 zoom_mode_c = ZOOM_RESET_NONE; | |
173 } | |
174 | |
175 static void zoom_increment_cb(GtkWidget *spin, gpointer data) | |
176 { | |
177 zoom_increment_c = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * 10.0 + 0.01); | |
178 } | |
179 | |
180 static void slideshow_delay_cb(GtkWidget *spin, gpointer data) | |
181 { | |
182 slideshow_delay_c = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * | |
183 (double)SLIDESHOW_SUBSECOND_PRECISION + 0.01); | |
184 } | |
185 | |
186 /* | |
187 *----------------------------------------------------------------------------- | |
188 * sync progam to config window routine (private) | |
189 *----------------------------------------------------------------------------- | |
190 */ | |
191 | |
192 static void config_window_apply(void) | |
193 { | |
194 const gchar *buf; | |
195 gchar *l_conf; | |
196 gint new_style; | |
197 gint i; | |
198 gint refresh = FALSE; | |
199 | |
200 for(i = 0; i < GQVIEW_EDITOR_SLOTS; i++) | |
201 { | |
134
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
202 if (i < GQVIEW_EDITOR_GENERIC_SLOTS) |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
203 { |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
204 g_free(editor_name[i]); |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
205 editor_name[i] = NULL; |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
206 buf = gtk_entry_get_text(GTK_ENTRY(editor_name_entry[i])); |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
207 if (buf && strlen(buf) > 0) editor_name[i] = g_strdup(buf); |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
208 } |
9 | 209 |
210 g_free(editor_command[i]); | |
211 editor_command[i] = NULL; | |
212 buf = gtk_entry_get_text(GTK_ENTRY(editor_command_entry[i])); | |
213 if (buf && strlen(buf) > 0) editor_command[i] = g_strdup(buf); | |
214 } | |
215 layout_edit_update_all(); | |
216 | |
217 g_free(startup_path); | |
218 startup_path = NULL; | |
219 buf = gtk_entry_get_text(GTK_ENTRY(startup_path_entry)); | |
220 if (buf && strlen(buf) > 0) startup_path = remove_trailing_slash(buf); | |
221 | |
222 g_free(safe_delete_path); | |
223 safe_delete_path = NULL; | |
224 buf = gtk_entry_get_text(GTK_ENTRY(safe_delete_path_entry)); | |
225 if (buf && strlen(buf) > 0) safe_delete_path = remove_trailing_slash(buf); | |
226 | |
227 if (show_dot_files != show_dot_files_c) refresh = TRUE; | |
228 if (file_sort_case_sensitive != file_sort_case_sensitive_c) refresh = TRUE; | |
229 if (file_filter_disable != file_filter_disable_c) refresh = TRUE; | |
230 | |
231 startup_path_enable = startup_path_enable_c; | |
232 confirm_delete = confirm_delete_c; | |
233 enable_delete_key = enable_delete_key_c; | |
234 safe_delete_enable = safe_delete_enable_c; | |
235 safe_delete_size = safe_delete_size_c; | |
236 restore_tool = restore_tool_c; | |
237 save_window_positions = save_window_positions_c; | |
238 zoom_mode = zoom_mode_c; | |
239 two_pass_zoom = two_pass_zoom_c; | |
240 fit_window = fit_window_c; | |
241 limit_window_size = limit_window_size_c; | |
242 zoom_to_fit_expands = zoom_to_fit_expands_c; | |
243 max_window_size = max_window_size_c; | |
244 progressive_key_scrolling = progressive_key_scrolling_c; | |
245 thumb_max_width = thumb_max_width_c; | |
246 thumb_max_height = thumb_max_height_c; | |
247 enable_thumb_caching = enable_thumb_caching_c; | |
248 enable_thumb_dirs = enable_thumb_dirs_c; | |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
249 thumbnail_fast = thumbnail_fast_c; |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
250 #if 0 |
9 | 251 use_xvpics_thumbnails = use_xvpics_thumbnails_c; |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
252 #endif |
9 | 253 thumbnail_spec_standard = thumbnail_spec_standard_c; |
254 enable_metadata_dirs = enable_metadata_dirs_c; | |
255 show_dot_files = show_dot_files_c; | |
256 file_sort_case_sensitive = file_sort_case_sensitive_c; | |
257 file_filter_disable = file_filter_disable_c; | |
258 | |
259 slideshow_random = slideshow_random_c; | |
260 slideshow_repeat = slideshow_repeat_c; | |
261 slideshow_delay = slideshow_delay_c; | |
262 | |
263 mousewheel_scrolls = mousewheel_scrolls_c; | |
264 | |
265 enable_in_place_rename = enable_in_place_rename_c; | |
266 | |
267 collection_rectangular_selection = collection_rectangular_selection_c; | |
268 | |
269 tile_cache_max = tile_cache_max_c; | |
270 | |
271 thumbnail_quality = thumbnail_quality_c; | |
272 zoom_quality = zoom_quality_c; | |
273 | |
274 zoom_increment = zoom_increment_c; | |
275 | |
276 enable_read_ahead = enable_read_ahead_c; | |
277 | |
278 if (black_window_background != black_window_background_c) | |
279 { | |
280 black_window_background = black_window_background_c; | |
281 | |
282 layout_colors_update(); | |
283 view_window_colors_update(); | |
284 } | |
285 | |
286 fullscreen_screen = fullscreen_screen_c; | |
287 fullscreen_clean_flip = fullscreen_clean_flip_c; | |
288 fullscreen_disable_saver = fullscreen_disable_saver_c; | |
289 fullscreen_above = fullscreen_above_c; | |
290 | |
291 update_on_time_change = update_on_time_change_c; | |
292 exif_rotate_enable = exif_rotate_enable_c; | |
293 | |
294 dupe_custom_threshold = dupe_custom_threshold_c; | |
295 | |
296 tree_descend_subdirs = tree_descend_subdirs_c; | |
297 | |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
298 #ifdef HAVE_LCMS |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
299 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
|
300 { |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
301 g_free(color_profile_input_name[i]); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
302 color_profile_input_name[i] = NULL; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
303 buf = gtk_entry_get_text(GTK_ENTRY(color_profile_input_name_entry[i])); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
304 if (buf && strlen(buf) > 0) color_profile_input_name[i] = g_strdup(buf); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
305 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
306 g_free(color_profile_input_file[i]); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
307 color_profile_input_file[i] = NULL; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
308 buf = gtk_entry_get_text(GTK_ENTRY(color_profile_input_file_entry[i])); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
309 if (buf && strlen(buf) > 0) color_profile_input_file[i] = g_strdup(buf); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
310 } |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
311 g_free(color_profile_screen_file); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
312 color_profile_screen_file = NULL; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
313 buf = gtk_entry_get_text(GTK_ENTRY(color_profile_screen_file_entry)); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
314 if (buf && strlen(buf) > 0) color_profile_screen_file = g_strdup(buf); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
315 #endif |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
316 |
9 | 317 l_conf = layout_config_get(layout_widget, &new_style); |
318 | |
319 if (new_style != layout_style || | |
320 (l_conf == NULL) != (layout_order == NULL) || | |
321 !layout_order || | |
322 strcmp(buf, layout_order) != 0) | |
323 { | |
324 if (refresh) filter_rebuild(); | |
325 refresh = FALSE; | |
326 | |
327 g_free(layout_order); | |
328 layout_order = l_conf; | |
329 l_conf = NULL; | |
330 | |
331 layout_style = new_style; | |
332 | |
333 layout_styles_update(); | |
334 } | |
335 | |
336 g_free(l_conf); | |
337 | |
26
acd9885ebd78
Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents:
15
diff
changeset
|
338 image_options_sync(); |
acd9885ebd78
Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents:
15
diff
changeset
|
339 |
9 | 340 if (refresh) |
341 { | |
342 filter_rebuild(); | |
343 layout_refresh(NULL); | |
344 } | |
345 } | |
346 | |
347 /* | |
348 *----------------------------------------------------------------------------- | |
349 * config window main button callbacks (private) | |
350 *----------------------------------------------------------------------------- | |
351 */ | |
352 | |
353 static void config_window_close_cb(GtkWidget *widget, gpointer data) | |
354 { | |
355 gtk_widget_destroy(configwindow); | |
356 configwindow = NULL; | |
357 filter_store = NULL; | |
358 } | |
359 | |
360 static gint config_window_delete(GtkWidget *w, GdkEventAny *event, gpointer data) | |
361 { | |
362 config_window_close_cb(NULL, NULL); | |
363 return TRUE; | |
364 } | |
365 | |
366 static void config_window_ok_cb(GtkWidget *widget, gpointer data) | |
367 { | |
368 config_window_apply(); | |
369 config_window_close_cb(NULL, NULL); | |
370 } | |
371 | |
372 static void config_window_apply_cb(GtkWidget *widget, gpointer data) | |
373 { | |
374 config_window_apply(); | |
375 } | |
376 | |
377 /* | |
378 *----------------------------------------------------------------------------- | |
379 * config window setup (private) | |
380 *----------------------------------------------------------------------------- | |
381 */ | |
382 | |
383 static void quality_menu_cb(GtkWidget *combo, gpointer data) | |
384 { | |
385 gint *option = data; | |
386 | |
387 switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo))) | |
388 { | |
389 case 0: | |
390 default: | |
391 *option = GDK_INTERP_NEAREST; | |
392 break; | |
393 case 1: | |
394 *option = GDK_INTERP_TILES; | |
395 break; | |
396 case 2: | |
397 *option = GDK_INTERP_BILINEAR; | |
398 break; | |
399 case 3: | |
400 *option = GDK_INTERP_HYPER; | |
401 break; | |
402 } | |
403 } | |
404 | |
405 static void add_quality_menu(GtkWidget *table, gint column, gint row, const gchar *text, | |
406 gint option, gint *option_c) | |
407 { | |
408 GtkWidget *combo; | |
409 gint current = 0; | |
410 | |
411 *option_c = option; | |
412 | |
413 pref_table_label(table, column, row, text, 0.0); | |
414 | |
415 combo = gtk_combo_box_new_text(); | |
416 | |
417 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Nearest (worst, but fastest)")); | |
418 if (option == GDK_INTERP_NEAREST) current = 0; | |
419 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Tiles")); | |
420 if (option == GDK_INTERP_TILES) current = 1; | |
421 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Bilinear")); | |
422 if (option == GDK_INTERP_BILINEAR) current = 2; | |
423 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Hyper (best, but slowest)")); | |
424 if (option == GDK_INTERP_HYPER) current = 3; | |
425 | |
426 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current); | |
427 | |
428 g_signal_connect(G_OBJECT(combo), "changed", | |
429 G_CALLBACK(quality_menu_cb), option_c); | |
430 | |
431 gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, | |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
432 GTK_EXPAND | GTK_FILL, 0, 0, 0); |
9 | 433 gtk_widget_show(combo); |
434 } | |
435 | |
436 #if 0 | |
437 static void add_dither_menu(gint option, gint *option_c, gchar *text, GtkWidget *box) | |
438 { | |
439 GtkWidget *hbox; | |
440 GtkWidget *omenu; | |
441 GtkWidget *menu; | |
442 | |
443 *option_c = option; | |
444 | |
445 hbox = pref_box_new(box, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
446 pref_label_new(hbox, text); | |
447 | |
448 omenu = gtk_option_menu_new(); | |
449 menu = gtk_menu_new(); | |
450 | |
451 add_menu_item(menu, _("None"), option_c, (gint)GDK_RGB_DITHER_NONE); | |
452 add_menu_item(menu, _("Normal"), option_c, (gint)GDK_RGB_DITHER_NORMAL); | |
453 add_menu_item(menu, _("Best"), option_c, (gint)GDK_RGB_DITHER_MAX); | |
454 | |
455 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
456 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), *option_c); | |
457 | |
458 gtk_box_pack_start(GTK_BOX(hbox), omenu, FALSE, FALSE, 0); | |
459 gtk_widget_show(omenu); | |
460 } | |
461 #endif | |
462 | |
463 static void thumb_size_menu_cb(GtkWidget *combo, gpointer data) | |
464 { | |
465 gint n; | |
466 | |
467 n = gtk_combo_box_get_active(GTK_COMBO_BOX(combo)); | |
468 | |
469 if (n >= 0 && n < sizeof(thumb_size_list) / sizeof(ThumbSize)) | |
470 { | |
471 thumb_max_width_c = thumb_size_list[n].w; | |
472 thumb_max_height_c = thumb_size_list[n].h; | |
473 } | |
474 else if (n > 0) | |
475 { | |
476 thumb_max_width_c = thumb_max_width; | |
477 thumb_max_height_c = thumb_max_height; | |
478 } | |
479 } | |
480 | |
481 static void add_thumb_size_menu(GtkWidget *table, gint column, gint row, gchar *text) | |
482 { | |
483 GtkWidget *combo; | |
484 gint current; | |
485 gint last_w, last_h; | |
486 gint i; | |
487 gint c; | |
488 | |
489 thumb_max_width_c = thumb_max_width; | |
490 thumb_max_height_c = thumb_max_height; | |
491 | |
492 pref_table_label(table, column, row, text, 0.0); | |
493 | |
494 combo = gtk_combo_box_new_text(); | |
495 | |
496 last_w = last_h = 0; | |
497 current = -1; | |
498 i = 0; | |
499 c = TRUE; | |
500 while (c) | |
501 { | |
502 gint w, h; | |
503 | |
504 w = thumb_size_list[i].w; | |
505 h = thumb_size_list[i].h; | |
506 | |
507 if ( w > 0 && h > 0) | |
508 { | |
509 gchar *buf; | |
510 | |
511 buf = g_strdup_printf("%d x %d", w, h); | |
512 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), buf); | |
513 g_free(buf); | |
514 | |
515 if (w == thumb_max_width && h == thumb_max_height) current = i; | |
516 | |
517 last_w = w; | |
518 last_h = h; | |
519 } | |
520 else | |
521 { | |
522 c = FALSE; | |
523 } | |
524 i++; | |
525 } | |
526 | |
527 if (current == -1) | |
528 { | |
529 gchar *buf; | |
530 | |
531 buf = g_strdup_printf("%s %d x %d", _("Custom"), thumb_max_width, thumb_max_height); | |
532 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), buf); | |
533 g_free(buf); | |
534 | |
535 current = i - 1; | |
536 } | |
537 | |
538 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current); | |
539 g_signal_connect(G_OBJECT(combo), "changed", | |
540 G_CALLBACK(thumb_size_menu_cb), NULL); | |
541 | |
542 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
|
543 GTK_EXPAND | GTK_FILL, 0, 0, 0); |
9 | 544 gtk_widget_show(combo); |
545 } | |
546 | |
547 static void filter_store_populate(void) | |
548 { | |
549 GList *work; | |
550 | |
551 if (!filter_store) return; | |
552 | |
553 gtk_list_store_clear(filter_store); | |
554 | |
555 work = filter_get_list(); | |
556 while (work) | |
557 { | |
558 FilterEntry *fe; | |
559 GtkTreeIter iter; | |
560 | |
561 fe = work->data; | |
562 work = work->next; | |
563 | |
564 gtk_list_store_append(filter_store, &iter); | |
565 gtk_list_store_set(filter_store, &iter, 0, fe, -1); | |
566 } | |
567 } | |
568 | |
569 static void filter_store_ext_edit_cb(GtkCellRendererText *cell, gchar *path_str, | |
570 gchar *new_text, gpointer data) | |
571 { | |
572 GtkWidget *model = data; | |
573 FilterEntry *fe = data; | |
574 GtkTreePath *tpath; | |
575 GtkTreeIter iter; | |
576 | |
577 if (!new_text || strlen(new_text) < 1) return; | |
578 | |
579 tpath = gtk_tree_path_new_from_string(path_str); | |
580 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, tpath); | |
581 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 0, &fe, -1); | |
582 | |
583 g_free(fe->extensions); | |
584 fe->extensions = g_strdup(new_text); | |
585 | |
586 gtk_tree_path_free(tpath); | |
587 filter_rebuild(); | |
588 } | |
589 | |
590 static void filter_store_desc_edit_cb(GtkCellRendererText *cell, gchar *path_str, | |
591 gchar *new_text, gpointer data) | |
592 { | |
593 GtkWidget *model = data; | |
594 FilterEntry *fe; | |
595 GtkTreePath *tpath; | |
596 GtkTreeIter iter; | |
597 | |
598 if (!new_text || strlen(new_text) < 1) return; | |
599 | |
600 tpath = gtk_tree_path_new_from_string(path_str); | |
601 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, tpath); | |
602 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 0, &fe, -1); | |
603 | |
604 g_free(fe->description); | |
605 fe->description = g_strdup(new_text); | |
606 | |
607 gtk_tree_path_free(tpath); | |
608 } | |
609 | |
610 static void filter_store_enable_cb(GtkCellRendererToggle *renderer, | |
611 gchar *path_str, gpointer data) | |
612 { | |
613 GtkWidget *model = data; | |
614 FilterEntry *fe; | |
615 GtkTreePath *tpath; | |
616 GtkTreeIter iter; | |
617 | |
618 tpath = gtk_tree_path_new_from_string(path_str); | |
619 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, tpath); | |
620 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 0, &fe, -1); | |
621 | |
622 fe->enabled = !fe->enabled; | |
623 | |
624 gtk_tree_path_free(tpath); | |
625 filter_rebuild(); | |
626 } | |
627 | |
628 static void filter_set_func(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, | |
629 GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) | |
630 { | |
631 FilterEntry *fe; | |
632 | |
633 gtk_tree_model_get(tree_model, iter, 0, &fe, -1); | |
634 | |
635 switch(GPOINTER_TO_INT(data)) | |
636 { | |
637 case FE_ENABLE: | |
638 g_object_set(GTK_CELL_RENDERER(cell), | |
639 "active", fe->enabled, NULL); | |
640 break; | |
641 case FE_EXTENSION: | |
642 g_object_set(GTK_CELL_RENDERER(cell), | |
643 "text", fe->extensions, NULL); | |
644 break; | |
645 case FE_DESCRIPTION: | |
646 g_object_set(GTK_CELL_RENDERER(cell), | |
647 "text", fe->description, NULL); | |
648 break; | |
649 } | |
650 } | |
651 | |
652 static void filter_add_cb(GtkWidget *widget, gpointer data) | |
653 { | |
654 filter_add_unique("description", ".new", TRUE); | |
655 filter_store_populate(); | |
656 | |
657 /* FIXME: implement the scroll to/select row stuff for tree view */ | |
658 } | |
659 | |
660 static void filter_remove_cb(GtkWidget *widget, gpointer data) | |
661 { | |
662 GtkWidget *filter_view = data; | |
663 GtkTreeSelection *selection; | |
664 GtkTreeIter iter; | |
665 FilterEntry *fe; | |
666 | |
667 if (!filter_store) return; | |
668 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(filter_view)); | |
669 if (!gtk_tree_selection_get_selected(selection, NULL, &iter)) return; | |
670 gtk_tree_model_get(GTK_TREE_MODEL(filter_store), &iter, 0, &fe, -1); | |
671 if (!fe) return; | |
672 | |
673 filter_remove_entry(fe); | |
674 filter_rebuild(); | |
675 filter_store_populate(); | |
676 } | |
677 | |
678 static void filter_default_ok_cb(GenericDialog *gd, gpointer data) | |
679 { | |
680 filter_reset(); | |
681 filter_add_defaults(); | |
682 filter_rebuild(); | |
683 filter_store_populate(); | |
684 } | |
685 | |
686 static void dummy_cancel_cb(GenericDialog *gd, gpointer data) | |
687 { | |
688 /* no op, only so cancel button appears */ | |
689 } | |
690 | |
691 static void filter_default_cb(GtkWidget *widget, gpointer data) | |
692 { | |
693 GenericDialog *gd; | |
694 | |
695 gd = generic_dialog_new(_("Reset filters"), | |
696 "GQview", "reset_filter", widget, TRUE, | |
697 dummy_cancel_cb, NULL); | |
698 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Reset filters"), | |
699 _("This will reset the file filters to the defaults.\nContinue?")); | |
700 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, filter_default_ok_cb, TRUE); | |
701 gtk_widget_show(gd->dialog); | |
702 } | |
703 | |
704 static void filter_disable_cb(GtkWidget* widget, gpointer data) | |
705 { | |
706 GtkWidget *frame = data; | |
707 | |
708 gtk_widget_set_sensitive(frame, | |
709 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))); | |
710 } | |
711 | |
712 static void editor_default_ok_cb(GenericDialog *gd, gpointer data) | |
713 { | |
714 gint i; | |
715 | |
716 editor_reset_defaults(); | |
717 if (!configwindow) return; | |
718 | |
719 for (i = 0; i < GQVIEW_EDITOR_SLOTS; i++) | |
720 { | |
134
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
721 if (i < GQVIEW_EDITOR_GENERIC_SLOTS) |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
722 gtk_entry_set_text(GTK_ENTRY(editor_name_entry[i]), |
9 | 723 (editor_name[i]) ? editor_name[i] : ""); |
724 gtk_entry_set_text(GTK_ENTRY(editor_command_entry[i]), | |
725 (editor_command[i]) ? editor_command[i] : ""); | |
726 } | |
727 } | |
728 | |
729 static void editor_default_cb(GtkWidget *widget, gpointer data) | |
730 { | |
731 GenericDialog *gd; | |
732 | |
733 gd = generic_dialog_new(_("Reset editors"), | |
734 "GQview", "reset_filter", widget, TRUE, | |
735 dummy_cancel_cb, NULL); | |
736 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Reset editors"), | |
737 _("This will reset the edit commands to the defaults.\nContinue?")); | |
738 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, editor_default_ok_cb, TRUE); | |
739 gtk_widget_show(gd->dialog); | |
740 } | |
741 | |
742 static void editor_help_cb(GtkWidget *widget, gpointer data) | |
743 { | |
744 help_window_show("editors"); | |
745 } | |
746 | |
747 static void safe_delete_view_cb(GtkWidget* widget, gpointer data) | |
748 { | |
749 layout_set_path(NULL, gtk_entry_get_text(GTK_ENTRY(safe_delete_path_entry))); | |
750 } | |
751 | |
752 static void safe_delete_clear_ok_cb(GenericDialog *gd, gpointer data) | |
753 { | |
754 file_util_trash_clear(); | |
755 } | |
756 | |
757 static void safe_delete_clear_cb(GtkWidget* widget, gpointer data) | |
758 { | |
759 GenericDialog *gd; | |
760 GtkWidget *entry; | |
761 gd = generic_dialog_new(_("Clear trash"), | |
762 "GQview", "clear_trash", widget, TRUE, | |
763 dummy_cancel_cb, NULL); | |
764 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Clear trash"), | |
765 _("This will remove the trash contents.")); | |
766 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, safe_delete_clear_ok_cb, TRUE); | |
767 entry = gtk_entry_new(); | |
768 GTK_WIDGET_UNSET_FLAGS(entry, GTK_CAN_FOCUS); | |
769 gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE); | |
770 if (safe_delete_path) gtk_entry_set_text(GTK_ENTRY(entry), safe_delete_path); | |
771 gtk_box_pack_start(GTK_BOX(gd->vbox), entry, FALSE, FALSE, 0); | |
772 gtk_widget_show(entry); | |
773 gtk_widget_show(gd->dialog); | |
774 } | |
775 | |
776 static void config_window_create(void) | |
777 { | |
778 GtkWidget *win_vbox; | |
779 GtkWidget *hbox; | |
780 GtkWidget *notebook; | |
781 GtkWidget *frame; | |
782 GtkWidget *label; | |
783 GtkWidget *vbox; | |
784 GtkWidget *group; | |
785 GtkWidget *subgroup; | |
786 GtkWidget *button; | |
787 GtkWidget *tabcomp; | |
788 GtkWidget *ct_button; | |
789 GtkWidget *table; | |
790 GtkWidget *spin; | |
791 GtkWidget *scrolled; | |
792 GtkWidget *viewport; | |
793 GtkWidget *filter_view; | |
794 GtkCellRenderer *renderer; | |
795 GtkTreeSelection *selection; | |
796 GtkTreeViewColumn *column; | |
797 gint i; | |
798 | |
799 configwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
800 gtk_window_set_type_hint(GTK_WINDOW(configwindow), GDK_WINDOW_TYPE_HINT_DIALOG); | |
801 g_signal_connect(G_OBJECT (configwindow), "delete_event", | |
802 G_CALLBACK(config_window_delete), NULL); | |
803 gtk_window_set_resizable(GTK_WINDOW(configwindow), FALSE); | |
804 gtk_window_set_title(GTK_WINDOW(configwindow), _("GQview Preferences")); | |
805 gtk_window_set_wmclass(GTK_WINDOW(configwindow), "config", "GQview"); | |
806 gtk_container_set_border_width(GTK_CONTAINER(configwindow), PREF_PAD_BORDER); | |
807 | |
91
d063f97503b7
Wed Nov 1 11:39:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
67
diff
changeset
|
808 window_set_icon(configwindow, PIXBUF_INLINE_ICON_CONFIG, NULL); |
9 | 809 |
810 win_vbox = gtk_vbox_new(FALSE, PREF_PAD_SPACE); | |
811 gtk_container_add(GTK_CONTAINER(configwindow), win_vbox); | |
812 gtk_widget_show(win_vbox); | |
813 | |
814 hbox = gtk_hbutton_box_new(); | |
815 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_END); | |
816 gtk_box_set_spacing(GTK_BOX(hbox), PREF_PAD_BUTTON_GAP); | |
817 gtk_box_pack_end(GTK_BOX(win_vbox), hbox, FALSE, FALSE, 0); | |
818 gtk_widget_show(hbox); | |
819 | |
820 button = pref_button_new(NULL, GTK_STOCK_OK, NULL, FALSE, | |
821 G_CALLBACK(config_window_ok_cb), NULL); | |
822 gtk_container_add(GTK_CONTAINER(hbox), button); | |
823 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
824 gtk_widget_grab_default(button); | |
825 gtk_widget_show(button); | |
826 | |
827 ct_button = button; | |
828 | |
829 button = pref_button_new(NULL, GTK_STOCK_APPLY, NULL, FALSE, | |
830 G_CALLBACK(config_window_apply_cb), NULL); | |
831 gtk_container_add(GTK_CONTAINER(hbox), button); | |
832 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
833 gtk_widget_show(button); | |
834 | |
835 button = pref_button_new(NULL, GTK_STOCK_CANCEL, NULL, FALSE, | |
836 G_CALLBACK(config_window_close_cb), NULL); | |
837 gtk_container_add(GTK_CONTAINER(hbox), button); | |
838 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
839 gtk_widget_show(button); | |
840 | |
841 if (!generic_dialog_get_alternative_button_order(configwindow)) | |
842 { | |
843 gtk_box_reorder_child(GTK_BOX(hbox), ct_button, -1); | |
844 } | |
845 | |
846 notebook = gtk_notebook_new(); | |
847 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(notebook), GTK_POS_TOP); | |
848 gtk_box_pack_start(GTK_BOX(win_vbox), notebook, TRUE, TRUE, 0); | |
849 | |
850 /* general options tab */ | |
851 | |
852 vbox = gtk_vbox_new(FALSE, 0); | |
853 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | |
854 gtk_widget_show(vbox); | |
855 label = gtk_label_new(_("General")); | |
856 gtk_notebook_append_page (GTK_NOTEBOOK(notebook), vbox, label); | |
857 | |
858 group = pref_group_new(vbox, FALSE, _("Startup"), GTK_ORIENTATION_VERTICAL); | |
859 | |
860 button = pref_checkbox_new_int(group, _("Change to folder:"), | |
861 startup_path_enable, &startup_path_enable_c); | |
862 | |
863 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
864 pref_checkbox_link_sensitivity(button, hbox); | |
865 | |
866 tabcomp = tab_completion_new(&startup_path_entry, startup_path, NULL, NULL); | |
867 tab_completion_add_select_button(startup_path_entry, NULL, TRUE); | |
868 gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0); | |
869 gtk_widget_show(tabcomp); | |
870 | |
871 button = pref_button_new(hbox, NULL, _("Use current"), FALSE, | |
872 G_CALLBACK(startup_path_set_current), NULL); | |
873 | |
874 group = pref_group_new(vbox, FALSE, _("Thumbnails"), GTK_ORIENTATION_VERTICAL); | |
875 | |
876 table = pref_table_new(group, 2, 2, FALSE, FALSE); | |
877 add_thumb_size_menu(table, 0, 0, _("Size:")); | |
878 add_quality_menu(table, 0, 1, _("Quality:"), thumbnail_quality, &thumbnail_quality_c); | |
879 | |
880 ct_button = pref_checkbox_new_int(group, _("Cache thumbnails"), | |
881 enable_thumb_caching, &enable_thumb_caching_c); | |
882 | |
883 subgroup = pref_box_new(group, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | |
884 pref_checkbox_link_sensitivity(ct_button, subgroup); | |
885 | |
886 button = pref_checkbox_new_int(subgroup, _("Use shared thumbnail cache"), | |
887 thumbnail_spec_standard, &thumbnail_spec_standard_c); | |
888 | |
889 subgroup = pref_box_new(subgroup, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | |
890 pref_checkbox_link_sensitivity_swap(button, subgroup); | |
891 | |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
892 pref_checkbox_new_int(subgroup, _("Cache thumbnails into .thumbnails"), |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
893 enable_thumb_dirs, &enable_thumb_dirs_c); |
9 | 894 |
14
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
895 #if 0 |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
896 pref_checkbox_new_int(subgroup, _("Use xvpics thumbnails when found (read only)"), |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
897 use_xvpics_thumbnails, &use_xvpics_thumbnails_c); |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
898 #endif |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
899 |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
900 pref_checkbox_new_int(group, _("Faster jpeg thumbnailing (may reduce quality)"), |
25335c62cd9b
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
901 thumbnail_fast, &thumbnail_fast_c); |
9 | 902 |
903 group = pref_group_new(vbox, FALSE, _("Slide show"), GTK_ORIENTATION_VERTICAL); | |
904 | |
905 slideshow_delay_c = slideshow_delay; | |
906 spin = pref_spin_new(group, _("Delay between image change:"), _("seconds"), | |
907 SLIDESHOW_MIN_SECONDS, SLIDESHOW_MAX_SECONDS, 1.0, 1, | |
908 slideshow_delay ? (double)slideshow_delay / SLIDESHOW_SUBSECOND_PRECISION : 10.0, | |
909 G_CALLBACK(slideshow_delay_cb), NULL); | |
910 gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS); | |
911 | |
912 pref_checkbox_new_int(group, _("Random"), slideshow_random, &slideshow_random_c); | |
913 pref_checkbox_new_int(group, _("Repeat"), slideshow_repeat, &slideshow_repeat_c); | |
914 | |
915 /* image tab */ | |
916 | |
917 vbox = gtk_vbox_new(FALSE, 0); | |
918 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | |
919 gtk_widget_show(vbox); | |
920 label = gtk_label_new(_("Image")); | |
921 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label); | |
922 | |
923 group = pref_group_new(vbox, FALSE, _("Zoom"), GTK_ORIENTATION_VERTICAL); | |
924 | |
925 #if 0 | |
926 add_dither_menu(dither_quality, &dither_quality_c, _("Dithering method:"), group); | |
927 #endif | |
928 table = pref_table_new(group, 2, 1, FALSE, FALSE); | |
929 add_quality_menu(table, 0, 0, _("Quality:"), zoom_quality, &zoom_quality_c); | |
930 | |
931 pref_checkbox_new_int(group, _("Two pass zooming"), | |
932 two_pass_zoom, &two_pass_zoom_c); | |
933 | |
67
f63ecca6c087
Fri Oct 13 05:22:43 2006 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
934 pref_checkbox_new_int(group, _("Allow enlargement of image for zoom to fit"), |
9 | 935 zoom_to_fit_expands, &zoom_to_fit_expands_c); |
936 | |
937 zoom_increment_c = zoom_increment; | |
938 spin = pref_spin_new(group, _("Zoom increment:"), NULL, | |
15
3263965d5f9e
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
14
diff
changeset
|
939 0.1, 4.0, 1.0, 1, (double)zoom_increment / 10.0, |
9 | 940 G_CALLBACK(zoom_increment_cb), NULL); |
941 gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS); | |
942 | |
943 group = pref_group_new(vbox, FALSE, _("When new image is selected:"), GTK_ORIENTATION_VERTICAL); | |
944 | |
945 zoom_mode_c = zoom_mode; | |
946 button = pref_radiobutton_new(group, NULL, _("Zoom to original size"), | |
947 (zoom_mode == ZOOM_RESET_ORIGINAL), | |
948 G_CALLBACK(zoom_mode_original_cb), NULL); | |
949 button = pref_radiobutton_new(group, button, _("Fit image to window"), | |
950 (zoom_mode == ZOOM_RESET_FIT_WINDOW), | |
951 G_CALLBACK(zoom_mode_fit_cb), NULL); | |
952 button = pref_radiobutton_new(group, button, _("Leave Zoom at previous setting"), | |
953 (zoom_mode == ZOOM_RESET_NONE), | |
954 G_CALLBACK(zoom_mode_none_cb), NULL); | |
955 | |
956 group = pref_group_new(vbox, FALSE, _("Appearance"), GTK_ORIENTATION_VERTICAL); | |
957 | |
958 pref_checkbox_new_int(group, _("Black background"), | |
959 black_window_background, &black_window_background_c); | |
960 | |
961 group = pref_group_new(vbox, FALSE, _("Convenience"), GTK_ORIENTATION_VERTICAL); | |
962 | |
963 pref_checkbox_new_int(group, _("Refresh on file change"), | |
964 update_on_time_change, &update_on_time_change_c); | |
965 pref_checkbox_new_int(group, _("Preload next image"), | |
966 enable_read_ahead, &enable_read_ahead_c); | |
967 pref_checkbox_new_int(group, _("Auto rotate image using Exif information"), | |
968 exif_rotate_enable, &exif_rotate_enable_c); | |
969 | |
970 | |
971 /* window tab */ | |
972 | |
973 vbox = gtk_vbox_new(FALSE, 0); | |
974 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | |
975 gtk_widget_show(vbox); | |
976 label = gtk_label_new(_("Windows")); | |
977 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, label); | |
978 | |
979 group = pref_group_new(vbox, FALSE, _("State"), GTK_ORIENTATION_VERTICAL); | |
980 | |
981 pref_checkbox_new_int(group, _("Remember window positions"), | |
982 save_window_positions, &save_window_positions_c); | |
983 pref_checkbox_new_int(group, _("Remember tool state (float/hidden)"), | |
984 restore_tool, &restore_tool_c); | |
985 | |
986 group = pref_group_new(vbox, FALSE, _("Size"), GTK_ORIENTATION_VERTICAL); | |
987 | |
988 pref_checkbox_new_int(group, _("Fit window to image when tools are hidden/floating"), | |
989 fit_window, &fit_window_c); | |
990 | |
991 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
992 ct_button = pref_checkbox_new_int(hbox, _("Limit size when auto-sizing window (%):"), | |
993 limit_window_size, &limit_window_size_c); | |
994 spin = pref_spin_new_int(hbox, NULL, NULL, | |
995 10, 150, 1, | |
996 max_window_size, &max_window_size_c); | |
997 pref_checkbox_link_sensitivity(ct_button, spin); | |
998 | |
999 group = pref_group_new(vbox, FALSE, _("Layout"), GTK_ORIENTATION_VERTICAL); | |
1000 | |
1001 layout_widget = layout_config_new(); | |
1002 layout_config_set(layout_widget, layout_style, layout_order); | |
1003 gtk_box_pack_start(GTK_BOX(group), layout_widget, FALSE, FALSE, 0); | |
1004 gtk_widget_show(layout_widget); | |
1005 | |
1006 | |
1007 /* filtering tab */ | |
1008 | |
1009 vbox = gtk_vbox_new(FALSE, 0); | |
1010 gtk_container_set_border_width(GTK_CONTAINER (vbox), PREF_PAD_BORDER); | |
1011 gtk_widget_show(vbox); | |
1012 label = gtk_label_new(_("Filtering")); | |
1013 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, label); | |
1014 | |
1015 group = pref_box_new(vbox, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | |
1016 | |
1017 pref_checkbox_new_int(group, _("Show entries that begin with a dot"), | |
1018 show_dot_files, &show_dot_files_c); | |
1019 pref_checkbox_new_int(group, _("Case sensitive sort"), | |
1020 file_sort_case_sensitive, &file_sort_case_sensitive_c); | |
1021 | |
1022 ct_button = pref_checkbox_new_int(group, _("Disable File Filtering"), | |
1023 file_filter_disable, &file_filter_disable_c); | |
1024 | |
1025 group = pref_group_new(vbox, TRUE, _("File types"), GTK_ORIENTATION_VERTICAL); | |
1026 | |
1027 frame = pref_group_parent(group); | |
1028 g_signal_connect(G_OBJECT(ct_button), "toggled", | |
1029 G_CALLBACK(filter_disable_cb), frame); | |
1030 gtk_widget_set_sensitive(frame, !file_filter_disable); | |
1031 | |
1032 scrolled = gtk_scrolled_window_new(NULL, NULL); | |
1033 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); | |
1034 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); | |
1035 gtk_box_pack_start(GTK_BOX(group), scrolled, TRUE, TRUE, 0); | |
1036 gtk_widget_show(scrolled); | |
1037 | |
1038 filter_store = gtk_list_store_new(1, G_TYPE_POINTER); | |
1039 filter_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(filter_store)); | |
1040 g_object_unref(filter_store); | |
1041 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(filter_view)); | |
1042 gtk_tree_selection_set_mode(GTK_TREE_SELECTION(selection), GTK_SELECTION_SINGLE); | |
1043 | |
1044 gtk_tree_view_set_enable_search(GTK_TREE_VIEW(filter_view), FALSE); | |
1045 | |
1046 column = gtk_tree_view_column_new(); | |
1047 gtk_tree_view_column_set_title(column, _("Filter")); | |
1048 gtk_tree_view_column_set_resizable(column, TRUE); | |
1049 | |
1050 renderer = gtk_cell_renderer_toggle_new(); | |
1051 g_signal_connect(G_OBJECT(renderer), "toggled", | |
1052 G_CALLBACK(filter_store_enable_cb), filter_store); | |
1053 gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
1054 gtk_tree_view_column_set_cell_data_func(column, renderer, filter_set_func, | |
1055 GINT_TO_POINTER(FE_ENABLE), NULL); | |
1056 | |
1057 renderer = gtk_cell_renderer_text_new(); | |
1058 g_signal_connect(G_OBJECT(renderer), "edited", | |
1059 G_CALLBACK(filter_store_ext_edit_cb), filter_store); | |
1060 gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
1061 g_object_set(G_OBJECT(renderer), "editable", (gboolean)TRUE, NULL); | |
1062 gtk_tree_view_column_set_cell_data_func(column, renderer, filter_set_func, | |
1063 GINT_TO_POINTER(FE_EXTENSION), NULL); | |
1064 gtk_tree_view_append_column(GTK_TREE_VIEW(filter_view), column); | |
1065 | |
1066 column = gtk_tree_view_column_new(); | |
1067 gtk_tree_view_column_set_title(column, _("Description")); | |
1068 gtk_tree_view_column_set_resizable(column, TRUE); | |
1069 renderer = gtk_cell_renderer_text_new(); | |
1070 g_signal_connect(G_OBJECT(renderer), "edited", | |
1071 G_CALLBACK(filter_store_desc_edit_cb), filter_store); | |
1072 g_object_set(G_OBJECT(renderer), "editable", (gboolean)TRUE, NULL); | |
1073 gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
1074 gtk_tree_view_column_set_cell_data_func(column, renderer, filter_set_func, | |
1075 GINT_TO_POINTER(FE_DESCRIPTION), NULL); | |
1076 gtk_tree_view_append_column(GTK_TREE_VIEW(filter_view), column); | |
1077 | |
1078 filter_store_populate(); | |
1079 gtk_container_add(GTK_CONTAINER(scrolled), filter_view); | |
1080 gtk_widget_show(filter_view); | |
1081 | |
1082 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); | |
1083 | |
1084 button = pref_button_new(NULL, NULL, _("Defaults"), FALSE, | |
1085 G_CALLBACK(filter_default_cb), NULL); | |
1086 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1087 gtk_widget_show(button); | |
1088 | |
1089 button = pref_button_new(NULL, GTK_STOCK_REMOVE, NULL, FALSE, | |
1090 G_CALLBACK(filter_remove_cb), filter_view); | |
1091 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1092 gtk_widget_show(button); | |
1093 | |
1094 button = pref_button_new(NULL, GTK_STOCK_ADD, NULL, FALSE, | |
1095 G_CALLBACK(filter_add_cb), NULL); | |
1096 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1097 gtk_widget_show(button); | |
1098 | |
1099 | |
1100 /* editor entry tab */ | |
1101 | |
1102 vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP); | |
1103 gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); | |
1104 gtk_widget_show(vbox); | |
1105 label = gtk_label_new(_("Editors")); | |
1106 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, label); | |
1107 | |
1108 table = pref_table_new(vbox, 3, 9, FALSE, FALSE); | |
1109 gtk_table_set_col_spacings(GTK_TABLE(table), PREF_PAD_GAP); | |
1110 | |
1111 label = pref_table_label(table, 0, 0, _("#"), 1.0); | |
1112 pref_label_bold(label, TRUE, FALSE); | |
1113 | |
1114 label = pref_table_label(table, 1, 0, _("Menu name"), 0.0); | |
1115 pref_label_bold(label, TRUE, FALSE); | |
1116 | |
67
f63ecca6c087
Fri Oct 13 05:22:43 2006 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
1117 label = pref_table_label(table, 2, 0, _("Command Line"), 0.0); |
9 | 1118 pref_label_bold(label, TRUE, FALSE); |
1119 | |
1120 for (i = 0; i < GQVIEW_EDITOR_SLOTS; i++) | |
1121 { | |
1122 gchar *buf; | |
1123 | |
1124 | |
134
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1125 if (i < GQVIEW_EDITOR_GENERIC_SLOTS) |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1126 { |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1127 buf = g_strdup_printf("%d", i+1); |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1128 pref_table_label(table, 0, i+1, buf, 1.0); |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1129 g_free(buf); |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1130 editor_name_entry[i] = gtk_entry_new(); |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1131 gtk_entry_set_max_length(GTK_ENTRY(editor_name_entry[i]), EDITOR_NAME_MAX_LENGTH); |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1132 gtk_widget_set_size_request(editor_name_entry[i],80,-1); |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1133 if (editor_name[i]) gtk_entry_set_text(GTK_ENTRY(editor_name_entry[i]),editor_name[i]); |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1134 } |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1135 else |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1136 { |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1137 editor_name_entry[i] = gtk_label_new(editor_name[i]); |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1138 } |
9009856628f7
started implementation of external commands; external Delete should work
nadvornik
parents:
113
diff
changeset
|
1139 |
9 | 1140 gtk_table_attach(GTK_TABLE (table),editor_name_entry[i],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
|
1141 GTK_FILL | GTK_EXPAND, 0, 0, 0); |
9 | 1142 gtk_widget_show(editor_name_entry[i]); |
1143 | |
1144 editor_command_entry[i] = gtk_entry_new(); | |
1145 gtk_entry_set_max_length(GTK_ENTRY(editor_command_entry[i]), EDITOR_COMMAND_MAX_LENGTH); | |
1146 gtk_widget_set_size_request(editor_command_entry[i],160,-1); | |
1147 tab_completion_add_to_entry(editor_command_entry[i], NULL, NULL); | |
1148 if (editor_command[i]) gtk_entry_set_text(GTK_ENTRY(editor_command_entry[i]), editor_command[i]); | |
1149 gtk_table_attach(GTK_TABLE (table),editor_command_entry[i],2,3,i+1,i+2, | |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1150 GTK_FILL | GTK_EXPAND, 0, 0, 0); |
9 | 1151 gtk_widget_show(editor_command_entry[i]); |
1152 } | |
1153 | |
1154 hbox = pref_box_new(vbox, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); | |
1155 | |
1156 button = pref_button_new(NULL, NULL, _("Defaults"), FALSE, | |
1157 G_CALLBACK(editor_default_cb), NULL); | |
1158 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1159 gtk_widget_show(button); | |
1160 | |
1161 button = pref_button_new(NULL, GTK_STOCK_HELP, NULL, FALSE, | |
1162 G_CALLBACK(editor_help_cb), NULL); | |
1163 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1164 gtk_widget_show(button); | |
1165 | |
1166 /* advanced entry tab */ | |
1167 | |
1168 scrolled = gtk_scrolled_window_new(NULL, NULL); | |
1169 gtk_container_set_border_width(GTK_CONTAINER(scrolled), PREF_PAD_BORDER); | |
1170 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), | |
1171 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
1172 label = gtk_label_new(_("Advanced")); | |
1173 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scrolled, label); | |
1174 gtk_widget_show(scrolled); | |
1175 | |
1176 viewport = gtk_viewport_new(NULL, NULL); | |
1177 gtk_viewport_set_shadow_type(GTK_VIEWPORT(viewport), GTK_SHADOW_NONE); | |
1178 gtk_container_add(GTK_CONTAINER(scrolled), viewport); | |
1179 gtk_widget_show(viewport); | |
1180 | |
1181 vbox = gtk_vbox_new(FALSE, 0); | |
1182 gtk_container_add(GTK_CONTAINER(viewport), vbox); | |
1183 gtk_widget_show(vbox); | |
1184 | |
1185 group = pref_group_new(vbox, FALSE, _("Full screen"), GTK_ORIENTATION_VERTICAL); | |
1186 | |
1187 fullscreen_screen_c = fullscreen_screen; | |
1188 fullscreen_above_c = fullscreen_above; | |
1189 hbox = fullscreen_prefs_selection_new(_("Location:"), &fullscreen_screen_c, &fullscreen_above_c); | |
1190 gtk_box_pack_start(GTK_BOX(group), hbox, FALSE, FALSE, 0); | |
1191 gtk_widget_show(hbox); | |
1192 | |
1193 pref_checkbox_new_int(group, _("Smooth image flip"), | |
1194 fullscreen_clean_flip, &fullscreen_clean_flip_c); | |
1195 pref_checkbox_new_int(group, _("Disable screen saver"), | |
1196 fullscreen_disable_saver, &fullscreen_disable_saver_c); | |
1197 | |
1198 group = pref_group_new(vbox, FALSE, _("Delete"), GTK_ORIENTATION_VERTICAL); | |
1199 | |
1200 pref_checkbox_new_int(group, _("Confirm file delete"), | |
1201 confirm_delete, &confirm_delete_c); | |
1202 pref_checkbox_new_int(group, _("Enable Delete key"), | |
1203 enable_delete_key, &enable_delete_key_c); | |
1204 | |
1205 ct_button = pref_checkbox_new_int(group, _("Safe delete"), | |
1206 safe_delete_enable, &safe_delete_enable_c); | |
1207 | |
1208 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
1209 pref_checkbox_link_sensitivity(ct_button, hbox); | |
1210 | |
1211 pref_spacer(hbox, PREF_PAD_INDENT - PREF_PAD_SPACE); | |
1212 pref_label_new(hbox, _("Folder:")); | |
1213 | |
1214 tabcomp = tab_completion_new(&safe_delete_path_entry, safe_delete_path, NULL, NULL); | |
1215 tab_completion_add_select_button(safe_delete_path_entry, NULL, TRUE); | |
1216 gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0); | |
1217 gtk_widget_show(tabcomp); | |
1218 | |
1219 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); | |
1220 pref_checkbox_link_sensitivity(ct_button, hbox); | |
1221 | |
1222 pref_spacer(hbox, PREF_PAD_INDENT - PREF_PAD_GAP); | |
1223 pref_spin_new_int(hbox, _("Maximum size:"), _("MB"), | |
1224 1, 500, 1, safe_delete_size, &safe_delete_size_c); | |
1225 | |
1226 button = pref_button_new(NULL, NULL, _("View"), FALSE, | |
1227 G_CALLBACK(safe_delete_view_cb), NULL); | |
1228 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1229 gtk_widget_show(button); | |
1230 | |
1231 button = pref_button_new(NULL, GTK_STOCK_CLEAR, NULL, FALSE, | |
1232 G_CALLBACK(safe_delete_clear_cb), NULL); | |
1233 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1234 gtk_widget_show(button); | |
1235 | |
1236 group = pref_group_new(vbox, FALSE, _("Behavior"), GTK_ORIENTATION_VERTICAL); | |
1237 | |
1238 pref_checkbox_new_int(group, _("Rectangular selection in icon view"), | |
1239 collection_rectangular_selection, &collection_rectangular_selection_c); | |
1240 | |
1241 pref_checkbox_new_int(group, _("Descend folders in tree view"), | |
1242 tree_descend_subdirs, &tree_descend_subdirs_c); | |
1243 | |
1244 pref_checkbox_new_int(group, _("In place renaming"), | |
1245 enable_in_place_rename, &enable_in_place_rename_c); | |
1246 | |
1247 group = pref_group_new(vbox, FALSE, _("Navigation"), GTK_ORIENTATION_VERTICAL); | |
1248 | |
1249 pref_checkbox_new_int(group, _("Progressive keyboard scrolling"), | |
1250 progressive_key_scrolling, &progressive_key_scrolling_c); | |
1251 pref_checkbox_new_int(group, _("Mouse wheel scrolls image"), | |
1252 mousewheel_scrolls, &mousewheel_scrolls_c); | |
1253 | |
1254 group = pref_group_new(vbox, FALSE, _("Miscellaneous"), GTK_ORIENTATION_VERTICAL); | |
1255 | |
1256 pref_checkbox_new_int(group, _("Store keywords and comments local to source images"), | |
1257 enable_metadata_dirs, &enable_metadata_dirs_c); | |
1258 | |
1259 pref_spin_new_int(group, _("Custom similarity threshold:"), NULL, | |
1260 0, 100, 1, dupe_custom_threshold, &dupe_custom_threshold_c); | |
1261 | |
1262 pref_spin_new_int(group, _("Offscreen cache size (Mb per image):"), NULL, | |
1263 0, 128, 1, tile_cache_max, &tile_cache_max_c); | |
1264 | |
113
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1265 group = pref_group_new(vbox, FALSE, _("Color profiles"), GTK_ORIENTATION_VERTICAL); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1266 #ifndef HAVE_LCMS |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1267 gtk_widget_set_sensitive(pref_group_parent(group), FALSE); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1268 #endif |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1269 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1270 table = pref_table_new(group, 3, COLOR_PROFILE_INPUTS + 2, FALSE, FALSE); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1271 gtk_table_set_col_spacings(GTK_TABLE(table), PREF_PAD_GAP); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1272 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1273 label = pref_table_label(table, 0, 0, _("Type"), 0.0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1274 pref_label_bold(label, TRUE, FALSE); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1275 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1276 label = pref_table_label(table, 1, 0, _("Menu name"), 0.0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1277 pref_label_bold(label, TRUE, FALSE); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1278 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1279 label = pref_table_label(table, 2, 0, _("File"), 0.0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1280 pref_label_bold(label, TRUE, FALSE); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1281 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1282 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
|
1283 { |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1284 GtkWidget *entry; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1285 gchar *buf; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1286 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1287 buf = g_strdup_printf("Input %d:", i + 1); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1288 pref_table_label(table, 0, i + 1, buf, 1.0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1289 g_free(buf); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1290 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1291 entry = gtk_entry_new(); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1292 gtk_entry_set_max_length(GTK_ENTRY(entry), EDITOR_NAME_MAX_LENGTH); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1293 gtk_widget_set_size_request(editor_name_entry[i], 30, -1); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1294 if (color_profile_input_name[i]) gtk_entry_set_text(GTK_ENTRY(entry), color_profile_input_name[i]); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1295 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, i + 1, i + 2, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1296 GTK_FILL | GTK_EXPAND, 0, 0, 0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1297 gtk_widget_show(entry); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1298 color_profile_input_name_entry[i] = entry; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1299 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1300 tabcomp = tab_completion_new(&entry, color_profile_input_file[i], NULL, NULL); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1301 tab_completion_add_select_button(entry, _("Select color profile"), FALSE); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1302 gtk_widget_set_size_request(entry, 160, -1); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1303 gtk_table_attach(GTK_TABLE(table), tabcomp, 2, 3, i + 1, i + 2, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1304 GTK_FILL | GTK_EXPAND, 0, 0, 0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1305 gtk_widget_show(tabcomp); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1306 color_profile_input_file_entry[i] = entry; |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1307 } |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1308 |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1309 pref_table_label(table, 0, COLOR_PROFILE_INPUTS + 1, _("Screen:"), 1.0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1310 tabcomp = tab_completion_new(&color_profile_screen_file_entry, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1311 color_profile_screen_file, NULL, NULL); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1312 tab_completion_add_select_button(color_profile_screen_file_entry, _("Select color profile"), FALSE); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1313 gtk_widget_set_size_request(color_profile_screen_file_entry, 160, -1); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1314 gtk_table_attach(GTK_TABLE(table), tabcomp, 2, 3, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1315 COLOR_PROFILE_INPUTS + 1, COLOR_PROFILE_INPUTS + 2, |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1316 GTK_FILL | GTK_EXPAND, 0, 0, 0); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1317 gtk_widget_show(tabcomp); |
55166d93498d
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
91
diff
changeset
|
1318 |
9 | 1319 gtk_widget_show(notebook); |
1320 | |
1321 gtk_widget_show(configwindow); | |
1322 } | |
1323 | |
1324 /* | |
1325 *----------------------------------------------------------------------------- | |
1326 * config window show (public) | |
1327 *----------------------------------------------------------------------------- | |
1328 */ | |
1329 | |
1330 void show_config_window(void) | |
1331 { | |
1332 if (configwindow) | |
1333 { | |
1334 gtk_window_present(GTK_WINDOW(configwindow)); | |
1335 return; | |
1336 } | |
1337 | |
1338 config_window_create(); | |
1339 } | |
1340 | |
1341 /* | |
1342 *----------------- | |
1343 * about window | |
1344 *----------------- | |
1345 */ | |
1346 | |
1347 static GtkWidget *about = NULL; | |
1348 | |
1349 static gint about_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data) | |
1350 { | |
1351 gtk_widget_destroy(about); | |
1352 about = NULL; | |
1353 | |
1354 return TRUE; | |
1355 } | |
1356 | |
1357 static void about_window_close(GtkWidget *widget, gpointer data) | |
1358 { | |
1359 if (!about) return; | |
1360 | |
1361 gtk_widget_destroy(about); | |
1362 about = NULL; | |
1363 } | |
1364 | |
1365 static void about_credits_cb(GtkWidget *widget, gpointer data) | |
1366 { | |
1367 help_window_show("credits"); | |
1368 } | |
1369 | |
1370 void show_about_window(void) | |
1371 { | |
1372 GtkWidget *vbox; | |
1373 GtkWidget *hbox; | |
1374 GtkWidget *label; | |
1375 GtkWidget *button; | |
1376 GdkPixbuf *pixbuf; | |
1377 | |
1378 gchar *buf; | |
1379 | |
1380 if (about) | |
1381 { | |
1382 gtk_window_present(GTK_WINDOW(about)); | |
1383 return; | |
1384 } | |
1385 | |
1386 about = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
1387 gtk_window_set_type_hint(GTK_WINDOW(about), GDK_WINDOW_TYPE_HINT_DIALOG); | |
1388 gtk_window_set_wmclass(GTK_WINDOW(about), "about", "GQview"); | |
1389 g_signal_connect(G_OBJECT(about), "delete_event", | |
1390 G_CALLBACK(about_delete_cb), NULL); | |
1391 | |
1392 gtk_window_set_title(GTK_WINDOW(about), _("About - GQview")); | |
1393 gtk_container_set_border_width(GTK_CONTAINER(about), PREF_PAD_BORDER); | |
1394 | |
1395 vbox = gtk_vbox_new(FALSE, PREF_PAD_SPACE); | |
1396 gtk_container_add(GTK_CONTAINER(about), vbox); | |
1397 gtk_widget_show(vbox); | |
1398 | |
1399 pixbuf = pixbuf_inline(PIXBUF_INLINE_LOGO); | |
1400 button = gtk_image_new_from_pixbuf(pixbuf); | |
1401 g_object_unref(pixbuf); | |
1402 gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, 0); | |
1403 gtk_widget_show(button); | |
1404 | |
1405 buf = g_strdup_printf(_("GQview %s\n\nCopyright (c) %s John Ellis\nwebsite: %s\nemail: %s\n\nReleased under the GNU General Public License"), | |
1406 VERSION, | |
67
f63ecca6c087
Fri Oct 13 05:22:43 2006 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
1407 "2006", |
9 | 1408 "gqview.sourceforge.net", |
1409 "gqview@users.sourceforge.net"); | |
1410 label = gtk_label_new(buf); | |
1411 g_free(buf); | |
1412 | |
1413 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER); | |
1414 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0); | |
1415 gtk_widget_show(label); | |
1416 | |
1417 hbox = gtk_hbutton_box_new(); | |
1418 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_END); | |
1419 gtk_box_set_spacing(GTK_BOX(hbox), PREF_PAD_BUTTON_GAP); | |
1420 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
1421 gtk_widget_show(hbox); | |
1422 | |
1423 button = pref_button_new(NULL, NULL, _("Credits..."), FALSE, | |
1424 G_CALLBACK(about_credits_cb), NULL); | |
1425 gtk_container_add(GTK_CONTAINER(hbox), button); | |
1426 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
1427 gtk_widget_show(button); | |
1428 | |
1429 button = pref_button_new(NULL, GTK_STOCK_CLOSE, NULL, FALSE, | |
1430 G_CALLBACK(about_window_close), NULL); | |
1431 gtk_container_add(GTK_CONTAINER(hbox), button); | |
1432 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
1433 gtk_widget_grab_default(button); | |
1434 gtk_widget_show(button); | |
1435 | |
1436 window_set_icon(about, NULL, NULL); | |
1437 gtk_widget_show(about); | |
1438 } | |
1439 |