Mercurial > geeqie.yaz
comparison src/rcfile.c @ 341:15c6b94545a2
Move safe_delete* and in place rename options to file_ops
struct.
Re-order rc file a bit.
author | zas_ |
---|---|
date | Sat, 12 Apr 2008 22:04:29 +0000 |
parents | 77103f3f2cb1 |
children | 07490120df2d |
comparison
equal
deleted
inserted
replaced
340:77103f3f2cb1 | 341:15c6b94545a2 |
---|---|
287 write_char_option(ssi, "startup_path", options->startup_path); | 287 write_char_option(ssi, "startup_path", options->startup_path); |
288 | 288 |
289 write_bool_option(ssi, "progressive_keyboard_scrolling", options->progressive_key_scrolling); | 289 write_bool_option(ssi, "progressive_keyboard_scrolling", options->progressive_key_scrolling); |
290 write_bool_option(ssi, "local_metadata", options->enable_metadata_dirs); | 290 write_bool_option(ssi, "local_metadata", options->enable_metadata_dirs); |
291 | 291 |
292 write_bool_option(ssi, "confirm_delete", options->confirm_delete); | |
293 write_bool_option(ssi, "enable_delete_key", options->enable_delete_key); | |
294 write_bool_option(ssi, "safe_delete", options->safe_delete_enable); | |
295 write_char_option(ssi, "safe_delete_path", options->safe_delete_path); | |
296 write_int_option(ssi, "safe_delete_size", options->safe_delete_size); | |
297 secure_fputc(ssi, '\n'); | |
298 | |
299 write_int_option(ssi, "custom_similarity_threshold", options->dupe_custom_threshold); | 292 write_int_option(ssi, "custom_similarity_threshold", options->dupe_custom_threshold); |
300 secure_fputc(ssi, '\n'); | 293 secure_fputc(ssi, '\n'); |
301 | 294 |
302 write_bool_option(ssi, "mouse_wheel_scrolls", options->mousewheel_scrolls); | 295 write_bool_option(ssi, "mouse_wheel_scrolls", options->mousewheel_scrolls); |
303 write_bool_option(ssi, "in_place_rename", options->enable_in_place_rename); | |
304 write_int_option(ssi, "open_recent_max", options->recent_list_max); | 296 write_int_option(ssi, "open_recent_max", options->recent_list_max); |
305 write_bool_option(ssi, "display_dialogs_under_mouse", options->place_dialogs_under_mouse); | 297 write_bool_option(ssi, "display_dialogs_under_mouse", options->place_dialogs_under_mouse); |
306 | 298 |
307 | 299 |
300 secure_fprintf(ssi, "\n##### File operations Options #####\n\n"); | |
301 | |
302 write_bool_option(ssi, "file_ops.enable_in_place_rename", options->file_ops.enable_in_place_rename); | |
303 write_bool_option(ssi, "file_ops.confirm_delete", options->file_ops.confirm_delete); | |
304 write_bool_option(ssi, "file_ops.enable_delete_key", options->file_ops.enable_delete_key); | |
305 write_bool_option(ssi, "file_ops.safe_delete_enable", options->file_ops.safe_delete_enable); | |
306 write_char_option(ssi, "file_ops.safe_delete_path", options->file_ops.safe_delete_path); | |
307 write_int_option(ssi, "file_ops.safe_delete_folder_maxsize", options->file_ops.safe_delete_folder_maxsize); | |
308 | |
309 | |
308 secure_fprintf(ssi, "\n##### Layout Options #####\n\n"); | 310 secure_fprintf(ssi, "\n##### Layout Options #####\n\n"); |
309 | 311 |
310 write_int_option(ssi, "layout.style", options->layout.style); | 312 write_int_option(ssi, "layout.style", options->layout.style); |
311 write_char_option(ssi, "layout.order", options->layout.order); | 313 write_char_option(ssi, "layout.order", options->layout.order); |
312 write_bool_option(ssi, "layout.view_as_icons", options->layout.view_as_icons); | 314 write_bool_option(ssi, "layout.view_as_icons", options->layout.view_as_icons); |
537 strncpy(value_all, s_buf_ptr, sizeof(value_all)); | 539 strncpy(value_all, s_buf_ptr, sizeof(value_all)); |
538 while (s_buf[c] != 8 && s_buf[c] != ' ' && s_buf[c] != '\n' && c < l) c++; | 540 while (s_buf[c] != 8 && s_buf[c] != ' ' && s_buf[c] != '\n' && c < l) c++; |
539 s_buf[c] = '\0'; | 541 s_buf[c] = '\0'; |
540 strncpy(option, s_buf, sizeof(option)); | 542 strncpy(option, s_buf, sizeof(option)); |
541 strncpy(value, s_buf_ptr, sizeof(value)); | 543 strncpy(value, s_buf_ptr, sizeof(value)); |
544 | |
545 | |
546 /* general options */ | |
547 options->show_icon_names = read_bool_option(f, option, | |
548 "show_icon_names", value, options->show_icon_names); | |
549 | |
550 options->tree_descend_subdirs = read_bool_option(f, option, | |
551 "tree_descend_folders", value, options->tree_descend_subdirs); | |
552 options->lazy_image_sync = read_bool_option(f, option, | |
553 "lazy_image_sync", value, options->lazy_image_sync); | |
554 options->update_on_time_change = read_bool_option(f, option, | |
555 "update_on_time_change", value, options->update_on_time_change); | |
556 | |
557 options->startup_path_enable = read_bool_option(f, option, | |
558 "enable_startup_path", value, options->startup_path_enable); | |
559 options->startup_path = read_char_option(f, option, | |
560 "startup_path", value_all, options->startup_path); | |
561 | |
562 options->dupe_custom_threshold = read_int_option(f, option, | |
563 "custom_similarity_threshold", value, options->dupe_custom_threshold); | |
564 | |
565 options->progressive_key_scrolling = read_bool_option(f, option, | |
566 "progressive_keyboard_scrolling", value, options->progressive_key_scrolling); | |
567 | |
568 options->enable_metadata_dirs = read_bool_option(f, option, | |
569 "local_metadata", value, options->enable_metadata_dirs); | |
570 | |
571 options->mousewheel_scrolls = read_bool_option(f, option, | |
572 "mouse_wheel_scrolls", value, options->mousewheel_scrolls); | |
573 | |
574 options->recent_list_max = read_int_option(f, option, | |
575 "open_recent_max", value, options->recent_list_max); | |
576 | |
577 options->place_dialogs_under_mouse = read_bool_option(f, option, | |
578 "display_dialogs_under_mouse", value, options->place_dialogs_under_mouse); | |
579 | |
542 | 580 |
543 /* layout options */ | 581 /* layout options */ |
544 | 582 |
545 options->layout.style = read_int_option(f, option, | 583 options->layout.style = read_int_option(f, option, |
546 "layout.style", value, options->layout.style); | 584 "layout.style", value, options->layout.style); |
589 options->layout.tools_restore_state = read_bool_option(f, option, | 627 options->layout.tools_restore_state = read_bool_option(f, option, |
590 "layout.tools_restore_state", value, options->layout.tools_restore_state); | 628 "layout.tools_restore_state", value, options->layout.tools_restore_state); |
591 options->layout.toolbar_hidden = read_bool_option(f, option, | 629 options->layout.toolbar_hidden = read_bool_option(f, option, |
592 "layout.toolbar_hidden", value, options->layout.toolbar_hidden); | 630 "layout.toolbar_hidden", value, options->layout.toolbar_hidden); |
593 | 631 |
594 | |
595 /* general options */ | |
596 options->show_icon_names = read_bool_option(f, option, | |
597 "show_icon_names", value, options->show_icon_names); | |
598 | |
599 options->tree_descend_subdirs = read_bool_option(f, option, | |
600 "tree_descend_folders", value, options->tree_descend_subdirs); | |
601 options->lazy_image_sync = read_bool_option(f, option, | |
602 "lazy_image_sync", value, options->lazy_image_sync); | |
603 options->update_on_time_change = read_bool_option(f, option, | |
604 "update_on_time_change", value, options->update_on_time_change); | |
605 | |
606 options->startup_path_enable = read_bool_option(f, option, | |
607 "enable_startup_path", value, options->startup_path_enable); | |
608 options->startup_path = read_char_option(f, option, | |
609 "startup_path", value_all, options->startup_path); | |
610 | 632 |
611 /* image options */ | 633 /* image options */ |
612 if (strcasecmp(option, "image.zoom_mode") == 0) | 634 if (strcasecmp(option, "image.zoom_mode") == 0) |
613 { | 635 { |
614 if (strcasecmp(value, "original") == 0) options->image.zoom_mode = ZOOM_RESET_ORIGINAL; | 636 if (strcasecmp(value, "original") == 0) options->image.zoom_mode = ZOOM_RESET_ORIGINAL; |
646 options->image.use_custom_border_color = read_bool_option(f, option, | 668 options->image.use_custom_border_color = read_bool_option(f, option, |
647 "image.use_custom_border_color", value, options->image.use_custom_border_color); | 669 "image.use_custom_border_color", value, options->image.use_custom_border_color); |
648 read_color_option(f, option, | 670 read_color_option(f, option, |
649 "image.border_color", value, &options->image.border_color); | 671 "image.border_color", value, &options->image.border_color); |
650 | 672 |
651 options->progressive_key_scrolling = read_bool_option(f, option, | |
652 "progressive_keyboard_scrolling", value, options->progressive_key_scrolling); | |
653 | |
654 | 673 |
655 /* thumbnails options */ | 674 /* thumbnails options */ |
656 options->thumbnails.max_width = read_int_option(f, option, | 675 options->thumbnails.max_width = read_int_option(f, option, |
657 "thumbnails.max_width", value, options->thumbnails.max_width); | 676 "thumbnails.max_width", value, options->thumbnails.max_width); |
658 if (options->thumbnails.max_width < 16) options->thumbnails.max_width = 16; | 677 if (options->thumbnails.max_width < 16) options->thumbnails.max_width = 16; |
670 options->thumbnails.spec_standard = read_bool_option(f, option, | 689 options->thumbnails.spec_standard = read_bool_option(f, option, |
671 "thumbnails.spec_standard", value, options->thumbnails.spec_standard); | 690 "thumbnails.spec_standard", value, options->thumbnails.spec_standard); |
672 options->thumbnails.quality = CLAMP(read_int_option(f, option, | 691 options->thumbnails.quality = CLAMP(read_int_option(f, option, |
673 "thumbnails.quality", value, options->thumbnails.quality), GDK_INTERP_NEAREST, GDK_INTERP_HYPER); | 692 "thumbnails.quality", value, options->thumbnails.quality), GDK_INTERP_NEAREST, GDK_INTERP_HYPER); |
674 | 693 |
675 options->enable_metadata_dirs = read_bool_option(f, option, | |
676 "local_metadata", value, options->enable_metadata_dirs); | |
677 | |
678 /* file sorting options */ | 694 /* file sorting options */ |
679 options->file_sort.method = (SortType)read_int_option(f, option, | 695 options->file_sort.method = (SortType)read_int_option(f, option, |
680 "file_sort.method", value, (gint)options->file_sort.method); | 696 "file_sort.method", value, (gint)options->file_sort.method); |
681 options->file_sort.ascending = read_bool_option(f, option, | 697 options->file_sort.ascending = read_bool_option(f, option, |
682 "file_sort.ascending", value, options->file_sort.ascending); | 698 "file_sort.ascending", value, options->file_sort.ascending); |
683 options->file_sort.case_sensitive = read_bool_option(f, option, | 699 options->file_sort.case_sensitive = read_bool_option(f, option, |
684 "file_sort.case_sensitive", value, options->file_sort.case_sensitive); | 700 "file_sort.case_sensitive", value, options->file_sort.case_sensitive); |
685 | 701 |
686 options->confirm_delete = read_bool_option(f, option, | 702 /* file operations options */ |
687 "confirm_delete", value, options->confirm_delete); | 703 options->file_ops.enable_in_place_rename = read_bool_option(f, option, |
688 options->enable_delete_key = read_bool_option(f, option, | 704 "file_ops.enable_in_place_rename", value, options->file_ops.enable_in_place_rename); |
689 "enable_delete_key", value, options->enable_delete_key); | 705 options->file_ops.confirm_delete = read_bool_option(f, option, |
690 options->safe_delete_enable = read_bool_option(f, option, | 706 "file_ops.confirm_delete", value, options->file_ops.confirm_delete); |
691 "safe_delete", value, options->safe_delete_enable); | 707 options->file_ops.enable_delete_key = read_bool_option(f, option, |
692 options->safe_delete_path = read_char_option(f, option, | 708 "file_ops.enable_delete_key", value, options->file_ops.enable_delete_key); |
693 "safe_delete_path", value, options->safe_delete_path); | 709 options->file_ops.safe_delete_enable = read_bool_option(f, option, |
694 options->safe_delete_size = read_int_option(f, option, | 710 "file_ops.safe_delete_enable", value, options->file_ops.safe_delete_enable); |
695 "safe_delete_size", value,options->safe_delete_size); | 711 options->file_ops.safe_delete_path = read_char_option(f, option, |
696 | 712 "file_ops.safe_delete_path", value, options->file_ops.safe_delete_path); |
697 options->mousewheel_scrolls = read_bool_option(f, option, | 713 options->file_ops.safe_delete_folder_maxsize = read_int_option(f, option, |
698 "mouse_wheel_scrolls", value, options->mousewheel_scrolls); | 714 "file_ops.safe_delete_folder_maxsize", value,options->file_ops.safe_delete_folder_maxsize); |
699 options->enable_in_place_rename = read_bool_option(f, option, | 715 |
700 "in_place_rename", value, options->enable_in_place_rename); | 716 /* fullscreen options */ |
701 | |
702 options->recent_list_max = read_int_option(f, option, | |
703 "open_recent_max", value, options->recent_list_max); | |
704 | |
705 options->place_dialogs_under_mouse = read_bool_option(f, option, | |
706 "display_dialogs_under_mouse", value, options->place_dialogs_under_mouse); | |
707 | |
708 options->fullscreen.screen = read_int_option(f, option, | 717 options->fullscreen.screen = read_int_option(f, option, |
709 "fullscreen.screen", value, options->fullscreen.screen); | 718 "fullscreen.screen", value, options->fullscreen.screen); |
710 options->fullscreen.clean_flip = read_bool_option(f, option, | 719 options->fullscreen.clean_flip = read_bool_option(f, option, |
711 "fullscreen.clean_flip", value, options->fullscreen.clean_flip); | 720 "fullscreen.clean_flip", value, options->fullscreen.clean_flip); |
712 options->fullscreen.disable_saver = read_bool_option(f, option, | 721 options->fullscreen.disable_saver = read_bool_option(f, option, |
715 "fullscreen.above", value, options->fullscreen.above); | 724 "fullscreen.above", value, options->fullscreen.above); |
716 options->fullscreen.show_info = read_bool_option(f, option, | 725 options->fullscreen.show_info = read_bool_option(f, option, |
717 "fullscreen.show_info", value, options->fullscreen.show_info); | 726 "fullscreen.show_info", value, options->fullscreen.show_info); |
718 options->fullscreen.info = read_char_option(f, option, | 727 options->fullscreen.info = read_char_option(f, option, |
719 "fullscreen.info", value_all, options->fullscreen.info); | 728 "fullscreen.info", value_all, options->fullscreen.info); |
720 | |
721 options->dupe_custom_threshold = read_int_option(f, option, | |
722 "custom_similarity_threshold", value, options->dupe_custom_threshold); | |
723 | 729 |
724 /* slideshow options */ | 730 /* slideshow options */ |
725 | 731 |
726 options->slideshow.delay = read_int_unit_option(f, option, | 732 options->slideshow.delay = read_int_unit_option(f, option, |
727 "slideshow.delay", value, options->slideshow.delay, SLIDESHOW_SUBSECOND_PRECISION); | 733 "slideshow.delay", value, options->slideshow.delay, SLIDESHOW_SUBSECOND_PRECISION); |