mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-13 00:04:19 +00:00
Introjucer: disabled "launch project" buttons when no suitable exporter exists.
This commit is contained in:
parent
b6a22826fe
commit
cb18ce366a
2 changed files with 14 additions and 2 deletions
|
|
@ -197,6 +197,17 @@ void ProjectContentComponent::updateMainWindowTitle()
|
|||
mw->updateTitle (currentDocument != nullptr ? currentDocument->getName() : String::empty);
|
||||
}
|
||||
|
||||
bool ProjectContentComponent::canProjectBeLaunched() const
|
||||
{
|
||||
if (project != nullptr)
|
||||
{
|
||||
ScopedPointer <ProjectExporter> launcher (ProjectExporter::createPlatformDefaultExporter (*project));
|
||||
return launcher != nullptr;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
ApplicationCommandTarget* ProjectContentComponent::getNextCommandTarget()
|
||||
{
|
||||
return findFirstTargetParentComponent();
|
||||
|
|
@ -252,7 +263,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica
|
|||
#endif
|
||||
"Launches the project in an external IDE",
|
||||
CommandCategories::general, 0);
|
||||
result.setActive (project != nullptr);
|
||||
result.setActive (canProjectBeLaunched());
|
||||
break;
|
||||
|
||||
case CommandIDs::saveAndOpenInIDE:
|
||||
|
|
@ -265,7 +276,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica
|
|||
#endif
|
||||
"Saves the project and launches it in an external IDE",
|
||||
CommandCategories::general, 0);
|
||||
result.setActive (project != nullptr);
|
||||
result.setActive (canProjectBeLaunched());
|
||||
result.defaultKeypresses.add (KeyPress ('l', ModifierKeys::commandModifier, 0));
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue