示例#1
0
void PSGeneralPage::Load(BuildConfigPtr buildConf)
{
    Clear();
    m_configName = buildConf->GetName();
    m_checkBoxEnabled->SetValue( buildConf->IsProjectEnabled() );
    m_pgPropArgs->SetValue( buildConf->GetCommandArguments() );
    m_pgPropDebugArgs->SetValueFromString( buildConf->GetDebugArgs() );
    m_pgPropIntermediateFolder->SetValueFromString( buildConf->GetIntermediateDirectory() );
    m_pgPropGUIApp->SetValue( buildConf->IsGUIProgram() );
    m_pgPropOutputFile->SetValueFromString( buildConf->GetOutputFileName() );
    m_pgPropPause->SetValue( buildConf->GetPauseWhenExecEnds() );
    m_pgPropProgram->SetValueFromString( buildConf->GetCommand() );
    m_pgPropWorkingDirectory->SetValue( buildConf->GetWorkingDirectory() );
    // Project type
    wxPGChoices choices;
    choices.Add(Project::STATIC_LIBRARY);
    choices.Add(Project::DYNAMIC_LIBRARY);
    choices.Add(Project::EXECUTABLE);
    m_pgPropProjectType->SetChoices( choices );
    m_pgPropProjectType->SetChoiceSelection( choices.Index(buildConf->GetProjectType() ) );

    // Compilers
    choices.Clear();
    wxString cmpType = buildConf->GetCompilerType();
    BuildSettingsConfigCookie cookie;
    CompilerPtr cmp = BuildSettingsConfigST::Get()->GetFirstCompiler(cookie);
    while (cmp) {
        choices.Add(cmp->GetName());
        cmp = BuildSettingsConfigST::Get()->GetNextCompiler(cookie);
    }
    m_pgPropCompiler->SetChoices( choices );
    m_pgPropCompiler->SetChoiceSelection( choices.Index( buildConf->GetCompiler()->GetName() ) );

    // Debuggers
    choices.Clear();
    wxString dbgType = buildConf->GetDebuggerType();
    wxArrayString dbgs = DebuggerMgr::Get().GetAvailableDebuggers();
    choices.Add(dbgs);
    m_pgPropDebugger->SetChoices( choices );
    m_pgPropDebugger->SetChoiceSelection( choices.Index(buildConf->GetDebuggerType()) );
    m_pgPropUseSeparateDebuggerArgs->SetValue( buildConf->GetUseSeparateDebugArgs() );
    m_dlg->SetIsProjectEnabled( buildConf->IsProjectEnabled() );
}
示例#2
0
void NewProjectWizard::UpdateProjectPage()
{
    // update the description
    if(m_projectData.m_srcProject) {
        wxString desc = m_projectData.m_srcProject->GetDescription();
        desc = desc.Trim().Trim(false);
        desc.Replace(wxT("\t"), wxT(" "));

        // select the correct compiler
        ProjectSettingsPtr settings = m_projectData.m_srcProject->GetSettings();
        if(settings) {
            ProjectSettingsCookie ck;
            BuildConfigPtr buildConf = settings->GetFirstBuildConfiguration(ck);
            if(buildConf) {
                m_choiceCompiler->SetStringSelection(buildConf->GetCompilerType());
                m_choiceDebugger->SetStringSelection(buildConf->GetDebuggerType());
            }
        }
    }

    // Restore previous selections
    wxString lastCompiler = clConfig::Get().Read("CxxWizard/Compiler", wxString());
    wxString lastDebugger = clConfig::Get().Read("CxxWizard/Debugger", wxString());
    wxString lastBuilder = clConfig::Get().Read("CxxWizard/BuildSystem", wxString("Default"));
    if(!lastDebugger.IsEmpty()) {
        int where = m_choiceDebugger->FindString(lastDebugger);
        if(where != wxNOT_FOUND) {
            m_choiceDebugger->SetSelection(where);
        }
    }

    if(!lastCompiler.IsEmpty()) {
        int where = m_choiceCompiler->FindString(lastCompiler);
        if(where != wxNOT_FOUND) {
            m_choiceCompiler->SetSelection(where);
        }
    }

    {
        int where = m_choiceBuildSystem->FindString(lastBuilder);
        if(where != wxNOT_FOUND) {
            m_choiceBuildSystem->SetSelection(where);
        }
    }
}
示例#3
0
void NewProjectWizard::UpdateProjectPage()
{
    //update the description
    if ( m_projectData.m_srcProject ) {
        wxString desc = m_projectData.m_srcProject->GetDescription();
        desc = desc.Trim().Trim(false);
        desc.Replace(wxT("\t"), wxT(" "));
        // m_txtDescription->SetValue( desc );

        // select the correct compiler
        ProjectSettingsPtr settings  = m_projectData.m_srcProject->GetSettings();
        if (settings) {
            ProjectSettingsCookie ck;
            BuildConfigPtr buildConf = settings->GetFirstBuildConfiguration(ck);
            if (buildConf) {
                m_choiceCompiler->SetStringSelection( buildConf->GetCompilerType() );
                m_choiceCompiler->SetStringSelection( buildConf->GetDebuggerType() );
            }
        }
    }
}