gboolean save_setup (gboolean save_options, gboolean save_panel_options) { gboolean ret = TRUE; saving_setup = 1; save_hotlist (); if (save_panel_options) save_panel_types (); if (save_options) { char *tmp_profile; save_config (); save_layout (); panels_save_options (); save_panelize (); /* directory_history_save (); */ #ifdef ENABLE_VFS_FTP mc_config_set_string (mc_main_config, CONFIG_MISC_SECTION, "ftpfs_password", ftpfs_anonymous_passwd); if (ftpfs_proxy_host) mc_config_set_string (mc_main_config, CONFIG_MISC_SECTION, "ftp_proxy_host", ftpfs_proxy_host); #endif /* ENABLE_VFS_FTP */ #ifdef HAVE_CHARSET mc_config_set_string (mc_main_config, CONFIG_MISC_SECTION, "display_codepage", get_codepage_id (mc_global.display_codepage)); mc_config_set_string (mc_main_config, CONFIG_MISC_SECTION, "source_codepage", get_codepage_id (default_source_codepage)); mc_config_set_string (mc_main_config, CONFIG_MISC_SECTION, "autodetect_codeset", autodetect_codeset); #endif /* HAVE_CHARSET */ #ifdef HAVE_ASPELL mc_config_set_string (mc_main_config, CONFIG_MISC_SECTION, "spell_language", spell_language); #endif /* HAVE_ASPELL */ mc_config_set_string (mc_main_config, CONFIG_MISC_SECTION, "clipboard_store", clipboard_store_path); mc_config_set_string (mc_main_config, CONFIG_MISC_SECTION, "clipboard_paste", clipboard_paste_path); tmp_profile = mc_config_get_full_path (MC_CONFIG_FILE); ret = mc_config_save_to_file (mc_main_config, tmp_profile, NULL); g_free (tmp_profile); } saving_setup = 0; return ret; }
void save_setup (void) { char *profile; #ifdef USE_VFS #ifdef USE_NETCODE extern char *ftpfs_anonymous_passwd; extern char *ftpfs_proxy_host; #endif #endif saving_setup = 1; profile = concat_dir_and_file (home_dir, PROFILE_NAME); save_layout (); save_configure (); save_string ("Dirs", "other_dir", get_other_type () == view_listing ? opanel->cwd : ".", profile); WritePrivateProfileString ("Dirs", "current_is_left", get_current_index () == 0 ? "1" : "0", profile); save_hotlist (); save_panelize (); save_panel_types (); /* directory_history_save (); */ #ifdef USE_VFS #ifdef USE_NETCODE WritePrivateProfileString ("Misc", "ftpfs_password", ftpfs_anonymous_passwd, profile); if (ftpfs_proxy_host) WritePrivateProfileString ("Misc", "ftp_proxy_host", ftpfs_proxy_host, profile); #endif #endif free (profile); saving_setup = 0; }