Set allowed extensions for the save picker when saving a playlist

CQTexperiment
Christopher Snowhill 2021-04-09 11:16:12 -07:00
parent cadb54b454
commit d06eec4ff0
1 changed files with 5 additions and 0 deletions

View File

@ -86,6 +86,11 @@ void* kAppControllerContext = &kAppControllerContext;
NSSavePanel *p;
p = [NSSavePanel savePanel];
/* Yes, this is deprecated. Yes, this is required to give the dialog
* a default set of filename extensions to save, including adding an
* extension if the user does not supply one. */
[p setAllowedFileTypes:[NSArray arrayWithObjects:@"m3u", @"pls", nil]];
[p beginSheetModalForWindow:mainWindow completionHandler:^(NSInteger result) {
if ( result == NSModalResponseOK ) {