예제 #1
0
파일: FileHistory.cpp 프로젝트: Marlinc/0ad
void FileHistory::Save(wxConfigBase& config)
{
	wxString old = config.GetPath();
	config.SetPath(m_configSubdir);
	wxFileHistory::Save(config);
	config.SetPath(old);
}
예제 #2
0
void FileHistory::LoadFromSubDir(wxConfigBase& config)
{
	wxString old = config.GetPath();
	config.SetPath(m_configSubdir);
	Load(config);
	config.SetPath(old);
}
예제 #3
0
void wxSTEditorOptions::SaveFileConfig(wxConfigBase &config)
{
    const wxString oldpath = config.GetPath();
    wxFileHistory *fileHistory = GetFileHistory();
    if (!fileHistory)
        return;

    wxString configPath = FixConfigPath(GetConfigPath(STE_OPTION_CFGPATH_FILEHISTORY), false);
    config.Write(configPath+wxT("/LastDir"), GetDefaultFilePath());

    config.SetPath(configPath);
    fileHistory->Save(config);
    config.SetPath(oldpath);
}
예제 #4
0
void wxSTEditorOptions::LoadFileConfig( wxConfigBase &config)
{
    const wxString oldpath = config.GetPath();
    wxFileHistory *fileHistory = GetFileHistory();
    if (!fileHistory)
        return;

    wxString configPath = FixConfigPath(GetConfigPath(STE_OPTION_CFGPATH_FILEHISTORY), false);
    wxString value, key = configPath+wxT("/LastDir");
    if (config.Read(key, &value) && wxDirExists(value))
        SetDefaultFilePath(value);

    config.SetPath(configPath);
    fileHistory->Load(config);
    config.SetPath(oldpath);
}