void FileHistory::Save(wxConfigBase& config) { wxString old = config.GetPath(); config.SetPath(m_configSubdir); wxFileHistory::Save(config); config.SetPath(old); }
void FileHistory::LoadFromSubDir(wxConfigBase& config) { wxString old = config.GetPath(); config.SetPath(m_configSubdir); Load(config); config.SetPath(old); }
void FileHistory::Save(wxConfigBase & config, const wxString & group) { config.DeleteGroup(group); config.SetPath(group); // Stored in reverse order int n = mHistory.GetCount() - 1; for (size_t i = 1; i <= mHistory.GetCount(); i++) { config.Write(wxString::Format(wxT("file%02d"), (int)i), mHistory[n--]); } config.SetPath(wxT("..")); }
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); }
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); }
void ButcherOptions::Load(wxConfigBase &config) { long rlong; config.SetPath(wxT("/options")); config.Read(wxT("editmode"), &rlong, EM_ADVANCED); editmode_=static_cast<editmode_t>(rlong); }
void FileHistory::Load(wxConfigBase & config, const wxString & group) { mHistory.Clear(); config.SetPath(group); wxString file; long ndx; bool got = config.GetFirstEntry(file, ndx); while (got) { AddFileToHistory(config.Read(file), false); got = config.GetNextEntry(file, ndx); } config.SetPath(wxT("..")); AddFilesToMenu(); }
void ButcherOptions::Save(wxConfigBase &config) { config.SetPath(wxT("/options")); config.Write(wxT("editmode"), static_cast<int>(editmode_)); }