|
|
|
@@ -491,13 +491,51 @@ void ProjectContentComponent::closeProject() |
|
|
|
mw->closeCurrentProject();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ProjectContentComponent::openInIDE()
|
|
|
|
StringArray ProjectContentComponent::getExportersWhichCanLaunch() const
|
|
|
|
{
|
|
|
|
StringArray s;
|
|
|
|
|
|
|
|
for (Project::ExporterIterator exporter (*project); exporter.next();)
|
|
|
|
if (exporter->canLaunchProject())
|
|
|
|
s.add (exporter->getName());
|
|
|
|
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ProjectContentComponent::openInIDE (const String& exporterName)
|
|
|
|
{
|
|
|
|
if (project != nullptr)
|
|
|
|
{
|
|
|
|
for (Project::ExporterIterator exporter (*project); exporter.next();)
|
|
|
|
if (exporter->launchProject())
|
|
|
|
if (exporter->getName() == exporterName && exporter->launchProject())
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void openIDEMenuCallback (int result, ProjectContentComponent* comp)
|
|
|
|
{
|
|
|
|
if (comp != nullptr && result > 0)
|
|
|
|
comp->openInIDE (comp->getExportersWhichCanLaunch() [result - 1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ProjectContentComponent::openInIDE()
|
|
|
|
{
|
|
|
|
if (project != nullptr)
|
|
|
|
{
|
|
|
|
StringArray possibleExporters = getExportersWhichCanLaunch();
|
|
|
|
|
|
|
|
if (possibleExporters.size() > 1)
|
|
|
|
{
|
|
|
|
PopupMenu menu;
|
|
|
|
|
|
|
|
for (int i = 0; i < possibleExporters.size(); ++i)
|
|
|
|
menu.addItem (i + 1, possibleExporters[i]);
|
|
|
|
|
|
|
|
menu.showMenuAsync (PopupMenu::Options(),
|
|
|
|
ModalCallbackFunction::forComponent (openIDEMenuCallback, this));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
openInIDE (possibleExporters[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|