Browse Source

Introjucer: disabled "launch project" buttons when no suitable exporter exists.

tags/2021-05-28
jules 13 years ago
parent
commit
cb18ce366a
2 changed files with 14 additions and 2 deletions
  1. +13
    -2
      extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp
  2. +1
    -0
      extras/Introjucer/Source/Project/jucer_ProjectContentComponent.h

+ 13
- 2
extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp View File

@@ -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;


+ 1
- 0
extras/Introjucer/Source/Project/jucer_ProjectContentComponent.h View File

@@ -75,6 +75,7 @@ private:
void updateMainWindowTitle();
bool reinvokeCommandAfterClosingPropertyEditors (const InvocationInfo&);
bool canProjectBeLaunched() const;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjectContentComponent);
};


Loading…
Cancel
Save