CScopeSettingsDlg::CScopeSettingsDlg(wxWindow* parent) : CScopeSettingsDlgBase(parent) { CScopeConfData settings; EditorConfigST::Get()->ReadObject("CscopeSettings", &settings); m_filePickerCScopeExe->SetPath(settings.GetCscopeExe()); WindowAttrManager::Load(this, "CScopeSettingsDlg"); }
void Cscope::OnDoSettings(wxCommandEvent& e) { // atm the only setting to set is the cscope filepath // First find the current value, if any CScopeConfData settings; m_mgr->GetConfigTool()->ReadObject(wxT("CscopeSettings"), &settings); wxString filepath = settings.GetCscopeExe(); CScopeSettingsDlg dlg(EventNotifier::Get()->TopFrame()); if(dlg.ShowModal() == wxID_OK) { settings.SetCscopeExe(dlg.GetPath()); m_mgr->GetConfigTool()->WriteObject(wxT("CscopeSettings"), &settings); } }
void Cscope::OnDoSettings(wxCommandEvent &e) { // atm the only setting to set is the cscope filepath // First find the current value, if any CScopeConfData settings; m_mgr->GetConfigTool()->ReadObject(wxT("CscopeSettings"), &settings); wxString filepath = settings.GetCscopeExe(); // Since there's only the one thing to ask, keep it simple for now wxString fp = wxGetTextFromUser(_("Please enter the filepath where cscope can be found"), _("Where is cscope?"), filepath); if ( fp.IsEmpty() ) { return; } settings.SetCscopeExe(fp); m_mgr->GetConfigTool()->WriteObject(wxT("CscopeSettings"), &settings); }
wxString Cscope::GetCscopeExeName() { CScopeConfData settings; m_mgr->GetConfigTool()->ReadObject(wxT("CscopeSettings"), &settings); return settings.GetCscopeExe(); }