Mercurial > geeqie
comparison src/main.c @ 1309:55ea4962887a
config file format changed to XML
save and restore all layout windows
save and restore sidebar configuration
author | nadvornik |
---|---|
date | Sun, 22 Feb 2009 15:35:37 +0000 |
parents | 7ac9664242b2 |
children | 1ffa5222dc61 |
comparison
equal
deleted
inserted
replaced
1308:2320339ca8be | 1309:55ea4962887a |
---|---|
664 if (exit_confirm_dlg()) return; | 664 if (exit_confirm_dlg()) return; |
665 | 665 |
666 exit_program_final(); | 666 exit_program_final(); |
667 } | 667 } |
668 | 668 |
669 void init_after_global_options(void) | |
670 { | |
671 | |
672 if (gtk_major_version < GTK_MAJOR_VERSION || | |
673 (gtk_major_version == GTK_MAJOR_VERSION && gtk_minor_version < GTK_MINOR_VERSION) ) | |
674 { | |
675 log_printf("!!! This is a friendly warning.\n"); | |
676 log_printf("!!! The version of GTK+ in use now is older than when %s was compiled.\n", GQ_APPNAME); | |
677 log_printf("!!! compiled with GTK+-%d.%d\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION); | |
678 log_printf("!!! running with GTK+-%d.%d\n", gtk_major_version, gtk_minor_version); | |
679 log_printf("!!! %s may quit unexpectedly with a relocation error.\n", GQ_APPNAME); | |
680 } | |
681 | |
682 mkdir_if_not_exists(get_rc_dir()); | |
683 mkdir_if_not_exists(get_collections_dir()); | |
684 mkdir_if_not_exists(get_thumbnails_cache_dir()); | |
685 mkdir_if_not_exists(get_metadata_cache_dir()); | |
686 | |
687 keys_load(); | |
688 | |
689 editor_load_descriptions(); | |
690 | |
691 accel_map_load(); | |
692 } | |
669 | 693 |
670 | 694 |
671 /* This code is supposed to handle situation when a file mmaped by image_loader | 695 /* This code is supposed to handle situation when a file mmaped by image_loader |
672 * or by exif loader is truncated by some other process. | 696 * or by exif loader is truncated by some other process. |
673 * This is probably not completely correct according to posix, because | 697 * This is probably not completely correct according to posix, because |
749 | 773 |
750 parse_command_line_for_debug_option(argc, argv); | 774 parse_command_line_for_debug_option(argc, argv); |
751 | 775 |
752 options = init_options(NULL); | 776 options = init_options(NULL); |
753 setup_default_options(options); | 777 setup_default_options(options); |
778 | |
779 gtkrc_load(); //FIXME: move to init_after_global_options() | |
780 gtk_init(&argc, &argv); | |
781 | |
782 | |
754 load_options(options); | 783 load_options(options); |
755 | 784 /* ^^^ this calls init_after_global_options(); at the right moment*/ |
756 gtkrc_load(); | 785 |
757 gtk_init(&argc, &argv); | 786 if (!layout_window_list) |
758 | 787 { // FIXME: commandline handling does not work at all, this is a quick workaround for missing rc file |
788 | |
789 init_after_global_options(); | |
759 parse_command_line(argc, argv, &cmd_path, &cmd_file, &cmd_list, &collection_list, &geometry); | 790 parse_command_line(argc, argv, &cmd_path, &cmd_file, &cmd_list, &collection_list, &geometry); |
760 | |
761 if (gtk_major_version < GTK_MAJOR_VERSION || | |
762 (gtk_major_version == GTK_MAJOR_VERSION && gtk_minor_version < GTK_MINOR_VERSION) ) | |
763 { | |
764 log_printf("!!! This is a friendly warning.\n"); | |
765 log_printf("!!! The version of GTK+ in use now is older than when %s was compiled.\n", GQ_APPNAME); | |
766 log_printf("!!! compiled with GTK+-%d.%d\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION); | |
767 log_printf("!!! running with GTK+-%d.%d\n", gtk_major_version, gtk_minor_version); | |
768 log_printf("!!! %s may quit unexpectedly with a relocation error.\n", GQ_APPNAME); | |
769 } | |
770 | |
771 mkdir_if_not_exists(get_rc_dir()); | |
772 mkdir_if_not_exists(get_collections_dir()); | |
773 mkdir_if_not_exists(get_thumbnails_cache_dir()); | |
774 mkdir_if_not_exists(get_metadata_cache_dir()); | |
775 | |
776 keys_load(); | |
777 filter_add_defaults(); | |
778 filter_rebuild(); | |
779 | |
780 editor_load_descriptions(); | |
781 | |
782 accel_map_load(); | |
783 | 791 |
784 if (startup_blank) | 792 if (startup_blank) |
785 { | 793 { |
786 g_free(cmd_path); | 794 g_free(cmd_path); |
787 cmd_path = NULL; | 795 cmd_path = NULL; |
805 else | 813 else |
806 { | 814 { |
807 path = get_current_dir(); | 815 path = get_current_dir(); |
808 } | 816 } |
809 | 817 |
810 lw = layout_new_with_geometry(NULL, options->layout.tools_float, options->layout.tools_hidden, geometry); | 818 lw = layout_new_with_geometry(NULL, NULL, geometry); |
811 layout_sort_set(lw, options->file_sort.method, options->file_sort.ascending); | 819 layout_sort_set(lw, options->file_sort.method, options->file_sort.ascending); |
812 | 820 |
813 if (collection_list && !startup_command_line_collection) | 821 if (collection_list && !startup_command_line_collection) |
814 { | 822 { |
815 GList *work; | 823 GList *work; |
891 collection_get_first(first_collection)); | 899 collection_get_first(first_collection)); |
892 } | 900 } |
893 } | 901 } |
894 | 902 |
895 image_osd_set(lw->image, options->image_overlay.common.state | (options->image_overlay.common.show_at_startup ? OSD_SHOW_INFO : OSD_SHOW_NOTHING)); | 903 image_osd_set(lw->image, options->image_overlay.common.state | (options->image_overlay.common.show_at_startup ? OSD_SHOW_INFO : OSD_SHOW_NOTHING)); |
904 | |
905 } | |
896 | 906 |
897 g_free(geometry); | 907 g_free(geometry); |
898 g_free(cmd_path); | 908 g_free(cmd_path); |
899 g_free(cmd_file); | 909 g_free(cmd_file); |
900 filelist_free(cmd_list); | 910 filelist_free(cmd_list); |