[vlc-commits] macosx: replace API deprecated in 10.10
Felix Paul Kühne
git at videolan.org
Fri Feb 2 17:31:04 CET 2018
vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Fri Feb 2 16:40:58 2018 +0100| [255ded1ff80327b324fbc12e8116729f4682651f] | committer: Felix Paul Kühne
macosx: replace API deprecated in 10.10
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=255ded1ff80327b324fbc12e8116729f4682651f
---
modules/gui/macosx/VLCAboutWindowController.m | 4 ++--
modules/gui/macosx/VLCAudioEffectsWindowController.m | 8 ++++----
modules/gui/macosx/VLCConvertAndSaveWindowController.m | 10 +++++-----
modules/gui/macosx/VLCLogWindowController.m | 2 +-
modules/gui/macosx/VLCMain+OldPrefs.m | 2 +-
modules/gui/macosx/VLCMain.m | 4 ++--
modules/gui/macosx/VLCMainMenu.m | 4 ++--
modules/gui/macosx/VLCOpenWindowController.m | 8 ++++----
modules/gui/macosx/VLCPopupPanelController.h | 2 +-
modules/gui/macosx/VLCPopupPanelController.m | 2 +-
modules/gui/macosx/VLCSimplePrefsController.m | 4 ++--
modules/gui/macosx/VLCTextfieldPanelController.h | 2 +-
modules/gui/macosx/VLCTextfieldPanelController.m | 2 +-
modules/gui/macosx/VLCTimeSelectionPanelController.h | 2 +-
modules/gui/macosx/VLCTimeSelectionPanelController.m | 2 +-
modules/gui/macosx/VLCVideoEffectsWindowController.m | 4 ++--
modules/gui/macosx/prefs_widgets.m | 2 +-
17 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/modules/gui/macosx/VLCAboutWindowController.m b/modules/gui/macosx/VLCAboutWindowController.m
index dea4585d27..6230a6b5c5 100644
--- a/modules/gui/macosx/VLCAboutWindowController.m
+++ b/modules/gui/macosx/VLCAboutWindowController.m
@@ -164,8 +164,8 @@
* Note: this icon doesn't represent an endorsement of The Coca-Cola Company.
*/
NSCalendar *gregorian =
- [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
- NSUInteger dayOfYear = [gregorian ordinalityOfUnit:NSDayCalendarUnit inUnit:NSYearCalendarUnit forDate:[NSDate date]];
+ [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
+ NSUInteger dayOfYear = [gregorian ordinalityOfUnit:NSCalendarUnitDay inUnit:NSCalendarUnitYear forDate:[NSDate date]];
if (dayOfYear >= 354)
[o_icon_view setImage: [NSImage imageNamed:@"VLC-Xmas"]];
diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index 1f630cc661..ae91698ba7 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -515,7 +515,7 @@
[_textfieldPanel runModalForWindow:self.window completionHandler:^(NSInteger returnCode, NSString *resultingText) {
NSInteger currentProfileIndex = [_self currentProfileIndex];
- if (returnCode != NSOKButton) {
+ if (returnCode != NSModalResponseOK) {
[_profilePopup selectItemAtIndex:currentProfileIndex];
return;
}
@@ -573,7 +573,7 @@
[_popupPanel runModalForWindow:self.window completionHandler:^(NSInteger returnCode, NSInteger selectedIndex) {
NSInteger currentProfileIndex = [_self currentProfileIndex];
- if (returnCode != NSOKButton) {
+ if (returnCode != NSModalResponseOK) {
[_profilePopup selectItemAtIndex:currentProfileIndex];
return;
}
@@ -828,7 +828,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
// EQ settings
- if (returnCode != NSOKButton || [resultingText length] == 0)
+ if (returnCode != NSModalResponseOK || [resultingText length] == 0)
return;
NSString *decomposedStringWithCanonicalMapping = [resultingText decomposedStringWithCanonicalMapping];
@@ -872,7 +872,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
__unsafe_unretained typeof(self) _self = self;
[_popupPanel runModalForWindow:self.window completionHandler:^(NSInteger returnCode, NSInteger selectedIndex) {
- if (returnCode != NSOKButton)
+ if (returnCode != NSModalResponseOK)
return;
/* remove requested profile from the arrays */
diff --git a/modules/gui/macosx/VLCConvertAndSaveWindowController.m b/modules/gui/macosx/VLCConvertAndSaveWindowController.m
index d03c1e679f..6d3755408f 100644
--- a/modules/gui/macosx/VLCConvertAndSaveWindowController.m
+++ b/modules/gui/macosx/VLCConvertAndSaveWindowController.m
@@ -313,7 +313,7 @@
[openPanel setResolvesAliases:YES];
[openPanel setAllowsMultipleSelection:NO];
[openPanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger returnCode) {
- if (returnCode == NSOKButton)
+ if (returnCode == NSModalResponseOK)
{
[self setMRL: toNSStr(vlc_path2uri([[[openPanel URL] path] UTF8String], NULL))];
[self updateOKButton];
@@ -342,7 +342,7 @@
__unsafe_unretained typeof(self) _self = self;
[_popupPanel runModalForWindow:self.window completionHandler:^(NSInteger returnCode, NSInteger selectedIndex) {
- if (returnCode != NSOKButton)
+ if (returnCode != NSModalResponseOK)
return;
/* remove requested profile from the arrays */
@@ -413,7 +413,7 @@
if ([[_customizeEncapMatrix selectedCell] tag] != RAW) // there is no clever guess for this
[saveFilePanel setAllowedFileTypes:[NSArray arrayWithObject:[self currentEncapsulationFormatAsFileExtension:YES]]];
[saveFilePanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger returnCode) {
- if (returnCode == NSOKButton) {
+ if (returnCode == NSModalResponseOK) {
[self setOutputDestination:[[saveFilePanel URL] path]];
[_fileDestinationFileName setStringValue: [[NSFileManager defaultManager] displayNameAtPath:_outputDestination]];
[[_fileDestinationFileNameStub animator] setHidden: YES];
@@ -477,7 +477,7 @@
__unsafe_unretained typeof(self) _self = self;
[_textfieldPanel runModalForWindow:_customizePanel completionHandler:^(NSInteger returnCode, NSString *resultingText) {
- if (returnCode != NSOKButton || [resultingText length] == 0)
+ if (returnCode != NSModalResponseOK || [resultingText length] == 0)
return;
/* prepare current data */
@@ -593,7 +593,7 @@
[saveFilePanel setCanCreateDirectories: YES];
[saveFilePanel setAllowedFileTypes:[NSArray arrayWithObject:@"sdp"]];
[saveFilePanel beginSheetModalForWindow:_streamPanel completionHandler:^(NSInteger returnCode) {
- if (returnCode == NSOKButton)
+ if (returnCode == NSModalResponseOK)
[_streamSDPField setStringValue:[[saveFilePanel URL] path]];
}];
}
diff --git a/modules/gui/macosx/VLCLogWindowController.m b/modules/gui/macosx/VLCLogWindowController.m
index 65005a3e43..d01d8ad360 100644
--- a/modules/gui/macosx/VLCLogWindowController.m
+++ b/modules/gui/macosx/VLCLogWindowController.m
@@ -197,7 +197,7 @@ static void MsgCallback(void *data, int type, const vlc_log_t *item, const char
[saveFolderPanel setAllowedFileTypes: [NSArray arrayWithObject:@"txt"]];
[saveFolderPanel setNameFieldStringValue:[NSString stringWithFormat: _NS("VLC Debug Log (%s).txt"), VERSION_MESSAGE]];
[saveFolderPanel beginSheetModalForWindow: self.window completionHandler:^(NSInteger returnCode) {
- if (returnCode != NSOKButton) {
+ if (returnCode != NSModalResponseOK) {
return;
}
NSMutableString *string = [[NSMutableString alloc] init];
diff --git a/modules/gui/macosx/VLCMain+OldPrefs.m b/modules/gui/macosx/VLCMain+OldPrefs.m
index 7e28d17c79..a3079f962c 100644
--- a/modules/gui/macosx/VLCMain+OldPrefs.m
+++ b/modules/gui/macosx/VLCMain+OldPrefs.m
@@ -113,7 +113,7 @@ static const int kCurrentPreferencesVersion = 4;
int res = NSRunInformationalAlertPanel(_NS("Remove old preferences?"),
_NS("We just found an older version of VLC's preferences files."),
_NS("Move To Trash and Relaunch VLC"), _NS("Ignore"), nil, nil);
- if (res != NSOKButton) {
+ if (res != NSModalResponseOK) {
[defaults setInteger:kCurrentPreferencesVersion forKey:kVLCPreferencesVersion];
return;
}
diff --git a/modules/gui/macosx/VLCMain.m b/modules/gui/macosx/VLCMain.m
index 2a60cc184e..7763f12f73 100644
--- a/modules/gui/macosx/VLCMain.m
+++ b/modules/gui/macosx/VLCMain.m
@@ -255,8 +255,8 @@ static VLCMain *sharedInstance = nil;
* Note: this icon doesn't represent an endorsement of The Coca-Cola Company.
*/
NSCalendar *gregorian =
- [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
- NSUInteger dayOfYear = [gregorian ordinalityOfUnit:NSDayCalendarUnit inUnit:NSYearCalendarUnit forDate:[NSDate date]];
+ [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
+ NSUInteger dayOfYear = [gregorian ordinalityOfUnit:NSCalendarUnitDay inUnit:NSCalendarUnitYear forDate:[NSDate date]];
if (dayOfYear >= 354)
[[VLCApplication sharedApplication] setApplicationIconImage: [NSImage imageNamed:@"VLC-Xmas"]];
diff --git a/modules/gui/macosx/VLCMainMenu.m b/modules/gui/macosx/VLCMainMenu.m
index 15a114ca2d..0951662946 100644
--- a/modules/gui/macosx/VLCMainMenu.m
+++ b/modules/gui/macosx/VLCMainMenu.m
@@ -833,7 +833,7 @@
[_timeSelectionPanel runModalForWindow:[NSApp mainWindow]
completionHandler:^(NSInteger returnCode, int64_t returnTime) {
- if (returnCode != NSOKButton)
+ if (returnCode != NSModalResponseOK)
return;
input_thread_t *p_input = pl_CurrentInput(getIntf());
@@ -1037,7 +1037,7 @@
i_returnValue = [openPanel runModal];
- if (i_returnValue == NSOKButton)
+ if (i_returnValue == NSModalResponseOK)
[[VLCCoreInteraction sharedInstance] addSubtitlesToCurrentInput:[openPanel URLs]];
}
diff --git a/modules/gui/macosx/VLCOpenWindowController.m b/modules/gui/macosx/VLCOpenWindowController.m
index 0a47b06296..47740d752b 100644
--- a/modules/gui/macosx/VLCOpenWindowController.m
+++ b/modules/gui/macosx/VLCOpenWindowController.m
@@ -572,7 +572,7 @@ static NSString *kCaptureTabViewId = @"capture";
[openPanel setTitle: _NS("Open File")];
[openPanel setPrompt: _NS("Open")];
- if ([openPanel runModal] == NSOKButton) {
+ if ([openPanel runModal] == NSModalResponseOK) {
NSArray *URLs = [openPanel URLs];
NSUInteger count = [URLs count];
NSMutableArray *values = [NSMutableArray arrayWithCapacity:count];
@@ -679,7 +679,7 @@ static NSString *kCaptureTabViewId = @"capture";
openPanel = [NSOpenPanel openPanel];
[openPanel setCanChooseFiles: YES];
[openPanel setCanChooseDirectories: NO];
- if ([openPanel runModal] == NSOKButton) {
+ if ([openPanel runModal] == NSModalResponseOK) {
_fileSlavePath = [[[openPanel URLs] firstObject] path];
}
}
@@ -895,7 +895,7 @@ static NSString *kCaptureTabViewId = @"capture";
[openPanel setCanChooseFiles: YES];
[openPanel setAllowedFileTypes:[NSArray arrayWithObject:@"public.directory"]];
- if ([openPanel runModal] == NSOKButton) {
+ if ([openPanel runModal] == NSModalResponseOK) {
NSString *oPath = [[[openPanel URLs] firstObject] path];
if ([oPath length] > 0) {
[NSThread detachNewThreadSelector:@selector(scanSpecialPath:) toTarget:self withObject:oPath];
@@ -1258,7 +1258,7 @@ static NSString *kCaptureTabViewId = @"capture";
[openPanel setTitle: _NS("Open File")];
[openPanel setPrompt: _NS("Open")];
- if ([openPanel runModal] == NSOKButton) {
+ if ([openPanel runModal] == NSModalResponseOK) {
_subPath = [[[openPanel URLs] firstObject] path];
[_fileSubtitlesFilenameLabel setStringValue: [[NSFileManager defaultManager] displayNameAtPath:_subPath]];
[_fileSubPathTextField setStringValue: [_fileSubtitlesFilenameLabel stringValue]];
diff --git a/modules/gui/macosx/VLCPopupPanelController.h b/modules/gui/macosx/VLCPopupPanelController.h
index a4c4c48169..119a7a8091 100644
--- a/modules/gui/macosx/VLCPopupPanelController.h
+++ b/modules/gui/macosx/VLCPopupPanelController.h
@@ -39,7 +39,7 @@
/**
* Completion handler for popup panel
- * \param returnCode Result from panel. Can be NSOKButton or NSCancelButton.
+ * \param returnCode Result from panel. Can be NSModalResponseOK or NSModalResponseCancel.
* \param selectedIndex Selected index of the popup in panel.
*/
typedef void(^PopupPanelCompletionBlock)(NSInteger returnCode, NSInteger selectedIndex);
diff --git a/modules/gui/macosx/VLCPopupPanelController.m b/modules/gui/macosx/VLCPopupPanelController.m
index 37b67c6e73..0f051c0db5 100644
--- a/modules/gui/macosx/VLCPopupPanelController.m
+++ b/modules/gui/macosx/VLCPopupPanelController.m
@@ -44,7 +44,7 @@
[NSApp endSheet: self.window];
if (_completionBlock)
- _completionBlock(sender == _okButton ? NSOKButton : NSCancelButton, [_popupButton indexOfSelectedItem]);
+ _completionBlock(sender == _okButton ? NSModalResponseOK : NSModalResponseCancel, [_popupButton indexOfSelectedItem]);
}
- (void)runModalForWindow:(NSWindow *)window completionHandler:(PopupPanelCompletionBlock)handler;
diff --git a/modules/gui/macosx/VLCSimplePrefsController.m b/modules/gui/macosx/VLCSimplePrefsController.m
index 4a4f34dadf..8483330d0d 100644
--- a/modules/gui/macosx/VLCSimplePrefsController.m
+++ b/modules/gui/macosx/VLCSimplePrefsController.m
@@ -1163,7 +1163,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
[_selectFolderPanel setCanCreateDirectories: YES];
[_selectFolderPanel setPrompt: _NS("Choose")];
[_selectFolderPanel beginSheetModalForWindow:self.window completionHandler: ^(NSInteger returnCode) {
- if (returnCode == NSOKButton) {
+ if (returnCode == NSModalResponseOK) {
[_video_snap_folderTextField setStringValue: [[_selectFolderPanel URL] path]];
}
}];
@@ -1262,7 +1262,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
[_selectFolderPanel setCanCreateDirectories: YES];
[_selectFolderPanel setPrompt: _NS("Choose")];
[_selectFolderPanel beginSheetModalForWindow:self.window completionHandler: ^(NSInteger returnCode) {
- if (returnCode == NSOKButton)
+ if (returnCode == NSModalResponseOK)
{
[_input_recordTextField setStringValue: [[_selectFolderPanel URL] path]];
_inputSettingChanged = YES;
diff --git a/modules/gui/macosx/VLCTextfieldPanelController.h b/modules/gui/macosx/VLCTextfieldPanelController.h
index 9175439442..b5f5589846 100644
--- a/modules/gui/macosx/VLCTextfieldPanelController.h
+++ b/modules/gui/macosx/VLCTextfieldPanelController.h
@@ -38,7 +38,7 @@
/**
* Completion handler for textfield panel
- * \param returnCode Result from panel. Can be NSOKButton or NSCancelButton.
+ * \param returnCode Result from panel. Can be NSModalResponseOK or NSModalResponseCancel.
* \param resultingText Resulting text string entered in panel.
*/
typedef void(^TextfieldPanelCompletionBlock)(NSInteger returnCode, NSString *resultingText);
diff --git a/modules/gui/macosx/VLCTextfieldPanelController.m b/modules/gui/macosx/VLCTextfieldPanelController.m
index cab93a29bd..42a6ccb9aa 100644
--- a/modules/gui/macosx/VLCTextfieldPanelController.m
+++ b/modules/gui/macosx/VLCTextfieldPanelController.m
@@ -46,7 +46,7 @@
[NSApp endSheet: self.window];
if (_completionBlock)
- _completionBlock(sender == _okButton ? NSOKButton : NSCancelButton, [_textField stringValue]);
+ _completionBlock(sender == _okButton ? NSModalResponseOK : NSModalResponseCancel, [_textField stringValue]);
}
- (void)runModalForWindow:(NSWindow *)window completionHandler:(TextfieldPanelCompletionBlock)handler;
diff --git a/modules/gui/macosx/VLCTimeSelectionPanelController.h b/modules/gui/macosx/VLCTimeSelectionPanelController.h
index 5248c88c7b..68288956e6 100644
--- a/modules/gui/macosx/VLCTimeSelectionPanelController.h
+++ b/modules/gui/macosx/VLCTimeSelectionPanelController.h
@@ -37,7 +37,7 @@
/**
* Completion handler for textfield panel
- * \param returnCode Result from panel. Can be NSOKButton or NSCancelButton.
+ * \param returnCode Result from panel. Can be NSModalResponseOK or NSModalResponseCancel.
* \param returnTime Resulting time in seconds entered in panel.
*/
typedef void(^TimeSelectionCompletionHandler)(NSInteger returnCode, int64_t returnTime);
diff --git a/modules/gui/macosx/VLCTimeSelectionPanelController.m b/modules/gui/macosx/VLCTimeSelectionPanelController.m
index 82ca6a488d..ac8bdb0670 100644
--- a/modules/gui/macosx/VLCTimeSelectionPanelController.m
+++ b/modules/gui/macosx/VLCTimeSelectionPanelController.m
@@ -80,7 +80,7 @@
timeInSec = [string intValue];
if (_completionHandler)
- _completionHandler(sender == _okButton ? NSOKButton : NSCancelButton, timeInSec);
+ _completionHandler(sender == _okButton ? NSModalResponseOK : NSModalResponseCancel, timeInSec);
}
- (void)runModalForWindow:(NSWindow *)window completionHandler:(TimeSelectionCompletionHandler)handler
diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index e5ef7e1832..80da1df8a7 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -797,7 +797,7 @@
[_textfieldPanel runModalForWindow:self.window completionHandler:^(NSInteger returnCode, NSString *resultingText) {
NSInteger currentProfileIndex = [_self currentProfileIndex];
- if (returnCode != NSOKButton) {
+ if (returnCode != NSModalResponseOK) {
[_profilePopup selectItemAtIndex:currentProfileIndex];
return;
}
@@ -868,7 +868,7 @@
NSInteger activeProfileIndex = [_self currentProfileIndex];
- if (returnCode != NSOKButton) {
+ if (returnCode != NSModalResponseOK) {
[_profilePopup selectItemAtIndex:activeProfileIndex];
return;
}
diff --git a/modules/gui/macosx/prefs_widgets.m b/modules/gui/macosx/prefs_widgets.m
index 29900aa3fc..dd6fe3ffe8 100644
--- a/modules/gui/macosx/prefs_widgets.m
+++ b/modules/gui/macosx/prefs_widgets.m
@@ -1152,7 +1152,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
[o_open_panel setCanChooseFiles: !b_directory];
[o_open_panel setCanChooseDirectories: b_directory];
[o_open_panel beginSheetModalForWindow:[sender window] completionHandler:^(NSInteger returnCode) {
- if (returnCode == NSOKButton) {
+ if (returnCode == NSModalResponseOK) {
NSString *o_path = [[[o_open_panel URLs] firstObject] path];
[o_textfield setStringValue: o_path];
}
More information about the vlc-commits
mailing list