Commit 012fa5d2 authored by Felix Paul Kühne's avatar Felix Paul Kühne

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

parent 9708e543
...@@ -89,7 +89,6 @@ static NSMenu *o_keys_menu = nil; ...@@ -89,7 +89,6 @@ static NSMenu *o_keys_menu = nil;
withView: (NSView *)o_parent_view; withView: (NSView *)o_parent_view;
- (IBAction)openFileDialog: (id)sender; - (IBAction)openFileDialog: (id)sender;
- (void)pathChosenInPanel:(NSOpenPanel *)o_sheet withReturn:(int)i_return_code contextInfo:(void *)o_context_info;
@end @end
......
...@@ -1235,25 +1235,13 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -1235,25 +1235,13 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
[o_open_panel setAllowsMultipleSelection: NO]; [o_open_panel setAllowsMultipleSelection: NO];
[o_open_panel setCanChooseFiles: !b_directory]; [o_open_panel setCanChooseFiles: !b_directory];
[o_open_panel setCanChooseDirectories: b_directory]; [o_open_panel setCanChooseDirectories: b_directory];
[o_open_panel beginSheetForDirectory:nil [o_open_panel beginSheetModalForWindow:[sender window] completionHandler:^(NSInteger returnCode) {
file:nil if( returnCode == NSOKButton )
types:nil {
modalForWindow:[sender window] NSString *o_path = [[[o_open_panel URLs] objectAtIndex: 0] path];
modalDelegate: self [o_textfield setStringValue: o_path];
didEndSelector: @selector(pathChosenInPanel: }
withReturn: }];
contextInfo:)
contextInfo: nil];
}
- (void)pathChosenInPanel:(NSOpenPanel *)o_sheet
withReturn:(int)i_return_code contextInfo:(void *)o_context_info
{
if( i_return_code == NSOKButton )
{
NSString *o_path = [[[o_sheet URLs] objectAtIndex: 0] path];
[o_textfield setStringValue: o_path];
}
} }
- (char *)stringValue - (char *)stringValue
......
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