mac: add Open Playlist menu bar item

This commit is contained in:
Akemi 2018-06-05 19:12:57 +02:00 committed by der richter
parent b6def652a4
commit c1cdecd147
1 changed files with 17 additions and 0 deletions

View File

@ -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];