wxCrafterCBSettings& wxCrafterCBSettings::Load() { wxFileName fnConfig(wxStandardPaths::Get().GetUserConfigDir(), wxT(".wxCrafterCB.conf")); JSONRoot root( fnConfig ); FromJSON( root.toElement() ); return *this; }
wxCrafterCBSettings& wxCrafterCBSettings::Save() { wxFileName fnConfig(wxStandardPaths::Get().GetUserConfigDir(), wxT(".wxCrafterCB.conf")); JSONRoot root(cJSON_Object); JSONElement json = root.toElement(); ToJSON( json ); root.save( fnConfig ); return *this; }
wxString SubversionLocalProperties::GetConfigFile() { wxFileName fnConfig(clStandardPaths::Get().GetUserDataDir(), "codelite-properties.ini"); fnConfig.AppendDir("subversion"); fnConfig.Mkdir(wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL); if(!fnConfig.Exists()) { // Create an empty file FileUtils::WriteFileContent(fnConfig, ""); } return fnConfig.GetFullPath(); }
// Debugger events void PhpPlugin::OnDebugEnded(XDebugEvent& e) { e.Skip(); // Save the layout wxFileName fnConfig(clStandardPaths::Get().GetUserDataDir(), "xdebug-perspective"); fnConfig.AppendDir("config"); wxFFile fp(fnConfig.GetFullPath(), "w+b"); if(fp.IsOpened()) { fp.Write(m_mgr->GetDockingManager()->SavePerspective()); fp.Close(); } if(!m_savedPerspective.IsEmpty()) { m_mgr->GetDockingManager()->LoadPerspective(m_savedPerspective); m_savedPerspective.Clear(); } }
void PhpPlugin::DoEnsureXDebugPanesVisible(const wxString& selectWindow) { // Save the current layout to be the normal layout m_savedPerspective = m_mgr->GetDockingManager()->SavePerspective(); m_debuggerPane->SelectTab(selectWindow); // If we have an old perspective, load it wxFileName fnConfig(clStandardPaths::Get().GetUserDataDir(), "xdebug-perspective"); fnConfig.AppendDir("config"); if(fnConfig.Exists()) { wxFFile fp(fnConfig.GetFullPath(), "rb"); if(fp.IsOpened()) { wxString perspective; fp.ReadAll(&perspective); m_mgr->GetDockingManager()->LoadPerspective(perspective, false); } } EnsureAuiPaneIsVisible("XDebug"); EnsureAuiPaneIsVisible("XDebugEval"); EnsureAuiPaneIsVisible("XDebugLocals", true); }