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

macosx/simpleprefs: replaced deprecated API call with modern counterpart using ObjC 2.0 blocks

parent 3c4998f6
...@@ -1145,32 +1145,17 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch ...@@ -1145,32 +1145,17 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
[o_selectFolderPanel setMessage: _NS("Choose the folder to save your video snapshots to.")]; [o_selectFolderPanel setMessage: _NS("Choose the folder to save your video snapshots to.")];
[o_selectFolderPanel setCanCreateDirectories: YES]; [o_selectFolderPanel setCanCreateDirectories: YES];
[o_selectFolderPanel setPrompt: _NS("Choose")]; [o_selectFolderPanel setPrompt: _NS("Choose")];
[o_selectFolderPanel beginSheetForDirectory: nil file: nil modalForWindow: o_sprefs_win [o_selectFolderPanel beginSheetModalForWindow: o_sprefs_win completionHandler: ^(NSInteger returnCode) {
modalDelegate: self
didEndSelector: @selector(savePanelDidEnd:returnCode:contextInfo:)
contextInfo: o_video_snap_folder_btn];
}
else
b_videoSettingChanged = YES;
}
- (void)savePanelDidEnd:(NSOpenPanel * )panel returnCode: (int)returnCode contextInfo: (void *)contextInfo
{
if( returnCode == NSOKButton ) if( returnCode == NSOKButton )
{
if( contextInfo == o_video_snap_folder_btn )
{ {
[o_video_snap_folder_fld setStringValue: [[o_selectFolderPanel URL] path]]; [o_video_snap_folder_fld setStringValue: [[o_selectFolderPanel URL] path]];
b_videoSettingChanged = YES; b_videoSettingChanged = YES;
} }
else if( contextInfo == o_input_record_btn ) }];
{
[o_input_record_fld setStringValue: [[o_selectFolderPanel URL] path]];
b_inputSettingChanged = YES;
}
}
[o_selectFolderPanel release]; [o_selectFolderPanel release];
}
else
b_videoSettingChanged = YES;
} }
- (void)showVideoSettings - (void)showVideoSettings
...@@ -1256,10 +1241,15 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch ...@@ -1256,10 +1241,15 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
[o_selectFolderPanel setMessage: _NS("Choose the directory or filename where the records will be stored.")]; [o_selectFolderPanel setMessage: _NS("Choose the directory or filename where the records will be stored.")];
[o_selectFolderPanel setCanCreateDirectories: YES]; [o_selectFolderPanel setCanCreateDirectories: YES];
[o_selectFolderPanel setPrompt: _NS("Choose")]; [o_selectFolderPanel setPrompt: _NS("Choose")];
[o_selectFolderPanel beginSheetForDirectory: nil file: nil modalForWindow: o_sprefs_win [o_selectFolderPanel beginSheetModalForWindow: o_sprefs_win completionHandler: ^(NSInteger returnCode) {
modalDelegate: self if( returnCode == NSOKButton )
didEndSelector: @selector(savePanelDidEnd:returnCode:contextInfo:) {
contextInfo: o_input_record_btn]; [o_input_record_fld setStringValue: [[o_selectFolderPanel URL] path]];
b_inputSettingChanged = YES;
}
}];
[o_selectFolderPanel release];
return; return;
} }
......
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