wxString ProjectSettings::GetProjectType(const wxString &confName) { // try to return the project type per configuration name. If no property name 'configurationType' exists, // return the parent configuration type if (confName.IsEmpty() == false) { std::map<wxString, BuildConfigPtr>::iterator iter = m_configs.find(confName); if (iter != m_configs.end()) { BuildConfigPtr conf = iter->second; wxString type = conf->GetProjectType(); if (type.IsEmpty()) { type = m_projectType; } return type; } } return m_projectType; }
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() ); }