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

Projucer: Ensure that save error messages are shown when using the "Save Project and Open in IDE" command

This commit is contained in:
ed 2021-07-09 12:55:34 +01:00
parent d53388097b
commit 77b816b042
4 changed files with 42 additions and 72 deletions

View file

@ -226,31 +226,29 @@ void HeaderComponent::initialiseButtons()
saveAndOpenInIDEButton.setIconInset (7);
saveAndOpenInIDEButton.onClick = [this]
{
if (project != nullptr)
if (project == nullptr)
return;
if (! project->isSaveAndExportDisabled())
{
if (project->isSaveAndExportDisabled())
{
auto setWarningVisible = [this] (const Identifier& identifier)
{
auto child = project->getProjectMessages().getChildWithName (ProjectMessages::Ids::warning)
.getChildWithName (identifier);
if (child.isValid())
child.setProperty (ProjectMessages::Ids::isVisible, true, nullptr);
};
if (project->hasIncompatibleLicenseTypeAndSplashScreenSetting())
setWarningVisible (ProjectMessages::Ids::incompatibleLicense);
if (project->isFileModificationCheckPending())
setWarningVisible (ProjectMessages::Ids::jucerFileModified);
}
else
{
if (auto exporter = getSelectedExporter())
project->openProjectInIDE (*exporter, true, nullptr);
}
projectContentComponent->openInSelectedIDE (true);
return;
}
auto setWarningVisible = [this] (const Identifier& identifier)
{
auto child = project->getProjectMessages().getChildWithName (ProjectMessages::Ids::warning)
.getChildWithName (identifier);
if (child.isValid())
child.setProperty (ProjectMessages::Ids::isVisible, true, nullptr);
};
if (project->hasIncompatibleLicenseTypeAndSplashScreenSetting())
setWarningVisible (ProjectMessages::Ids::incompatibleLicense);
if (project->isFileModificationCheckPending())
setWarningVisible (ProjectMessages::Ids::jucerFileModified);
};
updateExporterButton();