mirror of https://github.com/mpv-player/mpv
mac: add Open Playlist menu bar item
This commit is contained in:
parent
b6def652a4
commit
c1cdecd147
|
@ -144,6 +144,12 @@
|
|||
@"key" : @"O",
|
||||
@"target" : self
|
||||
}],
|
||||
[NSMutableDictionary dictionaryWithDictionary:@{
|
||||
@"name" : @"Open Playlist…",
|
||||
@"action" : @"openPlaylist",
|
||||
@"key" : @"",
|
||||
@"target" : self
|
||||
}],
|
||||
@{ @"name": @"separator" },
|
||||
[NSMutableDictionary dictionaryWithDictionary:@{
|
||||
@"name" : @"Close",
|
||||
|
@ -703,6 +709,17 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)openPlaylist
|
||||
{
|
||||
NSOpenPanel *panel = [[NSOpenPanel alloc] init];
|
||||
|
||||
if ([panel runModal] == NSModalResponseOK){
|
||||
NSString *pl = [NSString stringWithFormat:@"loadlist \"%@\"",
|
||||
[panel URLs][0].path];
|
||||
[(Application *)NSApp queueCommand:(char *)[pl UTF8String]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)openURL
|
||||
{
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
|
|
Loading…
Reference in New Issue