mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fix for sandboxed OSX filechoosers.
This commit is contained in:
parent
ad33fca65a
commit
7dafc1e836
1 changed files with 13 additions and 0 deletions
|
|
@ -148,6 +148,16 @@ private:
|
|||
SilentDummyModalComp dummyModalComponent;
|
||||
};
|
||||
|
||||
static NSMutableArray* createAllowedTypesArray (const StringArray& filters)
|
||||
{
|
||||
NSMutableArray* filterArray = [[[NSMutableArray alloc] init] autorelease];
|
||||
|
||||
for (int i = 0; i < filters.size(); ++i)
|
||||
[filterArray addObject: juceStringToNS (filters[i].replace ("*.", ""))];
|
||||
|
||||
return filterArray;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void FileChooser::showPlatformDialog (Array<File>& results,
|
||||
const String& title,
|
||||
|
|
@ -186,6 +196,9 @@ void FileChooser::showPlatformDialog (Array<File>& results,
|
|||
|
||||
[panel setTitle: juceStringToNS (title)];
|
||||
|
||||
if (filters->size() != 0)
|
||||
[panel setAllowedFileTypes: createAllowedTypesArray (*filters)];
|
||||
|
||||
if (! isSaveDialogue)
|
||||
{
|
||||
NSOpenPanel* openPanel = (NSOpenPanel*) panel;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue