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

FileChooser: Check JUCE_MODAL_LOOPS_PERMITTED in Native::runModally()

This commit is contained in:
ed 2021-02-22 08:50:17 +00:00
parent 08e6d2f9ee
commit e18284978f
4 changed files with 14 additions and 0 deletions

View file

@ -140,6 +140,8 @@ public:
{
#if JUCE_MODAL_LOOPS_PERMITTED
runModalLoop();
#else
jassertfalse;
#endif
}

View file

@ -66,6 +66,7 @@ public:
void runModally() override
{
#if JUCE_MODAL_LOOPS_PERMITTED
child.start (args, ChildProcess::wantStdOut);
while (child.isRunning())
@ -73,6 +74,9 @@ public:
break;
finish (false);
#else
jassertfalse;
#endif
}
void launch() override

View file

@ -183,6 +183,7 @@ public:
void runModally() override
{
#if JUCE_MODAL_LOOPS_PERMITTED
ensurePanelSafe();
std::unique_ptr<TemporaryMainMenuWithStandardCommands> tempMenu;
@ -193,6 +194,9 @@ public:
jassert (panel != nil);
auto result = [panel runModal];
finished (result);
#else
jassertfalse;
#endif
}
bool canModalEventBeSentToComponent (const Component* targetComponent) override

View file

@ -758,12 +758,16 @@ public:
void runModally() override
{
#if JUCE_MODAL_LOOPS_PERMITTED
enterModalState (true);
nativeFileChooser->open (false);
exitModalState (nativeFileChooser->results.size() > 0 ? 1 : 0);
nativeFileChooser->cancel();
owner.finished (nativeFileChooser->results);
#else
jassertfalse;
#endif
}
bool canModalEventBeSentToComponent (const Component* targetComponent) override