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