diff options
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/macosx_menubar.m | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/osdep/macosx_menubar.m b/osdep/macosx_menubar.m index 558a33a905..c424df255c 100644 --- a/osdep/macosx_menubar.m +++ b/osdep/macosx_menubar.m @@ -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]; |