1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Projucer: Make VS2026 the default exporter on Windows

This commit is contained in:
reuk 2025-12-03 13:09:18 +00:00
parent 2a9c249aba
commit 54813c8937
No known key found for this signature in database
6 changed files with 65 additions and 32 deletions

View file

@ -127,39 +127,51 @@ void HeaderComponent::updateExporters()
auto selectedExporter = getSelectedExporter();
exporterBox.clear();
auto preferredExporterIndex = -1;
int i = 0;
for (Project::ExporterIterator exporter (*project); exporter.next(); ++i)
{
auto exporterName = exporter->getUniqueName();
exporterBox.addItem (exporterName, i + 1);
const auto exporterName = exporter->getUniqueName();
const auto id = i + 1;
exporterBox.addItem (exporterName, id);
if (selectedExporter != nullptr && exporterName == selectedExporter->getUniqueName())
exporterBox.setSelectedId (i + 1);
if (exporterName.contains (ProjectExporter::getCurrentPlatformExporterTypeInfo().displayName) && preferredExporterIndex == -1)
preferredExporterIndex = i;
exporterBox.setSelectedId (id);
}
if (exporterBox.getSelectedItemIndex() == -1)
const auto preferredExporterIndex = std::invoke ([&]
{
if (preferredExporterIndex == -1)
std::vector<ProjectExporter::ExporterTypeInfo> infos;
ProjectExporter::getCurrentPlatformExporterTypeInfos (infos);
for (const auto& info : infos)
{
i = 0;
for (Project::ExporterIterator exporter (*project); exporter.next(); ++i)
int index = 0;
for (Project::ExporterIterator exporter (*project); exporter.next(); ++index)
{
if (exporter->canLaunchProject())
{
preferredExporterIndex = i;
break;
}
if (exporter->getUniqueName().contains (info.displayName))
return index;
}
}
if (exporterBox.getSelectedItemIndex() == -1)
{
int index = 0;
for (Project::ExporterIterator exporter (*project); exporter.next(); ++index)
{
if (exporter->canLaunchProject())
return index;
}
}
return -1;
});
if (exporterBox.getSelectedItemIndex() == -1)
exporterBox.setSelectedItemIndex (preferredExporterIndex != -1 ? preferredExporterIndex : 0);
}
updateExporterButton();
}