Mercurial > hg > forks > geeqie
comparison src/preferences.c @ 2221:59b559f747a7 ke-lua
Merge branch 'master' into ke-lua
* master: (185 commits)
better fix for big-endian architectures
Minor indentation fixes.
Cleanup checker shader code.
Fix exif orientation in clutter rendering mode.
Silent 2 warnings using explicit type casting.
Polish translation was updated, thanks to Grzegorz Gibas.
Update pt_BR translation.
Add *~, *.rej, *.orig files to git ignore list.
Fix for support >=automake-1.11.4
Trim trailing white spaces on empty lines.
Trim trailing white spaces.
Add missing vim modeline.
Fix indentation and few trailing white spaces.
Clear few more warnings, unused variables mostly.
Drop unused variable.
Remove commented out code.
Remove commented out code.
Remove commented out code.
Remove commented out code.
Remove commented out code.
...
author | Klaus Ethgen <Klaus@Ethgen.de> |
---|---|
date | Tue, 02 Oct 2012 22:19:13 +0100 |
parents | 6e91033c7fb3 c14a1d8e6aa4 |
children | c67b4f60c4b1 |
comparison
equal
deleted
inserted
replaced
2220:fea4dd5c4359 | 2221:59b559f747a7 |
---|---|
1 /* | 1 /* |
2 * Geeqie | 2 * Geeqie |
3 * (C) 2006 John Ellis | 3 * (C) 2006 John Ellis |
4 * Copyright (C) 2008 - 2010 The Geeqie Team | 4 * Copyright (C) 2008 - 2012 The Geeqie Team |
5 * | 5 * |
6 * Author: John Ellis | 6 * Author: John Ellis |
7 * | 7 * |
8 * This software is released under the GNU General Public License (GNU GPL). | 8 * This software is released under the GNU General Public License (GNU GPL). |
9 * Please read the included file COPYING for more information. | 9 * Please read the included file COPYING for more information. |
123 *----------------------------------------------------------------------------- | 123 *----------------------------------------------------------------------------- |
124 */ | 124 */ |
125 | 125 |
126 static void zoom_mode_cb(GtkWidget *widget, gpointer data) | 126 static void zoom_mode_cb(GtkWidget *widget, gpointer data) |
127 { | 127 { |
128 if (GTK_TOGGLE_BUTTON (widget)->active) | 128 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) |
129 c_options->image.zoom_mode = GPOINTER_TO_INT(data); | 129 c_options->image.zoom_mode = GPOINTER_TO_INT(data); |
130 } | 130 } |
131 | 131 |
132 static void scroll_reset_cb(GtkWidget *widget, gpointer data) | 132 static void scroll_reset_cb(GtkWidget *widget, gpointer data) |
133 { | 133 { |
134 if (GTK_TOGGLE_BUTTON (widget)->active) | 134 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) |
135 c_options->image.scroll_reset_method = GPOINTER_TO_INT(data); | 135 c_options->image.scroll_reset_method = GPOINTER_TO_INT(data); |
136 } | 136 } |
137 | 137 |
138 static void zoom_increment_cb(GtkWidget *spin, gpointer data) | 138 static void zoom_increment_cb(GtkWidget *spin, gpointer data) |
139 { | 139 { |
172 static gboolean accel_apply_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) | 172 static gboolean accel_apply_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
173 { | 173 { |
174 gchar *accel_path, *accel; | 174 gchar *accel_path, *accel; |
175 | 175 |
176 gtk_tree_model_get(model, iter, AE_ACCEL, &accel_path, AE_KEY, &accel, -1); | 176 gtk_tree_model_get(model, iter, AE_ACCEL, &accel_path, AE_KEY, &accel, -1); |
177 | 177 |
178 if (accel_path && accel_path[0]) | 178 if (accel_path && accel_path[0]) |
179 { | 179 { |
180 GtkAccelKey key; | 180 GtkAccelKey key; |
181 gtk_accelerator_parse(accel, &key.accel_key, &key.accel_mods); | 181 gtk_accelerator_parse(accel, &key.accel_key, &key.accel_mods); |
182 gtk_accel_map_change_entry(accel_path, key.accel_key, key.accel_mods, TRUE); | 182 gtk_accel_map_change_entry(accel_path, key.accel_key, key.accel_mods, TRUE); |
183 } | 183 } |
184 | 184 |
185 g_free(accel_path); | 185 g_free(accel_path); |
186 g_free(accel); | 186 g_free(accel); |
187 | 187 |
188 return FALSE; | 188 return FALSE; |
189 } | 189 } |
193 { | 193 { |
194 gint i; | 194 gint i; |
195 gboolean refresh = FALSE; | 195 gboolean refresh = FALSE; |
196 | 196 |
197 config_entry_to_option(safe_delete_path_entry, &options->file_ops.safe_delete_path, remove_trailing_slash); | 197 config_entry_to_option(safe_delete_path_entry, &options->file_ops.safe_delete_path, remove_trailing_slash); |
198 | 198 |
199 if (options->file_filter.show_hidden_files != c_options->file_filter.show_hidden_files) refresh = TRUE; | 199 if (options->file_filter.show_hidden_files != c_options->file_filter.show_hidden_files) refresh = TRUE; |
200 if (options->file_filter.show_dot_directory != c_options->file_filter.show_dot_directory) refresh = TRUE; | 200 if (options->file_filter.show_dot_directory != c_options->file_filter.show_dot_directory) refresh = TRUE; |
201 if (options->file_sort.case_sensitive != c_options->file_sort.case_sensitive) refresh = TRUE; | 201 if (options->file_sort.case_sensitive != c_options->file_sort.case_sensitive) refresh = TRUE; |
202 if (options->file_filter.disable != c_options->file_filter.disable) refresh = TRUE; | 202 if (options->file_filter.disable != c_options->file_filter.disable) refresh = TRUE; |
203 | 203 |
214 options->image.limit_window_size = c_options->image.limit_window_size; | 214 options->image.limit_window_size = c_options->image.limit_window_size; |
215 options->image.zoom_to_fit_allow_expand = c_options->image.zoom_to_fit_allow_expand; | 215 options->image.zoom_to_fit_allow_expand = c_options->image.zoom_to_fit_allow_expand; |
216 options->image.max_window_size = c_options->image.max_window_size; | 216 options->image.max_window_size = c_options->image.max_window_size; |
217 options->image.limit_autofit_size = c_options->image.limit_autofit_size; | 217 options->image.limit_autofit_size = c_options->image.limit_autofit_size; |
218 options->image.max_autofit_size = c_options->image.max_autofit_size; | 218 options->image.max_autofit_size = c_options->image.max_autofit_size; |
219 options->image.use_clutter_renderer = c_options->image.use_clutter_renderer; | |
219 options->progressive_key_scrolling = c_options->progressive_key_scrolling; | 220 options->progressive_key_scrolling = c_options->progressive_key_scrolling; |
220 if (options->thumbnails.max_width != c_options->thumbnails.max_width | 221 if (options->thumbnails.max_width != c_options->thumbnails.max_width |
221 || options->thumbnails.max_height != c_options->thumbnails.max_height | 222 || options->thumbnails.max_height != c_options->thumbnails.max_height |
222 || options->thumbnails.quality != c_options->thumbnails.quality) | 223 || options->thumbnails.quality != c_options->thumbnails.quality) |
223 { | 224 { |
228 options->thumbnails.quality = c_options->thumbnails.quality; | 229 options->thumbnails.quality = c_options->thumbnails.quality; |
229 } | 230 } |
230 options->thumbnails.enable_caching = c_options->thumbnails.enable_caching; | 231 options->thumbnails.enable_caching = c_options->thumbnails.enable_caching; |
231 options->thumbnails.cache_into_dirs = c_options->thumbnails.cache_into_dirs; | 232 options->thumbnails.cache_into_dirs = c_options->thumbnails.cache_into_dirs; |
232 options->thumbnails.use_exif = c_options->thumbnails.use_exif; | 233 options->thumbnails.use_exif = c_options->thumbnails.use_exif; |
233 #if 0 | |
234 options->thumbnails.use_xvpics = c_options->thumbnails.use_xvpics; | |
235 #endif | |
236 options->thumbnails.spec_standard = c_options->thumbnails.spec_standard; | 234 options->thumbnails.spec_standard = c_options->thumbnails.spec_standard; |
237 options->metadata.enable_metadata_dirs = c_options->metadata.enable_metadata_dirs; | 235 options->metadata.enable_metadata_dirs = c_options->metadata.enable_metadata_dirs; |
238 options->file_filter.show_hidden_files = c_options->file_filter.show_hidden_files; | 236 options->file_filter.show_hidden_files = c_options->file_filter.show_hidden_files; |
239 options->file_filter.show_dot_directory = c_options->file_filter.show_dot_directory; | 237 options->file_filter.show_dot_directory = c_options->file_filter.show_dot_directory; |
240 | 238 |
261 | 259 |
262 options->image.zoom_increment = c_options->image.zoom_increment; | 260 options->image.zoom_increment = c_options->image.zoom_increment; |
263 | 261 |
264 options->image.enable_read_ahead = c_options->image.enable_read_ahead; | 262 options->image.enable_read_ahead = c_options->image.enable_read_ahead; |
265 | 263 |
266 | 264 |
267 if (options->image.use_custom_border_color != c_options->image.use_custom_border_color | 265 if (options->image.use_custom_border_color != c_options->image.use_custom_border_color |
268 || options->image.use_custom_border_color_in_fullscreen != c_options->image.use_custom_border_color_in_fullscreen | 266 || options->image.use_custom_border_color_in_fullscreen != c_options->image.use_custom_border_color_in_fullscreen |
269 || !gdk_color_equal(&options->image.border_color, &c_options->image.border_color)) | 267 || !gdk_color_equal(&options->image.border_color, &c_options->image.border_color)) |
270 { | 268 { |
271 options->image.use_custom_border_color_in_fullscreen = c_options->image.use_custom_border_color_in_fullscreen; | 269 options->image.use_custom_border_color_in_fullscreen = c_options->image.use_custom_border_color_in_fullscreen; |
280 options->fullscreen.disable_saver = c_options->fullscreen.disable_saver; | 278 options->fullscreen.disable_saver = c_options->fullscreen.disable_saver; |
281 options->fullscreen.above = c_options->fullscreen.above; | 279 options->fullscreen.above = c_options->fullscreen.above; |
282 if (c_options->image_overlay.template_string) | 280 if (c_options->image_overlay.template_string) |
283 set_image_overlay_template_string(&options->image_overlay.template_string, | 281 set_image_overlay_template_string(&options->image_overlay.template_string, |
284 c_options->image_overlay.template_string); | 282 c_options->image_overlay.template_string); |
285 | 283 |
286 options->update_on_time_change = c_options->update_on_time_change; | 284 options->update_on_time_change = c_options->update_on_time_change; |
287 options->image.exif_rotate_enable = c_options->image.exif_rotate_enable; | 285 options->image.exif_rotate_enable = c_options->image.exif_rotate_enable; |
288 options->image.exif_proof_rotate_enable = c_options->image.exif_proof_rotate_enable; | 286 options->image.exif_proof_rotate_enable = c_options->image.exif_proof_rotate_enable; |
289 | 287 |
290 options->duplicates_similarity_threshold = c_options->duplicates_similarity_threshold; | 288 options->duplicates_similarity_threshold = c_options->duplicates_similarity_threshold; |
291 | 289 |
292 options->tree_descend_subdirs = c_options->tree_descend_subdirs; | 290 options->tree_descend_subdirs = c_options->tree_descend_subdirs; |
293 | 291 |
294 options->open_recent_list_maxsize = c_options->open_recent_list_maxsize; | 292 options->open_recent_list_maxsize = c_options->open_recent_list_maxsize; |
295 options->dnd_icon_size = c_options->dnd_icon_size; | 293 options->dnd_icon_size = c_options->dnd_icon_size; |
296 | 294 |
297 options->metadata.save_in_image_file = c_options->metadata.save_in_image_file; | 295 options->metadata.save_in_image_file = c_options->metadata.save_in_image_file; |
298 options->metadata.save_legacy_IPTC = c_options->metadata.save_legacy_IPTC; | 296 options->metadata.save_legacy_IPTC = c_options->metadata.save_legacy_IPTC; |
299 options->metadata.warn_on_write_problems = c_options->metadata.warn_on_write_problems; | 297 options->metadata.warn_on_write_problems = c_options->metadata.warn_on_write_problems; |
300 options->metadata.save_legacy_format = c_options->metadata.save_legacy_format; | 298 options->metadata.save_legacy_format = c_options->metadata.save_legacy_format; |
301 options->metadata.sync_grouped_files = c_options->metadata.sync_grouped_files; | 299 options->metadata.sync_grouped_files = c_options->metadata.sync_grouped_files; |
340 } | 338 } |
341 config_entry_to_option(color_profile_screen_file_entry, &options->color_profile.screen_file, NULL); | 339 config_entry_to_option(color_profile_screen_file_entry, &options->color_profile.screen_file, NULL); |
342 options->color_profile.use_x11_screen_profile = c_options->color_profile.use_x11_screen_profile; | 340 options->color_profile.use_x11_screen_profile = c_options->color_profile.use_x11_screen_profile; |
343 #endif | 341 #endif |
344 | 342 |
345 #if 0 | |
346 for (i = 0; ExifUIList[i].key; i++) | |
347 { | |
348 ExifUIList[i].current = ExifUIList[i].temp; | |
349 } | |
350 | |
351 #endif | |
352 image_options_sync(); | 343 image_options_sync(); |
353 | 344 |
354 if (refresh) | 345 if (refresh) |
355 { | 346 { |
356 filter_rebuild(); | 347 filter_rebuild(); |
357 layout_refresh(NULL); | 348 layout_refresh(NULL); |
358 } | 349 } |
359 | 350 |
360 if (accel_store) gtk_tree_model_foreach(GTK_TREE_MODEL(accel_store), accel_apply_cb, NULL); | 351 if (accel_store) gtk_tree_model_foreach(GTK_TREE_MODEL(accel_store), accel_apply_cb, NULL); |
361 } | 352 } |
362 | 353 |
363 /* | 354 /* |
364 *----------------------------------------------------------------------------- | 355 *----------------------------------------------------------------------------- |
432 | 423 |
433 *option_c = option; | 424 *option_c = option; |
434 | 425 |
435 pref_table_label(table, column, row, text, 0.0); | 426 pref_table_label(table, column, row, text, 0.0); |
436 | 427 |
437 combo = gtk_combo_box_new_text(); | 428 combo = gtk_combo_box_text_new(); |
438 | 429 |
439 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Nearest (worst, but fastest)")); | 430 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Nearest (worst, but fastest)")); |
440 if (option == GDK_INTERP_NEAREST) current = 0; | 431 if (option == GDK_INTERP_NEAREST) current = 0; |
441 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Tiles")); | 432 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Tiles")); |
442 if (option == GDK_INTERP_TILES) current = 1; | 433 if (option == GDK_INTERP_TILES) current = 1; |
443 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Bilinear")); | 434 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Bilinear")); |
444 if (option == GDK_INTERP_BILINEAR) current = 2; | 435 if (option == GDK_INTERP_BILINEAR) current = 2; |
445 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Hyper (best, but slowest)")); | 436 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Hyper (best, but slowest)")); |
446 if (option == GDK_INTERP_HYPER) current = 3; | 437 if (option == GDK_INTERP_HYPER) current = 3; |
447 | 438 |
448 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current); | 439 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current); |
449 | 440 |
450 g_signal_connect(G_OBJECT(combo), "changed", | 441 g_signal_connect(G_OBJECT(combo), "changed", |
453 gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, | 444 gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, |
454 GTK_EXPAND | GTK_FILL, 0, 0, 0); | 445 GTK_EXPAND | GTK_FILL, 0, 0, 0); |
455 gtk_widget_show(combo); | 446 gtk_widget_show(combo); |
456 } | 447 } |
457 | 448 |
458 #if 0 | |
459 static void add_dither_menu(gint option, gint *option_c, gchar *text, GtkWidget *box) | |
460 { | |
461 GtkWidget *hbox; | |
462 GtkWidget *omenu; | |
463 GtkWidget *menu; | |
464 | |
465 *option_c = option; | |
466 | |
467 hbox = pref_box_new(box, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | |
468 pref_label_new(hbox, text); | |
469 | |
470 omenu = gtk_option_menu_new(); | |
471 menu = gtk_menu_new(); | |
472 | |
473 add_menu_item(menu, _("None"), option_c, (gint)GDK_RGB_DITHER_NONE); | |
474 add_menu_item(menu, _("Normal"), option_c, (gint)GDK_RGB_DITHER_NORMAL); | |
475 add_menu_item(menu, _("Best"), option_c, (gint)GDK_RGB_DITHER_MAX); | |
476 | |
477 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
478 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), *option_c); | |
479 | |
480 gtk_box_pack_start(GTK_BOX(hbox), omenu, FALSE, FALSE, 0); | |
481 gtk_widget_show(omenu); | |
482 } | |
483 #endif | |
484 | |
485 static void thumb_size_menu_cb(GtkWidget *combo, gpointer data) | 449 static void thumb_size_menu_cb(GtkWidget *combo, gpointer data) |
486 { | 450 { |
487 gint n; | 451 gint n; |
488 | 452 |
489 n = gtk_combo_box_get_active(GTK_COMBO_BOX(combo)); | 453 n = gtk_combo_box_get_active(GTK_COMBO_BOX(combo)); |
510 c_options->thumbnails.max_width = options->thumbnails.max_width; | 474 c_options->thumbnails.max_width = options->thumbnails.max_width; |
511 c_options->thumbnails.max_height = options->thumbnails.max_height; | 475 c_options->thumbnails.max_height = options->thumbnails.max_height; |
512 | 476 |
513 pref_table_label(table, column, row, text, 0.0); | 477 pref_table_label(table, column, row, text, 0.0); |
514 | 478 |
515 combo = gtk_combo_box_new_text(); | 479 combo = gtk_combo_box_text_new(); |
516 | 480 |
517 current = -1; | 481 current = -1; |
518 for (i = 0; (guint) i < sizeof(thumb_size_list) / sizeof(ThumbSize); i++) | 482 for (i = 0; (guint) i < sizeof(thumb_size_list) / sizeof(ThumbSize); i++) |
519 { | 483 { |
520 gint w, h; | 484 gint w, h; |
522 | 486 |
523 w = thumb_size_list[i].w; | 487 w = thumb_size_list[i].w; |
524 h = thumb_size_list[i].h; | 488 h = thumb_size_list[i].h; |
525 | 489 |
526 buf = g_strdup_printf("%d x %d", w, h); | 490 buf = g_strdup_printf("%d x %d", w, h); |
527 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), buf); | 491 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), buf); |
528 g_free(buf); | 492 g_free(buf); |
529 | 493 |
530 if (w == options->thumbnails.max_width && h == options->thumbnails.max_height) current = i; | 494 if (w == options->thumbnails.max_width && h == options->thumbnails.max_height) current = i; |
531 } | 495 } |
532 | 496 |
533 if (current == -1) | 497 if (current == -1) |
534 { | 498 { |
535 gchar *buf; | 499 gchar *buf; |
536 | 500 |
537 buf = g_strdup_printf("%s %d x %d", _("Custom"), options->thumbnails.max_width, options->thumbnails.max_height); | 501 buf = g_strdup_printf("%s %d x %d", _("Custom"), options->thumbnails.max_width, options->thumbnails.max_height); |
538 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), buf); | 502 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), buf); |
539 g_free(buf); | 503 g_free(buf); |
540 | 504 |
541 current = i; | 505 current = i; |
542 } | 506 } |
543 | 507 |
586 break; | 550 break; |
587 } | 551 } |
588 } | 552 } |
589 | 553 |
590 static void add_stereo_mode_menu(GtkWidget *table, gint column, gint row, const gchar *text, | 554 static void add_stereo_mode_menu(GtkWidget *table, gint column, gint row, const gchar *text, |
591 guint option, guint *option_c, gboolean add_fixed) | 555 gint option, gint *option_c, gboolean add_fixed) |
592 { | 556 { |
593 GtkWidget *combo; | 557 GtkWidget *combo; |
594 gint current = 0; | 558 gint current = 0; |
595 | 559 |
596 *option_c = option; | 560 *option_c = option; |
597 | 561 |
598 pref_table_label(table, column, row, text, 0.0); | 562 pref_table_label(table, column, row, text, 0.0); |
599 | 563 |
600 combo = gtk_combo_box_new_text(); | 564 combo = gtk_combo_box_text_new(); |
601 | 565 |
602 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Single image")); | 566 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Single image")); |
603 | 567 |
604 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Anaglyph Red-Cyan")); | 568 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Anaglyph Red-Cyan")); |
605 if (option & PR_STEREO_ANAGLYPH_RC) current = 1; | 569 if (option & PR_STEREO_ANAGLYPH_RC) current = 1; |
606 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Anaglyph Gray Red-Cyan")); | 570 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Anaglyph Gray Red-Cyan")); |
607 if (option & PR_STEREO_ANAGLYPH_GRAY) current = 2; | 571 if (option & PR_STEREO_ANAGLYPH_GRAY) current = 2; |
608 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Anaglyph Dubois")); | 572 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Anaglyph Dubois")); |
609 if (option & PR_STEREO_ANAGLYPH_DB) current = 3; | 573 if (option & PR_STEREO_ANAGLYPH_DB) current = 3; |
610 | 574 |
611 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Side by Side")); | 575 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Side by Side")); |
612 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Side by Side Half size")); | 576 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Side by Side Half size")); |
613 if (option & PR_STEREO_HORIZ) | 577 if (option & PR_STEREO_HORIZ) |
614 { | 578 { |
615 current = 4; | 579 current = 4; |
616 if (option & PR_STEREO_HALF) current = 5; | 580 if (option & PR_STEREO_HALF) current = 5; |
617 } | 581 } |
618 | 582 |
619 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Top - Bottom")); | 583 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Top - Bottom")); |
620 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Top - Bottom Half size")); | 584 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Top - Bottom Half size")); |
621 if (option & PR_STEREO_VERT) | 585 if (option & PR_STEREO_VERT) |
622 { | 586 { |
623 current = 6; | 587 current = 6; |
624 if (option & PR_STEREO_HALF) current = 7; | 588 if (option & PR_STEREO_HALF) current = 7; |
625 } | 589 } |
626 | 590 |
627 if (add_fixed) | 591 if (add_fixed) |
628 { | 592 { |
629 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Fixed position")); | 593 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Fixed position")); |
630 if (option & PR_STEREO_FIXED) current = 8; | 594 if (option & PR_STEREO_FIXED) current = 8; |
631 } | 595 } |
632 | 596 |
633 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current); | 597 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current); |
634 | 598 |
821 "active", fe->allow_sidecar, NULL); | 785 "active", fe->allow_sidecar, NULL); |
822 break; | 786 break; |
823 } | 787 } |
824 } | 788 } |
825 | 789 |
790 static gboolean filter_add_scroll(gpointer data) | |
791 { | |
792 GtkTreePath *path; | |
793 GList *list_cells; | |
794 GtkCellRenderer *cell; | |
795 GtkTreeViewColumn *column; | |
796 GList *list_columns; | |
797 const gchar *title; | |
798 guint i = 0; | |
799 gint rows; | |
800 | |
801 rows = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(filter_store), NULL); | |
802 path = gtk_tree_path_new_from_indices(rows-1, -1); | |
803 | |
804 list_columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(data)); | |
805 do { | |
806 column = g_list_nth(list_columns,i)->data; | |
807 title = gtk_tree_view_column_get_title(GTK_TREE_VIEW_COLUMN(column)); | |
808 i++; | |
809 } while (strcmp(title, "Filter") !=0 ); | |
810 | |
811 list_cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(column)); | |
812 cell = g_list_last(list_cells)->data; | |
813 | |
814 gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(data), | |
815 path, column, FALSE, 0.0, 0.0 ); | |
816 gtk_tree_view_set_cursor_on_cell(GTK_TREE_VIEW(data), | |
817 path, column, cell, TRUE); | |
818 | |
819 gtk_tree_path_free(path); | |
820 g_list_free(list_cells); | |
821 g_list_free(list_columns); | |
822 | |
823 return(FALSE); | |
824 } | |
825 | |
826 static void filter_add_cb(GtkWidget *widget, gpointer data) | 826 static void filter_add_cb(GtkWidget *widget, gpointer data) |
827 { | 827 { |
828 filter_add_unique("description", ".new", FORMAT_CLASS_IMAGE, TRUE, FALSE, TRUE); | 828 filter_add_unique("description", ".new", FORMAT_CLASS_IMAGE, TRUE, FALSE, TRUE); |
829 filter_store_populate(); | 829 filter_store_populate(); |
830 | 830 |
831 /* FIXME: implement the scroll to/select row stuff for tree view */ | 831 g_idle_add((GSourceFunc)filter_add_scroll, data); |
832 } | 832 } |
833 | 833 |
834 static void filter_remove_cb(GtkWidget *widget, gpointer data) | 834 static void filter_remove_cb(GtkWidget *widget, gpointer data) |
835 { | 835 { |
836 GtkWidget *filter_view = data; | 836 GtkWidget *filter_view = data; |
847 filter_remove_entry(fe); | 847 filter_remove_entry(fe); |
848 filter_rebuild(); | 848 filter_rebuild(); |
849 filter_store_populate(); | 849 filter_store_populate(); |
850 } | 850 } |
851 | 851 |
852 static gboolean filter_default_ok_scroll(GtkTreeView *data) | |
853 { | |
854 GtkTreeIter iter; | |
855 GtkTreePath *path; | |
856 GtkTreeViewColumn *column; | |
857 | |
858 gtk_tree_model_get_iter_first(GTK_TREE_MODEL(filter_store), &iter); | |
859 path = gtk_tree_model_get_path(GTK_TREE_MODEL(filter_store), &iter); | |
860 column = gtk_tree_view_get_column(GTK_TREE_VIEW(data),0); | |
861 | |
862 gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(data), | |
863 path, column, | |
864 FALSE, 0.0, 0.0); | |
865 | |
866 gtk_tree_path_free(path); | |
867 | |
868 return(FALSE); | |
869 } | |
870 | |
852 static void filter_default_ok_cb(GenericDialog *gd, gpointer data) | 871 static void filter_default_ok_cb(GenericDialog *gd, gpointer data) |
853 { | 872 { |
854 filter_reset(); | 873 filter_reset(); |
855 filter_add_defaults(); | 874 filter_add_defaults(); |
856 filter_rebuild(); | 875 filter_rebuild(); |
857 filter_store_populate(); | 876 filter_store_populate(); |
877 | |
878 g_idle_add((GSourceFunc)filter_default_ok_scroll, gd->data); | |
858 } | 879 } |
859 | 880 |
860 static void dummy_cancel_cb(GenericDialog *gd, gpointer data) | 881 static void dummy_cancel_cb(GenericDialog *gd, gpointer data) |
861 { | 882 { |
862 /* no op, only so cancel button appears */ | 883 /* no op, only so cancel button appears */ |
866 { | 887 { |
867 GenericDialog *gd; | 888 GenericDialog *gd; |
868 | 889 |
869 gd = generic_dialog_new(_("Reset filters"), | 890 gd = generic_dialog_new(_("Reset filters"), |
870 "reset_filter", widget, TRUE, | 891 "reset_filter", widget, TRUE, |
871 dummy_cancel_cb, NULL); | 892 dummy_cancel_cb, data); |
872 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Reset filters"), | 893 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Reset filters"), |
873 _("This will reset the file filters to the defaults.\nContinue?")); | 894 _("This will reset the file filters to the defaults.\nContinue?")); |
874 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, filter_default_ok_cb, TRUE); | 895 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, filter_default_ok_cb, TRUE); |
875 gtk_widget_show(gd->dialog); | 896 gtk_widget_show(gd->dialog); |
876 } | 897 } |
902 dummy_cancel_cb, NULL); | 923 dummy_cancel_cb, NULL); |
903 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Clear trash"), | 924 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Clear trash"), |
904 _("This will remove the trash contents.")); | 925 _("This will remove the trash contents.")); |
905 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, safe_delete_clear_ok_cb, TRUE); | 926 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, safe_delete_clear_ok_cb, TRUE); |
906 entry = gtk_entry_new(); | 927 entry = gtk_entry_new(); |
907 GTK_WIDGET_UNSET_FLAGS(entry, GTK_CAN_FOCUS); | 928 gtk_widget_set_can_focus(entry, FALSE); |
908 gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE); | 929 gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE); |
909 if (options->file_ops.safe_delete_path) gtk_entry_set_text(GTK_ENTRY(entry), options->file_ops.safe_delete_path); | 930 if (options->file_ops.safe_delete_path) gtk_entry_set_text(GTK_ENTRY(entry), options->file_ops.safe_delete_path); |
910 gtk_box_pack_start(GTK_BOX(gd->vbox), entry, FALSE, FALSE, 0); | 931 gtk_box_pack_start(GTK_BOX(gd->vbox), entry, FALSE, FALSE, 0); |
911 gtk_widget_show(entry); | 932 gtk_widget_show(entry); |
912 gtk_widget_show(gd->dialog); | 933 gtk_widget_show(gd->dialog); |
957 static void image_overlay_help_cb(GtkWidget *widget, gpointer data) | 978 static void image_overlay_help_cb(GtkWidget *widget, gpointer data) |
958 { | 979 { |
959 help_window_show("overlay"); | 980 help_window_show("overlay"); |
960 } | 981 } |
961 | 982 |
962 #if GTK_CHECK_VERSION(2, 10, 0) | |
963 static void accel_store_populate(void) | 983 static void accel_store_populate(void) |
964 { | 984 { |
965 LayoutWindow *lw; | 985 LayoutWindow *lw; |
966 GList *groups, *actions; | 986 GList *groups, *actions; |
967 GtkAction *action; | 987 GtkAction *action; |
989 g_object_get(action, | 1009 g_object_get(action, |
990 "tooltip", &tooltip, | 1010 "tooltip", &tooltip, |
991 "label", &label, | 1011 "label", &label, |
992 NULL); | 1012 NULL); |
993 | 1013 |
994 if (pango_parse_markup(label, -1, '_', NULL, &label2, NULL, NULL) && label2) | 1014 if (pango_parse_markup(label, -1, '_', NULL, &label2, NULL, NULL) && label2) |
995 { | 1015 { |
996 g_free(label); | 1016 g_free(label); |
997 label = label2; | 1017 label = label2; |
998 } | 1018 } |
999 | 1019 |
1000 accel = gtk_accelerator_name(key.accel_key, key.accel_mods); | 1020 accel = gtk_accelerator_name(key.accel_key, key.accel_mods); |
1001 | 1021 |
1002 if (tooltip) | 1022 if (tooltip) |
1003 { | 1023 { |
1004 gtk_tree_store_append(accel_store, &iter, NULL); | 1024 gtk_tree_store_append(accel_store, &iter, NULL); |
1005 gtk_tree_store_set(accel_store, &iter, | 1025 gtk_tree_store_set(accel_store, &iter, |
1006 AE_ACTION, label, | 1026 AE_ACTION, label, |
1007 AE_KEY, accel, | 1027 AE_KEY, accel, |
1021 } | 1041 } |
1022 } | 1042 } |
1023 | 1043 |
1024 static void accel_store_cleared_cb(GtkCellRendererAccel *accel, gchar *path_string, gpointer user_data) | 1044 static void accel_store_cleared_cb(GtkCellRendererAccel *accel, gchar *path_string, gpointer user_data) |
1025 { | 1045 { |
1026 | 1046 |
1027 } | 1047 } |
1028 | 1048 |
1029 static gboolean accel_remove_key_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) | 1049 static gboolean accel_remove_key_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
1030 { | 1050 { |
1031 gchar *accel1 = data; | 1051 gchar *accel1 = data; |
1032 gchar *accel2; | 1052 gchar *accel2; |
1033 GtkAccelKey key1; | 1053 GtkAccelKey key1; |
1034 GtkAccelKey key2; | 1054 GtkAccelKey key2; |
1035 | 1055 |
1036 gtk_tree_model_get(model, iter, AE_KEY, &accel2, -1); | 1056 gtk_tree_model_get(model, iter, AE_KEY, &accel2, -1); |
1037 | 1057 |
1038 gtk_accelerator_parse(accel1, &key1.accel_key, &key1.accel_mods); | 1058 gtk_accelerator_parse(accel1, &key1.accel_key, &key1.accel_mods); |
1039 gtk_accelerator_parse(accel2, &key2.accel_key, &key2.accel_mods); | 1059 gtk_accelerator_parse(accel2, &key2.accel_key, &key2.accel_mods); |
1040 | 1060 |
1041 if (key1.accel_key == key2.accel_key && key1.accel_mods == key2.accel_mods) | 1061 if (key1.accel_key == key2.accel_key && key1.accel_mods == key2.accel_mods) |
1042 { | 1062 { |
1043 gtk_tree_store_set(accel_store, iter, AE_KEY, "", -1); | 1063 gtk_tree_store_set(accel_store, iter, AE_KEY, "", -1); |
1044 DEBUG_1("accelerator key '%s' is already used, removing.", accel1); | 1064 DEBUG_1("accelerator key '%s' is already used, removing.", accel1); |
1045 } | 1065 } |
1046 | 1066 |
1047 g_free(accel2); | 1067 g_free(accel2); |
1048 | 1068 |
1049 return FALSE; | 1069 return FALSE; |
1050 } | 1070 } |
1051 | 1071 |
1064 | 1084 |
1065 /* test if the accelerator can be stored without conflicts*/ | 1085 /* test if the accelerator can be stored without conflicts*/ |
1066 gtk_accel_map_lookup_entry(accel_path, &old_key); | 1086 gtk_accel_map_lookup_entry(accel_path, &old_key); |
1067 | 1087 |
1068 /* change the key and read it back (change may fail on keys hardcoded in gtk)*/ | 1088 /* change the key and read it back (change may fail on keys hardcoded in gtk)*/ |
1069 gtk_accel_map_change_entry(accel_path, accel_key, accel_mods, TRUE); | 1089 gtk_accel_map_change_entry(accel_path, accel_key, accel_mods, TRUE); |
1070 gtk_accel_map_lookup_entry(accel_path, &key); | 1090 gtk_accel_map_lookup_entry(accel_path, &key); |
1071 | 1091 |
1072 /* restore the original for now, the key will be really changed when the changes are confirmed */ | 1092 /* restore the original for now, the key will be really changed when the changes are confirmed */ |
1073 gtk_accel_map_change_entry(accel_path, old_key.accel_key, old_key.accel_mods, TRUE); | 1093 gtk_accel_map_change_entry(accel_path, old_key.accel_key, old_key.accel_mods, TRUE); |
1074 | 1094 |
1075 acc = gtk_accelerator_name(key.accel_key, key.accel_mods); | 1095 acc = gtk_accelerator_name(key.accel_key, key.accel_mods); |
1076 gtk_tree_model_foreach(GTK_TREE_MODEL(accel_store), accel_remove_key_cb, acc); | 1096 gtk_tree_model_foreach(GTK_TREE_MODEL(accel_store), accel_remove_key_cb, acc); |
1077 | 1097 |
1078 gtk_tree_store_set(accel_store, &iter, AE_KEY, acc, -1); | 1098 gtk_tree_store_set(accel_store, &iter, AE_KEY, acc, -1); |
1079 gtk_tree_path_free(path); | 1099 gtk_tree_path_free(path); |
1080 g_free(acc); | 1100 g_free(acc); |
1081 } | 1101 } |
1082 | 1102 |
1103 static gboolean accel_default_scroll(GtkTreeView *data) | |
1104 { | |
1105 GtkTreeIter iter; | |
1106 GtkTreePath *path; | |
1107 GtkTreeViewColumn *column; | |
1108 | |
1109 gtk_tree_model_get_iter_first(GTK_TREE_MODEL(accel_store), &iter); | |
1110 path = gtk_tree_model_get_path(GTK_TREE_MODEL(accel_store), &iter); | |
1111 column = gtk_tree_view_get_column(GTK_TREE_VIEW(data),0); | |
1112 | |
1113 gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(data), | |
1114 path, column, | |
1115 FALSE, 0.0, 0.0); | |
1116 | |
1117 gtk_tree_path_free(path); | |
1118 | |
1119 return(FALSE); | |
1120 } | |
1121 | |
1083 static void accel_default_cb(GtkWidget *widget, gpointer data) | 1122 static void accel_default_cb(GtkWidget *widget, gpointer data) |
1084 { | 1123 { |
1085 accel_store_populate(); | 1124 accel_store_populate(); |
1086 | 1125 |
1087 /* FIXME: implement the scroll to/select row stuff for tree view */ | 1126 g_idle_add((GSourceFunc)accel_default_scroll, data); |
1088 } | 1127 } |
1089 | 1128 |
1090 void accel_remove_selection(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) | 1129 void accel_remove_selection(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
1091 { | 1130 { |
1092 gtk_tree_store_set(accel_store, iter, AE_KEY, "", -1); | 1131 gtk_tree_store_set(accel_store, iter, AE_KEY, "", -1); |
1093 } | 1132 } |
1094 | |
1095 #if 0 | |
1096 static void accel_remove_cb(GtkWidget *widget, gpointer data) | |
1097 { | |
1098 GtkTreeSelection *selection; | |
1099 | |
1100 if (!accel_store) return; | |
1101 | |
1102 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(data)); | |
1103 gtk_tree_selection_selected_foreach(selection, &accel_remove_selection, NULL); | |
1104 } | |
1105 #endif | |
1106 | 1133 |
1107 void accel_reset_selection(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) | 1134 void accel_reset_selection(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
1108 { | 1135 { |
1109 GtkAccelKey key; | 1136 GtkAccelKey key; |
1110 gchar *accel_path, *accel; | 1137 gchar *accel_path, *accel; |
1128 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(data)); | 1155 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(data)); |
1129 gtk_tree_selection_selected_foreach(selection, &accel_reset_selection, NULL); | 1156 gtk_tree_selection_selected_foreach(selection, &accel_reset_selection, NULL); |
1130 } | 1157 } |
1131 | 1158 |
1132 | 1159 |
1133 #if 0 | |
1134 static void accel_alternate_activate_cb(GtkWidget *widget, gpointer data) | |
1135 { | |
1136 gtk_action_activate((GtkAction*)data); | |
1137 } | |
1138 | |
1139 #define DUPL "-alt-" | |
1140 | |
1141 void accel_add_alt_selection(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) | |
1142 { | |
1143 LayoutWindow *lw; | |
1144 GList *groups, *actions; | |
1145 GtkAction *action; | |
1146 GtkAccelKey key, *key2; | |
1147 GtkAccelMap *map; | |
1148 gchar *accel_path2, *accel; | |
1149 const gchar *accel_path; | |
1150 gint freeduplnum = 1; | |
1151 gint len; | |
1152 GClosure* closure; | |
1153 GtkAccelGroup *group; | |
1154 GtkAction *action_new, *action_new2; | |
1155 gchar *name, *accel_path_new, *accel_path_new2; | |
1156 | |
1157 if (!accel_store || !layout_window_list || !layout_window_list->data) return; | |
1158 | |
1159 gtk_tree_model_get(model, iter, AE_ACCEL, &accel_path2, -1); | |
1160 len = strlen(accel_path2); | |
1161 | |
1162 gtk_tree_store_clear(accel_store); | |
1163 lw = layout_window_list->data; | |
1164 | |
1165 g_assert(lw && lw->ui_manager); | |
1166 groups = gtk_ui_manager_get_action_groups(lw->ui_manager); | |
1167 group = gtk_ui_manager_get_accel_group(lw->ui_manager); | |
1168 | |
1169 while (groups) | |
1170 { | |
1171 actions = gtk_action_group_list_actions(GTK_ACTION_GROUP(groups->data)); | |
1172 while (actions) | |
1173 { | |
1174 gchar *dupl; | |
1175 guint64 num; | |
1176 | |
1177 action = GTK_ACTION(actions->data); | |
1178 actions = actions->next; | |
1179 | |
1180 accel_path = gtk_action_get_accel_path(action); | |
1181 if (!accel_path) continue; | |
1182 | |
1183 dupl = g_strrstr(accel_path, DUPL); | |
1184 | |
1185 printf("D: %s %s %s\n", accel_path, accel_path2, dupl); | |
1186 | |
1187 if ((dupl && (len != (dupl - accel_path)) ) || | |
1188 g_ascii_strncasecmp(accel_path, accel_path2, len) != 0) | |
1189 continue; | |
1190 | |
1191 if (dupl && (num = g_ascii_strtoull(dupl + strlen(DUPL), NULL, 10)) > 0 && | |
1192 num > freeduplnum) | |
1193 { | |
1194 freeduplnum = num + 1; | |
1195 } | |
1196 else | |
1197 { | |
1198 closure = gtk_action_get_accel_closure(action); | |
1199 name = gtk_action_get_name(action); | |
1200 accel_path_new = g_strdup(accel_path); | |
1201 action_new2 = action; | |
1202 } | |
1203 } | |
1204 groups = groups->next; | |
1205 } | |
1206 | |
1207 action_new = gtk_action_new(name, NULL, NULL, NULL); | |
1208 gtk_action_set_accel_group(action_new, group); | |
1209 | |
1210 g_signal_connect(G_OBJECT(action_new), "activate", | |
1211 G_CALLBACK(accel_alternate_activate_cb), action_new2); | |
1212 | |
1213 // accel_path_new2 = g_strdup_printf("%s%s%d", accel_path_new, dupl, freeduplnum); | |
1214 g_free(accel_path_new); | |
1215 | |
1216 gtk_action_set_accel_path(action_new, accel_path_new); | |
1217 | |
1218 // gtk_tree_store_set(accel_store, iter, AE_KEY, "", -1); | |
1219 printf("D: %s\n", accel_path_new2); | |
1220 | |
1221 g_free(accel_path_new2); | |
1222 gtk_action_connect_accelerator(action_new); | |
1223 } | |
1224 | |
1225 static void accel_add_alt_cb(GtkWidget *widget, gpointer data) | |
1226 { | |
1227 GtkWidget *accel_view = data; | |
1228 GtkTreeSelection *selection; | |
1229 | |
1230 if (!accel_store) return; | |
1231 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(data)); | |
1232 gtk_tree_selection_selected_foreach(selection, &accel_add_alt_selection, NULL); | |
1233 } | |
1234 | |
1235 static void accel_default_ok_cb(GenericDialog *gd, gpointer data) | |
1236 { | |
1237 accel_store_populate(); | |
1238 } | |
1239 | |
1240 #endif | |
1241 #endif | |
1242 | 1160 |
1243 static GtkWidget *scrolled_notebook_page(GtkWidget *notebook, const gchar *title) | 1161 static GtkWidget *scrolled_notebook_page(GtkWidget *notebook, const gchar *title) |
1244 { | 1162 { |
1245 GtkWidget *label; | 1163 GtkWidget *label; |
1246 GtkWidget *vbox; | 1164 GtkWidget *vbox; |
1299 pref_checkbox_link_sensitivity_swap(button, subgroup); | 1217 pref_checkbox_link_sensitivity_swap(button, subgroup); |
1300 | 1218 |
1301 pref_checkbox_new_int(subgroup, _("Store thumbnails in '.thumbnails' folder, local to image folder (non-standard)"), | 1219 pref_checkbox_new_int(subgroup, _("Store thumbnails in '.thumbnails' folder, local to image folder (non-standard)"), |
1302 options->thumbnails.cache_into_dirs, &c_options->thumbnails.cache_into_dirs); | 1220 options->thumbnails.cache_into_dirs, &c_options->thumbnails.cache_into_dirs); |
1303 | 1221 |
1304 #if 0 | |
1305 pref_checkbox_new_int(subgroup, _("Use xvpics thumbnails when found (read only)"), | |
1306 options->thumbnails.use_xvpics, &c_options->thumbnails.use_xvpics); | |
1307 #endif | |
1308 | |
1309 pref_checkbox_new_int(group, _("Use EXIF thumbnails when available (EXIF thumbnails may be outdated)"), | 1222 pref_checkbox_new_int(group, _("Use EXIF thumbnails when available (EXIF thumbnails may be outdated)"), |
1310 options->thumbnails.use_exif, &c_options->thumbnails.use_exif); | 1223 options->thumbnails.use_exif, &c_options->thumbnails.use_exif); |
1311 | 1224 |
1312 group = pref_group_new(vbox, FALSE, _("Slide show"), GTK_ORIENTATION_VERTICAL); | 1225 group = pref_group_new(vbox, FALSE, _("Slide show"), GTK_ORIENTATION_VERTICAL); |
1313 | 1226 |
1320 | 1233 |
1321 pref_checkbox_new_int(group, _("Random"), options->slideshow.random, &c_options->slideshow.random); | 1234 pref_checkbox_new_int(group, _("Random"), options->slideshow.random, &c_options->slideshow.random); |
1322 pref_checkbox_new_int(group, _("Repeat"), options->slideshow.repeat, &c_options->slideshow.repeat); | 1235 pref_checkbox_new_int(group, _("Repeat"), options->slideshow.repeat, &c_options->slideshow.repeat); |
1323 | 1236 |
1324 group = pref_group_new(vbox, FALSE, _("Image loading and caching"), GTK_ORIENTATION_VERTICAL); | 1237 group = pref_group_new(vbox, FALSE, _("Image loading and caching"), GTK_ORIENTATION_VERTICAL); |
1325 | |
1326 #if 0 | |
1327 pref_spin_new_int(group, _("Offscreen cache size (Mb per image):"), NULL, | |
1328 0, 128, 1, options->image.tile_cache_max, &c_options->image.tile_cache_max); | |
1329 #endif | |
1330 | 1238 |
1331 pref_spin_new_int(group, _("Decoded image cache size (Mb):"), NULL, | 1239 pref_spin_new_int(group, _("Decoded image cache size (Mb):"), NULL, |
1332 0, 1024, 1, options->image.image_cache_max, &c_options->image.image_cache_max); | 1240 0, 1024, 1, options->image.image_cache_max, &c_options->image.image_cache_max); |
1333 pref_checkbox_new_int(group, _("Preload next image"), | 1241 pref_checkbox_new_int(group, _("Preload next image"), |
1334 options->image.enable_read_ahead, &c_options->image.enable_read_ahead); | 1242 options->image.enable_read_ahead, &c_options->image.enable_read_ahead); |
1351 | 1259 |
1352 vbox = scrolled_notebook_page(notebook, _("Image")); | 1260 vbox = scrolled_notebook_page(notebook, _("Image")); |
1353 | 1261 |
1354 group = pref_group_new(vbox, FALSE, _("Zoom"), GTK_ORIENTATION_VERTICAL); | 1262 group = pref_group_new(vbox, FALSE, _("Zoom"), GTK_ORIENTATION_VERTICAL); |
1355 | 1263 |
1356 #if 0 | |
1357 add_dither_menu(dither_quality, &c_options->image.dither_quality, _("Dithering method:"), group); | |
1358 #endif | |
1359 table = pref_table_new(group, 2, 1, FALSE, FALSE); | 1264 table = pref_table_new(group, 2, 1, FALSE, FALSE); |
1360 add_quality_menu(table, 0, 0, _("Quality:"), options->image.zoom_quality, &c_options->image.zoom_quality); | 1265 add_quality_menu(table, 0, 0, _("Quality:"), options->image.zoom_quality, &c_options->image.zoom_quality); |
1266 | |
1267 #ifdef HAVE_CLUTTER | |
1268 pref_checkbox_new_int(group, _("Use GPU acceleration via Clutter library"), | |
1269 options->image.use_clutter_renderer, &c_options->image.use_clutter_renderer); | |
1270 #endif | |
1361 | 1271 |
1362 pref_checkbox_new_int(group, _("Two pass rendering (apply HQ zoom and color correction in second pass)"), | 1272 pref_checkbox_new_int(group, _("Two pass rendering (apply HQ zoom and color correction in second pass)"), |
1363 options->image.zoom_2pass, &c_options->image.zoom_2pass); | 1273 options->image.zoom_2pass, &c_options->image.zoom_2pass); |
1364 | 1274 |
1365 pref_checkbox_new_int(group, _("Allow enlargement of image for zoom to fit"), | 1275 pref_checkbox_new_int(group, _("Allow enlargement of image for zoom to fit"), |
1408 | 1318 |
1409 group = pref_group_new(vbox, FALSE, _("Appearance"), GTK_ORIENTATION_VERTICAL); | 1319 group = pref_group_new(vbox, FALSE, _("Appearance"), GTK_ORIENTATION_VERTICAL); |
1410 | 1320 |
1411 pref_checkbox_new_int(group, _("Use custom border color in window mode"), | 1321 pref_checkbox_new_int(group, _("Use custom border color in window mode"), |
1412 options->image.use_custom_border_color, &c_options->image.use_custom_border_color); | 1322 options->image.use_custom_border_color, &c_options->image.use_custom_border_color); |
1413 | 1323 |
1414 pref_checkbox_new_int(group, _("Use custom border color in fullscreen mode"), | 1324 pref_checkbox_new_int(group, _("Use custom border color in fullscreen mode"), |
1415 options->image.use_custom_border_color_in_fullscreen, &c_options->image.use_custom_border_color_in_fullscreen); | 1325 options->image.use_custom_border_color_in_fullscreen, &c_options->image.use_custom_border_color_in_fullscreen); |
1416 | 1326 |
1417 pref_color_button_new(group, _("Border color"), &options->image.border_color, | 1327 pref_color_button_new(group, _("Border color"), &options->image.border_color, |
1418 G_CALLBACK(pref_color_button_set_cb), &c_options->image.border_color); | 1328 G_CALLBACK(pref_color_button_set_cb), &c_options->image.border_color); |
1487 gtk_box_pack_start(GTK_BOX(group), scrolled, TRUE, TRUE, 5); | 1397 gtk_box_pack_start(GTK_BOX(group), scrolled, TRUE, TRUE, 5); |
1488 gtk_widget_show(scrolled); | 1398 gtk_widget_show(scrolled); |
1489 | 1399 |
1490 image_overlay_template_view = gtk_text_view_new(); | 1400 image_overlay_template_view = gtk_text_view_new(); |
1491 | 1401 |
1492 #if GTK_CHECK_VERSION(2,12,0) | |
1493 gtk_widget_set_tooltip_markup(image_overlay_template_view, | 1402 gtk_widget_set_tooltip_markup(image_overlay_template_view, |
1494 _("<i>%name%</i> results in the filename of the picture.\n" | 1403 _("<i>%name%</i> results in the filename of the picture.\n" |
1495 "Also available: <i>%collection%</i>, <i>%number%</i>, <i>%total%</i>, <i>%date%</i>,\n" | 1404 "Also available: <i>%collection%</i>, <i>%number%</i>, <i>%total%</i>, <i>%date%</i>,\n" |
1496 "<i>%size%</i> (filesize), <i>%width%</i>, <i>%height%</i>, <i>%res%</i> (resolution)\n" | 1405 "<i>%size%</i> (filesize), <i>%width%</i>, <i>%height%</i>, <i>%res%</i> (resolution)\n" |
1497 "To access exif data use the exif name, e. g. <i>%formatted.Camera%</i> is the formatted camera name,\n" | 1406 "To access exif data use the exif name, e. g. <i>%formatted.Camera%</i> is the formatted camera name,\n" |
1498 "<i>%Exif.Photo.DateTimeOriginal%</i> the date of the original shot.\n" | 1407 "<i>%Exif.Photo.DateTimeOriginal%</i> the date of the original shot.\n" |
1499 "<i>%formatted.Camera:20</i> notation will truncate the displayed data to 20 characters and will add 3 dots at the end to denote the truncation.\n" | 1408 "<i>%formatted.Camera:20</i> notation will truncate the displayed data to 20 characters and will add 3 dots at the end to denote the truncation.\n" |
1500 "If two or more variables are connected with the |-sign, it prints available variables with a separator.\n" | 1409 "If two or more variables are connected with the |-sign, it prints available variables with a separator.\n" |
1501 "<i>%formatted.ShutterSpeed%</i>|<i>%formatted.ISOSpeedRating%</i>|<i>%formatted.FocalLength%</i> could show \"1/20s - 400 - 80 mm\" or \"1/200 - 80 mm\",\n" | 1410 "<i>%formatted.ShutterSpeed%</i>|<i>%formatted.ISOSpeedRating%</i>|<i>%formatted.FocalLength%</i> could show \"1/20s - 400 - 80 mm\" or \"1/200 - 80 mm\",\n" |
1502 "if there's no ISO information in the Exif data.\n" | 1411 "if there's no ISO information in the Exif data.\n" |
1503 "If a line is empty, it is removed. This allows to add lines that totally disappear when no data is available.\n" | 1412 "If a line is empty, it is removed. This allows one to add lines that totally disappear when no data is available.\n" |
1504 )); | 1413 )); |
1505 #endif | |
1506 gtk_container_add(GTK_CONTAINER(scrolled), image_overlay_template_view); | 1414 gtk_container_add(GTK_CONTAINER(scrolled), image_overlay_template_view); |
1507 gtk_widget_show(image_overlay_template_view); | 1415 gtk_widget_show(image_overlay_template_view); |
1508 | 1416 |
1509 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); | 1417 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); |
1510 | 1418 |
1562 | 1470 |
1563 group = pref_box_new(vbox, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | 1471 group = pref_box_new(vbox, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); |
1564 | 1472 |
1565 pref_checkbox_new_int(group, _("Show hidden files or folders"), | 1473 pref_checkbox_new_int(group, _("Show hidden files or folders"), |
1566 options->file_filter.show_hidden_files, &c_options->file_filter.show_hidden_files); | 1474 options->file_filter.show_hidden_files, &c_options->file_filter.show_hidden_files); |
1567 #if 0 | |
1568 pref_checkbox_new_int(group, _("Show dot directory"), | |
1569 options->file_filter.show_dot_directory, &c_options->file_filter.show_dot_directory); | |
1570 #endif | |
1571 pref_checkbox_new_int(group, _("Case sensitive sort"), | 1475 pref_checkbox_new_int(group, _("Case sensitive sort"), |
1572 options->file_sort.case_sensitive, &c_options->file_sort.case_sensitive); | 1476 options->file_sort.case_sensitive, &c_options->file_sort.case_sensitive); |
1573 | 1477 |
1574 ct_button = pref_checkbox_new_int(group, _("Disable File Filtering"), | 1478 ct_button = pref_checkbox_new_int(group, _("Disable File Filtering"), |
1575 options->file_filter.disable, &c_options->file_filter.disable); | 1479 options->file_filter.disable, &c_options->file_filter.disable); |
1624 gtk_tree_view_append_column(GTK_TREE_VIEW(filter_view), column); | 1528 gtk_tree_view_append_column(GTK_TREE_VIEW(filter_view), column); |
1625 | 1529 |
1626 column = gtk_tree_view_column_new(); | 1530 column = gtk_tree_view_column_new(); |
1627 gtk_tree_view_column_set_title(column, _("Description")); | 1531 gtk_tree_view_column_set_title(column, _("Description")); |
1628 gtk_tree_view_column_set_resizable(column, TRUE); | 1532 gtk_tree_view_column_set_resizable(column, TRUE); |
1533 gtk_tree_view_column_set_fixed_width(column, 200); | |
1534 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); | |
1535 | |
1629 renderer = gtk_cell_renderer_text_new(); | 1536 renderer = gtk_cell_renderer_text_new(); |
1630 g_signal_connect(G_OBJECT(renderer), "edited", | 1537 g_signal_connect(G_OBJECT(renderer), "edited", |
1631 G_CALLBACK(filter_store_desc_edit_cb), filter_store); | 1538 G_CALLBACK(filter_store_desc_edit_cb), filter_store); |
1632 g_object_set(G_OBJECT(renderer), "editable", (gboolean)TRUE, NULL); | 1539 g_object_set(G_OBJECT(renderer), "editable", (gboolean)TRUE, NULL); |
1633 gtk_tree_view_column_pack_start(column, renderer, FALSE); | 1540 gtk_tree_view_column_pack_start(column, renderer, FALSE); |
1680 gtk_widget_show(filter_view); | 1587 gtk_widget_show(filter_view); |
1681 | 1588 |
1682 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); | 1589 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); |
1683 | 1590 |
1684 button = pref_button_new(NULL, NULL, _("Defaults"), FALSE, | 1591 button = pref_button_new(NULL, NULL, _("Defaults"), FALSE, |
1685 G_CALLBACK(filter_default_cb), NULL); | 1592 G_CALLBACK(filter_default_cb), filter_view); |
1686 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | 1593 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1687 gtk_widget_show(button); | 1594 gtk_widget_show(button); |
1688 | 1595 |
1689 button = pref_button_new(NULL, GTK_STOCK_REMOVE, NULL, FALSE, | 1596 button = pref_button_new(NULL, GTK_STOCK_REMOVE, NULL, FALSE, |
1690 G_CALLBACK(filter_remove_cb), filter_view); | 1597 G_CALLBACK(filter_remove_cb), filter_view); |
1691 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | 1598 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1692 gtk_widget_show(button); | 1599 gtk_widget_show(button); |
1693 | 1600 |
1694 button = pref_button_new(NULL, GTK_STOCK_ADD, NULL, FALSE, | 1601 button = pref_button_new(NULL, GTK_STOCK_ADD, NULL, FALSE, |
1695 G_CALLBACK(filter_add_cb), NULL); | 1602 G_CALLBACK(filter_add_cb), filter_view); |
1696 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | 1603 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1697 gtk_widget_show(button); | 1604 gtk_widget_show(button); |
1698 } | 1605 } |
1699 | 1606 |
1700 /* metadata tab */ | 1607 /* metadata tab */ |
1727 options->metadata.enable_metadata_dirs, &c_options->metadata.enable_metadata_dirs); | 1634 options->metadata.enable_metadata_dirs, &c_options->metadata.enable_metadata_dirs); |
1728 | 1635 |
1729 text = g_strdup_printf(_("3) Save metadata in Geeqie private directory '%s'"), get_metadata_cache_dir()); | 1636 text = g_strdup_printf(_("3) Save metadata in Geeqie private directory '%s'"), get_metadata_cache_dir()); |
1730 label = pref_label_new(group, text); | 1637 label = pref_label_new(group, text); |
1731 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); | 1638 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
1639 gtk_misc_set_padding(GTK_MISC(label), 22, 0); | |
1732 g_free(text); | 1640 g_free(text); |
1733 | 1641 |
1734 group = pref_group_new(vbox, FALSE, _("Step 1: Write to image files"), GTK_ORIENTATION_VERTICAL); | 1642 group = pref_group_new(vbox, FALSE, _("Step 1: Write to image files"), GTK_ORIENTATION_VERTICAL); |
1735 #ifndef HAVE_EXIV2 | 1643 #ifndef HAVE_EXIV2 |
1736 gtk_widget_set_sensitive(group, FALSE); | 1644 gtk_widget_set_sensitive(group, FALSE); |
1778 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | 1686 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); |
1779 pref_checkbox_link_sensitivity(ct_button, hbox); | 1687 pref_checkbox_link_sensitivity(ct_button, hbox); |
1780 | 1688 |
1781 pref_spin_new_int(hbox, _("Timeout (seconds):"), NULL, 0, 900, 1, | 1689 pref_spin_new_int(hbox, _("Timeout (seconds):"), NULL, 0, 900, 1, |
1782 options->metadata.confirm_timeout, &c_options->metadata.confirm_timeout); | 1690 options->metadata.confirm_timeout, &c_options->metadata.confirm_timeout); |
1783 | 1691 |
1784 pref_checkbox_new_int(group, _("Write metadata on image change"), | 1692 pref_checkbox_new_int(group, _("Write metadata on image change"), |
1785 options->metadata.confirm_on_image_change, &c_options->metadata.confirm_on_image_change); | 1693 options->metadata.confirm_on_image_change, &c_options->metadata.confirm_on_image_change); |
1786 | 1694 |
1787 pref_checkbox_new_int(group, _("Write metadata on directory change"), | 1695 pref_checkbox_new_int(group, _("Write metadata on directory change"), |
1788 options->metadata.confirm_on_dir_change, &c_options->metadata.confirm_on_dir_change); | 1696 options->metadata.confirm_on_dir_change, &c_options->metadata.confirm_on_dir_change); |
1826 pref_table_label(table, 0, i + 1, buf, 1.0); | 1734 pref_table_label(table, 0, i + 1, buf, 1.0); |
1827 g_free(buf); | 1735 g_free(buf); |
1828 | 1736 |
1829 entry = gtk_entry_new(); | 1737 entry = gtk_entry_new(); |
1830 gtk_entry_set_max_length(GTK_ENTRY(entry), EDITOR_NAME_MAX_LENGTH); | 1738 gtk_entry_set_max_length(GTK_ENTRY(entry), EDITOR_NAME_MAX_LENGTH); |
1831 // gtk_widget_set_size_request(editor_name_entry[i], 30, -1); | |
1832 if (options->color_profile.input_name[i]) | 1739 if (options->color_profile.input_name[i]) |
1833 { | 1740 { |
1834 gtk_entry_set_text(GTK_ENTRY(entry), options->color_profile.input_name[i]); | 1741 gtk_entry_set_text(GTK_ENTRY(entry), options->color_profile.input_name[i]); |
1835 } | 1742 } |
1836 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, i + 1, i + 2, | 1743 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, i + 1, i + 2, |
1905 pref_checkbox_link_sensitivity(ct_button, hbox); | 1812 pref_checkbox_link_sensitivity(ct_button, hbox); |
1906 | 1813 |
1907 pref_spacer(hbox, PREF_PAD_INDENT - PREF_PAD_GAP); | 1814 pref_spacer(hbox, PREF_PAD_INDENT - PREF_PAD_GAP); |
1908 spin = pref_spin_new_int(hbox, _("Maximum size:"), _("MB"), | 1815 spin = pref_spin_new_int(hbox, _("Maximum size:"), _("MB"), |
1909 0, 2048, 1, options->file_ops.safe_delete_folder_maxsize, &c_options->file_ops.safe_delete_folder_maxsize); | 1816 0, 2048, 1, options->file_ops.safe_delete_folder_maxsize, &c_options->file_ops.safe_delete_folder_maxsize); |
1910 #if GTK_CHECK_VERSION(2,12,0) | |
1911 gtk_widget_set_tooltip_markup(spin, _("Set to 0 for unlimited size")); | 1817 gtk_widget_set_tooltip_markup(spin, _("Set to 0 for unlimited size")); |
1912 #endif | |
1913 button = pref_button_new(NULL, NULL, _("View"), FALSE, | 1818 button = pref_button_new(NULL, NULL, _("View"), FALSE, |
1914 G_CALLBACK(safe_delete_view_cb), NULL); | 1819 G_CALLBACK(safe_delete_view_cb), NULL); |
1915 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | 1820 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1916 gtk_widget_show(button); | 1821 gtk_widget_show(button); |
1917 | 1822 |
1932 pref_checkbox_new_int(group, _("In place renaming"), | 1837 pref_checkbox_new_int(group, _("In place renaming"), |
1933 options->file_ops.enable_in_place_rename, &c_options->file_ops.enable_in_place_rename); | 1838 options->file_ops.enable_in_place_rename, &c_options->file_ops.enable_in_place_rename); |
1934 | 1839 |
1935 pref_spin_new_int(group, _("Open recent list maximum size"), NULL, | 1840 pref_spin_new_int(group, _("Open recent list maximum size"), NULL, |
1936 1, 50, 1, options->open_recent_list_maxsize, &c_options->open_recent_list_maxsize); | 1841 1, 50, 1, options->open_recent_list_maxsize, &c_options->open_recent_list_maxsize); |
1937 | 1842 |
1938 pref_spin_new_int(group, _("Drag'n drop icon size"), NULL, | 1843 pref_spin_new_int(group, _("Drag'n drop icon size"), NULL, |
1939 16, 256, 16, options->dnd_icon_size, &c_options->dnd_icon_size); | 1844 16, 256, 16, options->dnd_icon_size, &c_options->dnd_icon_size); |
1940 | 1845 |
1941 group = pref_group_new(vbox, FALSE, _("Navigation"), GTK_ORIENTATION_VERTICAL); | 1846 group = pref_group_new(vbox, FALSE, _("Navigation"), GTK_ORIENTATION_VERTICAL); |
1942 | 1847 |
1960 } | 1865 } |
1961 | 1866 |
1962 /* accelerators tab */ | 1867 /* accelerators tab */ |
1963 static void config_tab_accelerators(GtkWidget *notebook) | 1868 static void config_tab_accelerators(GtkWidget *notebook) |
1964 { | 1869 { |
1965 #if GTK_CHECK_VERSION(2, 10, 0) | |
1966 GtkWidget *hbox; | 1870 GtkWidget *hbox; |
1967 GtkWidget *vbox; | 1871 GtkWidget *vbox; |
1968 GtkWidget *group; | 1872 GtkWidget *group; |
1969 GtkWidget *button; | 1873 GtkWidget *button; |
1970 GtkWidget *scrolled; | 1874 GtkWidget *scrolled; |
1993 gtk_tree_view_set_enable_search(GTK_TREE_VIEW(accel_view), FALSE); | 1897 gtk_tree_view_set_enable_search(GTK_TREE_VIEW(accel_view), FALSE); |
1994 | 1898 |
1995 renderer = gtk_cell_renderer_text_new(); | 1899 renderer = gtk_cell_renderer_text_new(); |
1996 | 1900 |
1997 column = gtk_tree_view_column_new_with_attributes(_("Action"), | 1901 column = gtk_tree_view_column_new_with_attributes(_("Action"), |
1998 renderer, | 1902 renderer, |
1999 "text", AE_ACTION, | 1903 "text", AE_ACTION, |
2000 NULL); | 1904 NULL); |
2001 | 1905 |
2002 gtk_tree_view_column_set_sort_column_id(column, AE_ACTION); | 1906 gtk_tree_view_column_set_sort_column_id(column, AE_ACTION); |
2003 gtk_tree_view_column_set_resizable(column, TRUE); | 1907 gtk_tree_view_column_set_resizable(column, TRUE); |
2004 gtk_tree_view_append_column(GTK_TREE_VIEW(accel_view), column); | 1908 gtk_tree_view_append_column(GTK_TREE_VIEW(accel_view), column); |
2005 | 1909 |
2010 g_signal_connect(G_OBJECT(renderer), "accel-edited", | 1914 g_signal_connect(G_OBJECT(renderer), "accel-edited", |
2011 G_CALLBACK(accel_store_edited_cb), accel_store); | 1915 G_CALLBACK(accel_store_edited_cb), accel_store); |
2012 | 1916 |
2013 | 1917 |
2014 g_object_set (renderer, | 1918 g_object_set (renderer, |
2015 "editable", TRUE, | 1919 "editable", TRUE, |
2016 "accel-mode", GTK_CELL_RENDERER_ACCEL_MODE_OTHER, | 1920 "accel-mode", GTK_CELL_RENDERER_ACCEL_MODE_OTHER, |
2017 NULL); | 1921 NULL); |
2018 | 1922 |
2019 column = gtk_tree_view_column_new_with_attributes(_("KEY"), | 1923 column = gtk_tree_view_column_new_with_attributes(_("KEY"), |
2020 renderer, | 1924 renderer, |
2021 "text", AE_KEY, | 1925 "text", AE_KEY, |
2022 NULL); | 1926 NULL); |
2023 | 1927 |
2024 gtk_tree_view_column_set_sort_column_id(column, AE_KEY); | 1928 gtk_tree_view_column_set_sort_column_id(column, AE_KEY); |
2025 gtk_tree_view_column_set_resizable(column, TRUE); | 1929 gtk_tree_view_column_set_resizable(column, TRUE); |
2026 gtk_tree_view_append_column(GTK_TREE_VIEW(accel_view), column); | 1930 gtk_tree_view_append_column(GTK_TREE_VIEW(accel_view), column); |
2027 | 1931 |
2028 renderer = gtk_cell_renderer_text_new(); | 1932 renderer = gtk_cell_renderer_text_new(); |
2029 | 1933 |
2030 column = gtk_tree_view_column_new_with_attributes(_("Tooltip"), | 1934 column = gtk_tree_view_column_new_with_attributes(_("Tooltip"), |
2031 renderer, | 1935 renderer, |
2032 "text", AE_TOOLTIP, | 1936 "text", AE_TOOLTIP, |
2033 NULL); | 1937 NULL); |
2034 | 1938 |
2035 gtk_tree_view_column_set_sort_column_id(column, AE_TOOLTIP); | 1939 gtk_tree_view_column_set_sort_column_id(column, AE_TOOLTIP); |
2036 gtk_tree_view_column_set_resizable(column, TRUE); | 1940 gtk_tree_view_column_set_resizable(column, TRUE); |
2037 gtk_tree_view_append_column(GTK_TREE_VIEW(accel_view), column); | 1941 gtk_tree_view_append_column(GTK_TREE_VIEW(accel_view), column); |
2038 | 1942 |
2039 renderer = gtk_cell_renderer_text_new(); | 1943 renderer = gtk_cell_renderer_text_new(); |
2040 | 1944 |
2041 column = gtk_tree_view_column_new_with_attributes("Accel", | 1945 column = gtk_tree_view_column_new_with_attributes("Accel", |
2042 renderer, | 1946 renderer, |
2043 "text", AE_ACCEL, | 1947 "text", AE_ACCEL, |
2044 NULL); | 1948 NULL); |
2045 | 1949 |
2046 gtk_tree_view_column_set_sort_column_id(column, AE_ACCEL); | 1950 gtk_tree_view_column_set_sort_column_id(column, AE_ACCEL); |
2047 gtk_tree_view_column_set_resizable(column, TRUE); | 1951 gtk_tree_view_column_set_resizable(column, TRUE); |
2048 gtk_tree_view_append_column(GTK_TREE_VIEW(accel_view), column); | 1952 gtk_tree_view_append_column(GTK_TREE_VIEW(accel_view), column); |
2049 | 1953 |
2050 accel_store_populate(); | 1954 accel_store_populate(); |
2051 gtk_container_add(GTK_CONTAINER(scrolled), accel_view); | 1955 gtk_container_add(GTK_CONTAINER(scrolled), accel_view); |
2052 gtk_widget_show(accel_view); | 1956 gtk_widget_show(accel_view); |
2053 | 1957 |
2054 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); | 1958 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); |
2055 | 1959 |
2056 button = pref_button_new(NULL, NULL, _("Defaults"), FALSE, | 1960 button = pref_button_new(NULL, NULL, _("Defaults"), FALSE, |
2057 G_CALLBACK(accel_default_cb), NULL); | 1961 G_CALLBACK(accel_default_cb), accel_view); |
2058 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | 1962 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
2059 gtk_widget_show(button); | 1963 gtk_widget_show(button); |
2060 | |
2061 #if 0 | |
2062 button = pref_button_new(NULL, GTK_STOCK_REMOVE, NULL, FALSE, | |
2063 G_CALLBACK(accel_remove_cb), accel_view); | |
2064 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
2065 gtk_widget_show(button); | |
2066 #endif | |
2067 | 1964 |
2068 button = pref_button_new(NULL, NULL, _("Reset selected"), FALSE, | 1965 button = pref_button_new(NULL, NULL, _("Reset selected"), FALSE, |
2069 G_CALLBACK(accel_reset_cb), accel_view); | 1966 G_CALLBACK(accel_reset_cb), accel_view); |
2070 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | 1967 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
2071 gtk_widget_show(button); | 1968 gtk_widget_show(button); |
2072 | |
2073 #if 0 | |
2074 button = pref_button_new(NULL, _("Add Alt"), NULL, FALSE, | |
2075 G_CALLBACK(accel_add_alt_cb), accel_view); | |
2076 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
2077 gtk_widget_show(button); | |
2078 #endif | |
2079 #endif | |
2080 } | 1969 } |
2081 | 1970 |
2082 /* stereo tab */ | 1971 /* stereo tab */ |
2083 static void config_tab_stereo(GtkWidget *notebook) | 1972 static void config_tab_stereo(GtkWidget *notebook) |
2084 { | 1973 { |
2186 gtk_widget_show(hbox); | 2075 gtk_widget_show(hbox); |
2187 | 2076 |
2188 button = pref_button_new(NULL, GTK_STOCK_OK, NULL, FALSE, | 2077 button = pref_button_new(NULL, GTK_STOCK_OK, NULL, FALSE, |
2189 G_CALLBACK(config_window_ok_cb), NULL); | 2078 G_CALLBACK(config_window_ok_cb), NULL); |
2190 gtk_container_add(GTK_CONTAINER(hbox), button); | 2079 gtk_container_add(GTK_CONTAINER(hbox), button); |
2191 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | 2080 gtk_widget_set_can_default(button, TRUE); |
2192 gtk_widget_grab_default(button); | 2081 gtk_widget_grab_default(button); |
2193 gtk_widget_show(button); | 2082 gtk_widget_show(button); |
2194 | 2083 |
2195 ct_button = button; | 2084 ct_button = button; |
2196 | 2085 |
2197 button = pref_button_new(NULL, GTK_STOCK_SAVE, NULL, FALSE, | 2086 button = pref_button_new(NULL, GTK_STOCK_SAVE, NULL, FALSE, |
2198 G_CALLBACK(config_window_save_cb), NULL); | 2087 G_CALLBACK(config_window_save_cb), NULL); |
2199 gtk_container_add(GTK_CONTAINER(hbox), button); | 2088 gtk_container_add(GTK_CONTAINER(hbox), button); |
2200 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | 2089 gtk_widget_set_can_default(button, TRUE); |
2201 gtk_widget_show(button); | 2090 gtk_widget_show(button); |
2202 | 2091 |
2203 button = pref_button_new(NULL, GTK_STOCK_APPLY, NULL, FALSE, | 2092 button = pref_button_new(NULL, GTK_STOCK_APPLY, NULL, FALSE, |
2204 G_CALLBACK(config_window_apply_cb), NULL); | 2093 G_CALLBACK(config_window_apply_cb), NULL); |
2205 gtk_container_add(GTK_CONTAINER(hbox), button); | 2094 gtk_container_add(GTK_CONTAINER(hbox), button); |
2206 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | 2095 gtk_widget_set_can_default(button, TRUE); |
2207 gtk_widget_show(button); | 2096 gtk_widget_show(button); |
2208 | 2097 |
2209 button = pref_button_new(NULL, GTK_STOCK_CANCEL, NULL, FALSE, | 2098 button = pref_button_new(NULL, GTK_STOCK_CANCEL, NULL, FALSE, |
2210 G_CALLBACK(config_window_close_cb), NULL); | 2099 G_CALLBACK(config_window_close_cb), NULL); |
2211 gtk_container_add(GTK_CONTAINER(hbox), button); | 2100 gtk_container_add(GTK_CONTAINER(hbox), button); |
2212 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | 2101 gtk_widget_set_can_default(button, TRUE); |
2213 gtk_widget_show(button); | 2102 gtk_widget_show(button); |
2214 | 2103 |
2215 if (!generic_dialog_get_alternative_button_order(configwindow)) | 2104 if (!generic_dialog_get_alternative_button_order(configwindow)) |
2216 { | 2105 { |
2217 gtk_box_reorder_child(GTK_BOX(hbox), ct_button, -1); | 2106 gtk_box_reorder_child(GTK_BOX(hbox), ct_button, -1); |
2316 gtk_widget_show(button); | 2205 gtk_widget_show(button); |
2317 | 2206 |
2318 buf = g_strdup_printf(_("%s %s\n\nCopyright (c) 2006 John Ellis\nCopyright (c) %s The Geeqie Team\nwebsite: %s\nemail: %s\n\nReleased under the GNU General Public License"), | 2207 buf = g_strdup_printf(_("%s %s\n\nCopyright (c) 2006 John Ellis\nCopyright (c) %s The Geeqie Team\nwebsite: %s\nemail: %s\n\nReleased under the GNU General Public License"), |
2319 GQ_APPNAME, | 2208 GQ_APPNAME, |
2320 VERSION, | 2209 VERSION, |
2321 "2008 - 2010", | 2210 "2008 - 2012", |
2322 GQ_WEBSITE, | 2211 GQ_WEBSITE, |
2323 GQ_EMAIL_ADDRESS); | 2212 GQ_EMAIL_ADDRESS); |
2324 label = gtk_label_new(buf); | 2213 label = gtk_label_new(buf); |
2325 g_free(buf); | 2214 g_free(buf); |
2326 | 2215 |
2335 gtk_widget_show(hbox); | 2224 gtk_widget_show(hbox); |
2336 | 2225 |
2337 button = pref_button_new(NULL, NULL, _("Credits..."), FALSE, | 2226 button = pref_button_new(NULL, NULL, _("Credits..."), FALSE, |
2338 G_CALLBACK(about_credits_cb), NULL); | 2227 G_CALLBACK(about_credits_cb), NULL); |
2339 gtk_container_add(GTK_CONTAINER(hbox), button); | 2228 gtk_container_add(GTK_CONTAINER(hbox), button); |
2340 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | 2229 gtk_widget_set_can_default(button, TRUE); |
2341 gtk_widget_show(button); | 2230 gtk_widget_show(button); |
2342 | 2231 |
2343 button = pref_button_new(NULL, GTK_STOCK_CLOSE, NULL, FALSE, | 2232 button = pref_button_new(NULL, GTK_STOCK_CLOSE, NULL, FALSE, |
2344 G_CALLBACK(about_window_close), NULL); | 2233 G_CALLBACK(about_window_close), NULL); |
2345 gtk_container_add(GTK_CONTAINER(hbox), button); | 2234 gtk_container_add(GTK_CONTAINER(hbox), button); |
2346 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | 2235 gtk_widget_set_can_default(button, TRUE); |
2347 gtk_widget_grab_default(button); | 2236 gtk_widget_grab_default(button); |
2348 gtk_widget_show(button); | 2237 gtk_widget_show(button); |
2349 | 2238 |
2350 gtk_widget_show(about); | 2239 gtk_widget_show(about); |
2351 } | 2240 } |