diff options
author | James Cowgill <jcowgill@debian.org> | 2019-10-28 18:27:34 +0000 |
---|---|---|
committer | James Cowgill <jcowgill@debian.org> | 2019-10-28 18:27:34 +0000 |
commit | a68a0026a9d44e9c29f58bb04b9d5f96dad1b66f (patch) | |
tree | 9c8357fd55d053634869e58af0f5812afb7e0a40 /osdep/macosx_menubar.m | |
parent | a6680ec06c4f17bb7b60c18ebd611ef40c5c6d68 (diff) |
New upstream version 0.30.0
Diffstat (limited to 'osdep/macosx_menubar.m')
-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 558a33a..c424df2 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]; |