void PhpPlugin::OnNewProject(clNewProjectEvent& e)
{
    if(!PHPWorkspace::Get()->IsOpen()) {
        e.Skip();
#if 0
        // No workspace is opened yet, let codelite process this event normally
        e.Skip();
        clNewProjectEvent::Template phpTemplate;
        phpTemplate.m_category = "PHP";
        phpTemplate.m_categoryPng = "m_bmpElephant";
        phpTemplate.m_template = "PHP Project";
        phpTemplate.m_templatePng = "m_bmpPhpFile";
        phpTemplate.m_debugger = "XDebug";
        phpTemplate.m_toolchain = "PHP Tools";
        phpTemplate.m_allowSeparateFolder = true;
        e.GetTemplates().push_back(phpTemplate);
#endif
    } else {
        // we have a PHP workspace opened - handle it ourself
        NewPHPProjectWizard wiz(EventNotifier::Get()->TopFrame());
        if(wiz.RunWizard(wiz.GetFirstPage())) {
            m_workspaceView->CallAfter(&PHPWorkspaceView::CreateNewProject, wiz.GetCreateData());
        }
    }
}
Example #2
0
void PhpPlugin::OnNewProjectFinish(clNewProjectEvent& e)
{
    if(e.GetTemplateName() != "PHP Project") {
        e.Skip();
        return;
    }

    if(m_mgr->IsWorkspaceOpen()) {
        ::wxMessageBox(
            _("Can't create PHP project. Close your current workspace first"), "PHP", wxOK | wxICON_ERROR | wxCENTER);
        return;
    }

    if(!PHPWorkspace::Get()->IsOpen()) {
        // No PHP workspace is open, create a new one
        wxFileName workspacePath(e.GetProjectFolder(), e.GetProjectName());
        workspacePath.SetExt(PHPStrings::PHP_WORKSPACE_EXT);
        DoOpenWorkspace(workspacePath.GetFullPath(), true);
    }

    if(PHPWorkspace::Get()->IsOpen()) {
        PHPProject::CreateData cd;
        cd.importFilesUnderPath = true;
        cd.name = e.GetProjectName();
        cd.path = e.GetProjectFolder();
        m_workspaceView->CallAfter(&PHPWorkspaceView::CreateNewProject, cd);
    }
}
Example #3
0
void PhpPlugin::OnNewProject(clNewProjectEvent& e)
{
    e.Skip();
    clNewProjectEvent::Template phpTemplate;
    phpTemplate.m_category = "PHP";
    phpTemplate.m_categoryPng = "m_bmpElephant";
    phpTemplate.m_template = "PHP Project";
    phpTemplate.m_templatePng = "m_bmpPhpFile";
    phpTemplate.m_debugger = "XDebug";
    phpTemplate.m_toolchain = "PHP Tools";
    phpTemplate.m_allowSeparateFolder = true;
    e.GetTemplates().push_back(phpTemplate);
}