Commit a549e879 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx/open: replace deprecated API call with modern blocks-based counterpart

parent adde68fa
...@@ -266,7 +266,6 @@ ...@@ -266,7 +266,6 @@
- (void)openFileGeneric; - (void)openFileGeneric;
- (void)openFilePathChanged:(NSNotification *)o_notification; - (void)openFilePathChanged:(NSNotification *)o_notification;
- (IBAction)openFileBrowse:(id)sender; - (IBAction)openFileBrowse:(id)sender;
- (void)pathChosenInPanel: (NSOpenPanel *)sheet withReturn:(int)returnCode contextInfo:(void *)contextInfo;
- (IBAction)openFileStreamChanged:(id)sender; - (IBAction)openFileStreamChanged:(id)sender;
- (void)openDisc; - (void)openDisc;
......
...@@ -752,28 +752,16 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -752,28 +752,16 @@ static VLCOpen *_o_sharedMainInstance = nil;
[o_open_panel setCanChooseDirectories: YES]; [o_open_panel setCanChooseDirectories: YES];
[o_open_panel setTitle: _NS("Open File")]; [o_open_panel setTitle: _NS("Open File")];
[o_open_panel setPrompt: _NS("Open")]; [o_open_panel setPrompt: _NS("Open")];
[o_open_panel beginSheetModalForWindow:[sender window] completionHandler:^(NSInteger returnCode) {
[o_open_panel beginSheetForDirectory:nil
file:nil
types:nil
modalForWindow:[sender window]
modalDelegate: self
didEndSelector: @selector(pathChosenInPanel:
withReturn:
contextInfo:)
contextInfo: nil];
}
- (void)pathChosenInPanel: (NSOpenPanel *) sheet withReturn:(int)returnCode contextInfo:(void *)contextInfo
{
if (returnCode == NSFileHandlingPanelOKButton) if (returnCode == NSFileHandlingPanelOKButton)
{ {
if( o_file_path ) if( o_file_path )
[o_file_path release]; [o_file_path release];
o_file_path = [[[sheet URLs] objectAtIndex: 0] path]; o_file_path = [[[o_open_panel URLs] objectAtIndex: 0] path];
[o_file_path retain]; [o_file_path retain];
[self openFilePathChanged: nil]; [self openFilePathChanged: nil];
} }
}];
} }
- (IBAction)openFileStreamChanged:(id)sender - (IBAction)openFileStreamChanged:(id)sender
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment