COptions::COptions() { m_theOptions = this; m_pXmlFile = 0; m_pLastServer = 0; SetDefaultValues(); m_save_timer.SetOwner(this); auto const nameOptionMap = GetNameOptionMap(); LoadGlobalDefaultOptions(nameOptionMap); CLocalPath const dir = InitSettingsDir(); CInterProcessMutex mutex(MUTEX_OPTIONS); m_pXmlFile = new CXmlFile(dir.GetPath() + _T("filezilla.xml")); if (!m_pXmlFile->Load()) { wxString msg = m_pXmlFile->GetError() + _T("\n\n") + _("For this session the default settings will be used. Any changes to the settings will not be saved."); wxMessageBoxEx(msg, _("Error loading xml file"), wxICON_ERROR); delete m_pXmlFile; m_pXmlFile = 0; } else CreateSettingsXmlElement(); LoadOptions(nameOptionMap); }
void COptions::Import(pugi::xml_node element) { LoadOptions(GetNameOptionMap(), element); if (!m_save_timer.IsRunning()) { m_save_timer.Start(15000, true); } }
COptions::COptions() { m_theOptions = this; m_pXmlFile = 0; m_pLastServer = 0; m_acquired = false; SetDefaultValues(); m_save_timer.SetOwner(this); std::map<std::string, int> nameOptionMap; GetNameOptionMap(nameOptionMap); LoadGlobalDefaultOptions(nameOptionMap); InitSettingsDir(); CInterProcessMutex mutex(MUTEX_OPTIONS); m_pXmlFile = new CXmlFile(_T("filezilla")); if (!m_pXmlFile->Load(wxFileName())) { wxString msg = m_pXmlFile->GetError() + _T("\n\n") + _("For this session the default settings will be used. Any changes to the settings will not be saved."); wxMessageBox(msg, _("Error loading xml file"), wxICON_ERROR); delete m_pXmlFile; m_pXmlFile = 0; } else CreateSettingsXmlElement(); LoadOptions(nameOptionMap); }
void COptions::Import(TiXmlElement* pElement) { std::map<std::string, int> nameOptionMap; GetNameOptionMap(nameOptionMap); LoadOptions(nameOptionMap, pElement); if (!m_save_timer.IsRunning()) m_save_timer.Start(15000, true); }
void COptions::Import(TiXmlElement* pElement) { LoadOptions(GetNameOptionMap(), pElement); if (!m_save_timer.IsRunning()) m_save_timer.Start(15000, true); }