void PhpPlugin::OnNewWorkspace(clCommandEvent& e) { e.Skip(); if(e.GetString() == PHPWorkspace::Get()->GetWorkspaceType()) { e.Skip(false); // Create a PHP workspace NewPHPWorkspaceDlg newWspDlg(m_mgr->GetTheApp()->GetTopWindow()); if(newWspDlg.ShowModal() == wxID_OK) { PHPWorkspace::Get()->Create(newWspDlg.GetWorkspacePath()); DoOpenWorkspace(newWspDlg.GetWorkspacePath(), false /* create if missing */, newWspDlg.IsCreateProject()); } } }
void PhpPlugin::OnNewWorkspace(wxCommandEvent& e) { NewWorkspaceSelectionDlg dlg(FRAME); if(dlg.ShowModal() == wxID_OK) { if(dlg.GetIsPHPWorkspace()) { // Create a PHP workspace NewPHPWorkspaceDlg newWspDlg(m_mgr->GetTheApp()->GetTopWindow()); if(newWspDlg.ShowModal() == wxID_OK) { PHPWorkspace::Get()->Create(newWspDlg.GetWorkspacePath()); DoOpenWorkspace(newWspDlg.GetWorkspacePath()); } } else { // Call skip so the normal new workspace dialog will popup e.Skip(); } } }
void PhpPlugin::OnNewWorkspace(clCommandEvent& e) { e.Skip(); if(e.GetString() == PHPWorkspace::Get()->GetWorkspaceType()) { e.Skip(false); // Create a PHP workspace NewPHPWorkspaceDlg newWspDlg(m_mgr->GetTheApp()->GetTopWindow()); if(newWspDlg.ShowModal() == wxID_OK) { // Ensure that the workspace path exists wxFileName workspaceFile(newWspDlg.GetWorkspacePath()); if(!workspaceFile.Mkdir(wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL)) { ::wxMessageBox(wxString::Format(_("Could not create workspace folder:\n%s"), workspaceFile.GetPath()), "CodeLite", wxICON_ERROR | wxOK | wxCENTER); return; } PHPWorkspace::Get()->Create(newWspDlg.GetWorkspacePath()); DoOpenWorkspace(newWspDlg.GetWorkspacePath(), false /* create if missing */, newWspDlg.IsCreateProject()); } } }