Commit e7353f4b authored by David Fuhrmann's avatar David Fuhrmann

macosx: fix typo and set path for open dialog correctly

parent 9dda04b9
...@@ -925,6 +925,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -925,6 +925,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
} }
char *path = input_item_GetURI(p_item); char *path = input_item_GetURI(p_item);
if (!path) if (!path)
path = strdup(""); path = strdup("");
...@@ -932,11 +933,16 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -932,11 +933,16 @@ static VLCMainMenu *_o_sharedInstance = nil;
[openPanel setCanChooseFiles: YES]; [openPanel setCanChooseFiles: YES];
[openPanel setCanChooseDirectories: NO]; [openPanel setCanChooseDirectories: NO];
[openPanel setAllowsMultipleSelection: YES]; [openPanel setAllowsMultipleSelection: YES];
[openPanel setAllowedFileTypes: [NSArray arrayWithObjects:@"cdg",@"@idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil",nil]];
[openPanel setDirectoryURL:[NSURL fileURLWithPath:[[NSString stringWithUTF8String:path] stringByExpandingTildeInPath]]]; [openPanel setAllowedFileTypes: [NSArray arrayWithObjects:@"cdg",@"idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil",nil]];
i_returnValue = [openPanel runModal];
NSURL *o_url = [NSURL URLWithString:[[NSString stringWithUTF8String:path] stringByExpandingTildeInPath]];
o_url = [o_url URLByDeletingLastPathComponent];
[openPanel setDirectoryURL: o_url];
free(path); free(path);
i_returnValue = [openPanel runModal];
if (i_returnValue == NSOKButton) { if (i_returnValue == NSOKButton) {
NSUInteger c = 0; NSUInteger c = 0;
if (!p_input) if (!p_input)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment