From b47a1bae8d37937a52f04ecd71f96f6a9d3495e1 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Thu, 24 Jan 2019 15:54:05 +0100 Subject: [PATCH] MacGui: set the minimum macOS version to 10.11 --- macosx/DockTextField.m | 9 +-------- macosx/HBController.m | 10 +++------- macosx/HBPlayerHUDController.m | 9 ++------- macosx/HBPreferencesController.m | 5 +---- macosx/HBQueueController.m | 5 +---- macosx/HandBrake.xcodeproj/project.pbxproj | 20 ++++---------------- macosx/xcconfig/base/os.osx1011.xcconfig | 1 + macosx/xcconfig/osx1011.x86_64.xcconfig | 3 +++ make/variant/darwin.defs | 2 +- 9 files changed, 17 insertions(+), 47 deletions(-) create mode 100644 macosx/xcconfig/base/os.osx1011.xcconfig create mode 100644 macosx/xcconfig/osx1011.x86_64.xcconfig diff --git a/macosx/DockTextField.m b/macosx/DockTextField.m index 04f39b8ce..62a7e337d 100644 --- a/macosx/DockTextField.m +++ b/macosx/DockTextField.m @@ -41,14 +41,7 @@ shadow.shadowOffset = NSMakeSize(2, -2); shadow.shadowBlurRadius = 6; - NSFont *font; - if ([[NSFont class] respondsToSelector:@selector(monospacedDigitSystemFontOfSize:weight:)]) { - // On macOS 10.11+ the monospaced digit system is available. - font = [NSFont monospacedDigitSystemFontOfSize:fontSize weight:NSFontWeightBold]; - } else { - // macOS 10.10- use the default system font. - font = [NSFont boldSystemFontOfSize:fontSize]; - } + NSFont *font = [NSFont monospacedDigitSystemFontOfSize:fontSize weight:NSFontWeightBold]; return @{ NSForegroundColorAttributeName: [NSColor whiteColor], NSFontAttributeName: font, diff --git a/macosx/HBController.m b/macosx/HBController.m index b7d519bbe..15c9a43da 100644 --- a/macosx/HBController.m +++ b/macosx/HBController.m @@ -898,13 +898,9 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext; isDirectory:YES]; } - [panel setDirectoryURL:sourceDirectory]; - [panel setAccessoryView:self.openTitleView]; - - if ([panel respondsToSelector:@selector(isAccessoryViewDisclosed)]) - { - panel.accessoryViewDisclosed = YES; - } + panel.directoryURL = sourceDirectory; + panel.accessoryView = self.openTitleView; + panel.accessoryViewDisclosed = YES; [panel beginSheetModalForWindow:self.window completionHandler: ^(NSInteger result) { diff --git a/macosx/HBPlayerHUDController.m b/macosx/HBPlayerHUDController.m index ab459aea8..05040c417 100644 --- a/macosx/HBPlayerHUDController.m +++ b/macosx/HBPlayerHUDController.m @@ -43,13 +43,8 @@ { [super viewDidLoad]; - if ([[NSFont class] respondsToSelector:@selector(monospacedDigitSystemFontOfSize:weight:)]) { - _normalMonospacedAttr = @{NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:15 weight:NSFontWeightRegular]}; - _monospacedAttr = @{NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:[NSFont smallSystemFontSize] weight:NSFontWeightRegular]}; - } - else { - _monospacedAttr = @{NSFontAttributeName: [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]}; - } + _normalMonospacedAttr = @{NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:15 weight:NSFontWeightRegular]}; + _monospacedAttr = @{NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:[NSFont smallSystemFontSize] weight:NSFontWeightRegular]}; } - (BOOL)canBeHidden diff --git a/macosx/HBPreferencesController.m b/macosx/HBPreferencesController.m index 3f66bd717..4a00fd8ea 100644 --- a/macosx/HBPreferencesController.m +++ b/macosx/HBPreferencesController.m @@ -293,10 +293,7 @@ view.hidden = YES; [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) { - if ([context respondsToSelector:@selector(setAllowsImplicitAnimation:)]) - { - context.allowsImplicitAnimation = YES; - } + context.allowsImplicitAnimation = YES; [window layoutIfNeeded]; } completionHandler:^{ diff --git a/macosx/HBQueueController.m b/macosx/HBQueueController.m index fc2e5108f..9051ef9e1 100644 --- a/macosx/HBQueueController.m +++ b/macosx/HBQueueController.m @@ -649,10 +649,7 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext; if (volumeURL) { - if ([volumeURL respondsToSelector:@selector(removeCachedResourceValueForKey:)]) - { - [volumeURL removeCachedResourceValueForKey:NSURLVolumeAvailableCapacityKey]; - } + [volumeURL removeCachedResourceValueForKey:NSURLVolumeAvailableCapacityKey]; attrs = [volumeURL resourceValuesForKeys:@[NSURLVolumeAvailableCapacityKey] error:NULL]; if (attrs[NSURLVolumeAvailableCapacityKey]) diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj index abc11e5af..b70911fe3 100644 --- a/macosx/HandBrake.xcodeproj/project.pbxproj +++ b/macosx/HandBrake.xcodeproj/project.pbxproj @@ -204,7 +204,6 @@ A957EBCD218DBE5900007988 /* HBAutoNamer.m in Sources */ = {isa = PBXBuildFile; fileRef = A957EBCC218DBE5900007988 /* HBAutoNamer.m */; }; A95BC1E71CD2548A008D6A33 /* volHighTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = A95BC1E51CD2548A008D6A33 /* volHighTemplate.pdf */; }; A95BC1E81CD2548A008D6A33 /* volLowTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = A95BC1E61CD2548A008D6A33 /* volLowTemplate.pdf */; }; - A9637D8A20F7A252001EAE7C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A9637D8820F7A252001EAE7C /* InfoPlist.strings */; }; A96664B01CCE45BF00DA4A57 /* HBPlayerHUDController.m in Sources */ = {isa = PBXBuildFile; fileRef = A96664AE1CCE45BF00DA4A57 /* HBPlayerHUDController.m */; }; A96664B51CCE48F700DA4A57 /* HBPictureHUDController.m in Sources */ = {isa = PBXBuildFile; fileRef = A96664B31CCE48F700DA4A57 /* HBPictureHUDController.m */; }; A96664BA1CCE493D00DA4A57 /* HBEncodingProgressHUDController.m in Sources */ = {isa = PBXBuildFile; fileRef = A96664B81CCE493D00DA4A57 /* HBEncodingProgressHUDController.m */; }; @@ -513,7 +512,6 @@ A95BC1E51CD2548A008D6A33 /* volHighTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = volHighTemplate.pdf; sourceTree = ""; }; A95BC1E61CD2548A008D6A33 /* volLowTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = volLowTemplate.pdf; sourceTree = ""; }; A95CB2FB217B6D07001E9F51 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - A9637D8920F7A252001EAE7C /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/InfoPlist.strings; sourceTree = ""; }; A9637D9120F7A252001EAE7C /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/HBEncodingProgressHUDController.strings; sourceTree = ""; }; A9637D9220F7A252001EAE7C /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/HBTitleSelection.strings; sourceTree = ""; }; A9637D9320F7A252001EAE7C /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Presets.strings; sourceTree = ""; }; @@ -1185,7 +1183,6 @@ A9DF49261C884C4E008AC14A /* HBPresetsTests.m */, A94A98F41C858EFB004BA9BA /* HBDictTests.m */, A9736F141C7DA5FE008F1D18 /* Info.plist */, - A9637D8820F7A252001EAE7C /* InfoPlist.strings */, ); path = HandBrakeKitTests; sourceTree = ""; @@ -1634,7 +1631,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - A9637D8A20F7A252001EAE7C /* InfoPlist.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1874,14 +1870,6 @@ name = MainWindow.xib; sourceTree = ""; }; - A9637D8820F7A252001EAE7C /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - A9637D8920F7A252001EAE7C /* de */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; A975B02020F7AF29004675CC /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( @@ -2168,7 +2156,7 @@ CFLocalizedString, HBKitLocalizedString, ); - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.11; OTHER_LDFLAGS = ( "-filelist", "$(EXTERNAL_BUILD)/macosx/osl.filelist.txt", @@ -2237,7 +2225,7 @@ CFLocalizedString, HBKitLocalizedString, ); - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.11; OTHER_LDFLAGS = ( "-filelist", "$(EXTERNAL_BUILD)/macosx/osl.filelist.txt", @@ -2690,7 +2678,7 @@ CFLocalizedString, HBKitLocalizedString, ); - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.11; OTHER_LDFLAGS = ( "-filelist", "$(EXTERNAL_BUILD)/macosx/osl.filelist.txt", @@ -2941,7 +2929,7 @@ CFLocalizedString, HBKitLocalizedString, ); - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.11; OTHER_LDFLAGS = ( "-filelist", "$(EXTERNAL_BUILD)/macosx/osl.filelist.txt", diff --git a/macosx/xcconfig/base/os.osx1011.xcconfig b/macosx/xcconfig/base/os.osx1011.xcconfig new file mode 100644 index 000000000..e6a6a4eb3 --- /dev/null +++ b/macosx/xcconfig/base/os.osx1011.xcconfig @@ -0,0 +1 @@ +MACOSX_DEPLOYMENT_TARGET = 10.10 diff --git a/macosx/xcconfig/osx1011.x86_64.xcconfig b/macosx/xcconfig/osx1011.x86_64.xcconfig new file mode 100644 index 000000000..fba1b2761 --- /dev/null +++ b/macosx/xcconfig/osx1011.x86_64.xcconfig @@ -0,0 +1,3 @@ +#include "base/os.osx1011.xcconfig" +#include "base/arch.x86_64.xcconfig" +EXTERNAL_XCCONFIG = osx1011.x86_64 diff --git a/make/variant/darwin.defs b/make/variant/darwin.defs index 1e06fb7ad..ec17f9e5f 100644 --- a/make/variant/darwin.defs +++ b/make/variant/darwin.defs @@ -1,4 +1,4 @@ -UB.xcconfigs = osx1010.i386 osx1010.x86_64 +UB.xcconfigs = osx1011.x86_64 UB.builds = $(wildcard $(foreach n,$(UB.xcconfigs),$(SRC/)build.$n)) UB.first = $(word 1,$(UB.xcconfigs)) UB.more = $(wordlist 2,999,$(UB.xcconfigs)) -- 2.40.0