Commit 41041ace authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx/CAS: replace deprecated API calls with modern blocks-based counterparts

parent b03db9b5
...@@ -298,17 +298,14 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -298,17 +298,14 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[openPanel setCanChooseDirectories:NO]; [openPanel setCanChooseDirectories:NO];
[openPanel setResolvesAliases:YES]; [openPanel setResolvesAliases:YES];
[openPanel setAllowsMultipleSelection:NO]; [openPanel setAllowsMultipleSelection:NO];
[openPanel beginSheetForDirectory:nil file:nil types:nil modalForWindow: _window modalDelegate:self didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) contextInfo:nil]; [openPanel beginSheetModalForWindow:_window completionHandler:^(NSInteger returnCode) {
}
- (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
if (returnCode == NSOKButton) if (returnCode == NSOKButton)
{ {
[self setMRL: [NSString stringWithUTF8String:vlc_path2uri([[[panel URL] path] UTF8String], NULL)]]; [self setMRL: [NSString stringWithUTF8String:vlc_path2uri([[[openPanel URL] path] UTF8String], NULL)]];
[self updateOKButton]; [self updateOKButton];
[self updateDropView]; [self updateDropView];
} }
}];
} }
- (IBAction)switchProfile:(id)sender - (IBAction)switchProfile:(id)sender
...@@ -418,13 +415,9 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -418,13 +415,9 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[saveFilePanel setCanCreateDirectories: YES]; [saveFilePanel setCanCreateDirectories: YES];
if ([[_customize_encap_matrix selectedCell] tag] != RAW) // there is no clever guess for this if ([[_customize_encap_matrix selectedCell] tag] != RAW) // there is no clever guess for this
[saveFilePanel setAllowedFileTypes:[NSArray arrayWithObject:[self currentEncapsulationFormatAsFileExtension:YES]]]; [saveFilePanel setAllowedFileTypes:[NSArray arrayWithObject:[self currentEncapsulationFormatAsFileExtension:YES]]];
[saveFilePanel beginSheetForDirectory:nil file:nil modalForWindow:_window modalDelegate:self didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:nil]; [saveFilePanel beginSheetModalForWindow:_window completionHandler:^(NSInteger returnCode) {
}
- (void)savePanelDidEnd:(NSSavePanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
if (returnCode == NSOKButton) { if (returnCode == NSOKButton) {
[self setOutputDestination:[[sheet URL] path]]; [self setOutputDestination:[[saveFilePanel URL] path]];
[_destination_filename_lbl setStringValue: [[NSFileManager defaultManager] displayNameAtPath:_outputDestination]]; [_destination_filename_lbl setStringValue: [[NSFileManager defaultManager] displayNameAtPath:_outputDestination]];
[[_destination_filename_stub_lbl animator] setHidden: YES]; [[_destination_filename_stub_lbl animator] setHidden: YES];
[[_destination_filename_lbl animator] setHidden: NO]; [[_destination_filename_lbl animator] setHidden: NO];
...@@ -434,6 +427,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -434,6 +427,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[[_destination_filename_stub_lbl animator] setHidden: NO]; [[_destination_filename_stub_lbl animator] setHidden: NO];
} }
[self updateOKButton]; [self updateOKButton];
}];
} }
- (IBAction)showStreamPanel:(id)sender - (IBAction)showStreamPanel:(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