[vlc-commits] macosx/simpleprefs: replaced deprecated API call with modern counterpart using ObjC 2.0 blocks
Felix Paul Kühne
git at videolan.org
Thu Aug 23 12:17:34 CEST 2012
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Aug 23 11:59:50 2012 +0200| [dd9ef4237e21f89f8055cec4e1384555a6343627] | committer: Felix Paul Kühne
macosx/simpleprefs: replaced deprecated API call with modern counterpart using ObjC 2.0 blocks
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dd9ef4237e21f89f8055cec4e1384555a6343627
---
modules/gui/macosx/simple_prefs.m | 44 ++++++++++++++-----------------------
1 file changed, 17 insertions(+), 27 deletions(-)
diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m
index 89bc68d..31157ce 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -1145,34 +1145,19 @@ 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 setCanCreateDirectories: YES];
[o_selectFolderPanel setPrompt: _NS("Choose")];
- [o_selectFolderPanel beginSheetForDirectory: nil file: nil modalForWindow: o_sprefs_win
- modalDelegate: self
- didEndSelector: @selector(savePanelDidEnd:returnCode:contextInfo:)
- contextInfo: o_video_snap_folder_btn];
+ [o_selectFolderPanel beginSheetModalForWindow: o_sprefs_win completionHandler: ^(NSInteger returnCode) {
+ if( returnCode == NSOKButton )
+ {
+ [o_video_snap_folder_fld setStringValue: [[o_selectFolderPanel URL] path]];
+ b_videoSettingChanged = YES;
+ }
+ }];
+ [o_selectFolderPanel release];
}
else
b_videoSettingChanged = YES;
}
-- (void)savePanelDidEnd:(NSOpenPanel * )panel returnCode: (int)returnCode contextInfo: (void *)contextInfo
-{
- if( returnCode == NSOKButton )
- {
- if( contextInfo == o_video_snap_folder_btn )
- {
- [o_video_snap_folder_fld setStringValue: [[o_selectFolderPanel URL] path]];
- 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];
-}
-
- (void)showVideoSettings
{
[self showSettingsForCategory: o_video_view];
@@ -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 setCanCreateDirectories: YES];
[o_selectFolderPanel setPrompt: _NS("Choose")];
- [o_selectFolderPanel beginSheetForDirectory: nil file: nil modalForWindow: o_sprefs_win
- modalDelegate: self
- didEndSelector: @selector(savePanelDidEnd:returnCode:contextInfo:)
- contextInfo: o_input_record_btn];
+ [o_selectFolderPanel beginSheetModalForWindow: o_sprefs_win completionHandler: ^(NSInteger returnCode) {
+ if( returnCode == NSOKButton )
+ {
+ [o_input_record_fld setStringValue: [[o_selectFolderPanel URL] path]];
+ b_inputSettingChanged = YES;
+ }
+ }];
+ [o_selectFolderPanel release];
+
return;
}
More information about the vlc-commits
mailing list