1
mirror of https://code.videolan.org/videolan/vlc synced 2024-08-18 23:45:06 +02:00

macosx/main menu: use global list of supported subtitle extensions instead of hardcoding another one

This commit is contained in:
Felix Paul Kühne 2019-04-17 00:17:20 +02:00
parent 7d109ecf35
commit 0d2f717083

View File

@ -53,6 +53,8 @@
#import "windows/logging/VLCLogWindowController.h"
#import "windows/addons/VLCAddonsWindowController.h"
#import <vlc_interface.h>
#ifdef HAVE_SPARKLE
#import <Sparkle/Sparkle.h>
#endif
@ -1201,7 +1203,9 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
[openPanel setCanChooseDirectories: NO];
[openPanel setAllowsMultipleSelection: YES];
[openPanel setAllowedFileTypes: [NSArray arrayWithObjects:@"cdg",@"idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil",@"stl",@"usf",@"dks",@"pjs",@"mpl2",@"mks",@"vtt",@"ttml",@"dfxp",nil]];
NSMutableString *subtitleExtensionsString = [toNSStr(EXTENSIONS_SUBTITLE) mutableCopy];
[subtitleExtensionsString replaceOccurrencesOfString:@"*." withString:@"" options:NSLiteralSearch range:NSMakeRange(0, subtitleExtensionsString.length)];
[openPanel setAllowedFileTypes:[subtitleExtensionsString componentsSeparatedByString:@";"]];
NSURL *url = _playerController.URLOfCurrentMediaItem;
url = [url URLByDeletingLastPathComponent];