summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macosx/Base.lproj/OutputPanel.xib23
-rw-r--r--macosx/HBAdvancedController.m4
-rw-r--r--macosx/HBChapterTitlesController.m4
-rw-r--r--macosx/HBController.m2
-rw-r--r--macosx/HBDistributedArray.m24
-rw-r--r--macosx/HBEncodingProgressHUDController.m10
-rw-r--r--macosx/HBPictureHUDController.m12
-rw-r--r--macosx/HBPlayerHUDController.m17
-rw-r--r--macosx/HBPreferencesController.m7
-rw-r--r--macosx/HBPresetsViewController.m4
-rw-r--r--macosx/HBPreviewView.m4
-rw-r--r--macosx/HBPreviewViewController.m4
-rw-r--r--macosx/HBSummaryViewController.m19
-rw-r--r--macosx/HBToolbarBadgedItem.m16
14 files changed, 48 insertions, 102 deletions
diff --git a/macosx/Base.lproj/OutputPanel.xib b/macosx/Base.lproj/OutputPanel.xib
index cfde9616a..c4b46fac8 100644
--- a/macosx/Base.lproj/OutputPanel.xib
+++ b/macosx/Base.lproj/OutputPanel.xib
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14295.6" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
- <development version="7000" identifier="xcode"/>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
+ <development version="8000" identifier="xcode"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14295.6"/>
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="HBOutputPanelController">
@@ -27,31 +28,31 @@
<scrollView horizontalLineScroll="0.0" horizontalPageScroll="0.0" verticalLineScroll="0.0" verticalPageScroll="0.0" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="19">
<rect key="frame" x="-1" y="-1" width="380" height="441"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <clipView key="contentView" id="mnc-sf-Cwe">
- <rect key="frame" x="1" y="1" width="363" height="439"/>
+ <clipView key="contentView" drawsBackground="NO" id="mnc-sf-Cwe">
+ <rect key="frame" x="1" y="1" width="378" height="439"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
- <textView editable="NO" importsGraphics="NO" richText="NO" findStyle="bar" incrementalSearchingEnabled="YES" id="20">
+ <textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" findStyle="bar" incrementalSearchingEnabled="YES" allowsNonContiguousLayout="YES" id="20">
<rect key="frame" x="0.0" y="0.0" width="378" height="439"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
- <size key="minSize" width="363" height="439"/>
+ <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+ <size key="minSize" width="378" height="439"/>
<size key="maxSize" width="743" height="10000000"/>
- <color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
+ <color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
<connections>
<outlet property="delegate" destination="-2" id="21"/>
<outlet property="menu" destination="11" id="22"/>
</connections>
</textView>
</subviews>
- <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="40">
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" verticalHuggingPriority="750" horizontal="NO" id="39">
- <rect key="frame" x="364" y="1" width="15" height="439"/>
+ <rect key="frame" x="363" y="1" width="16" height="439"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
diff --git a/macosx/HBAdvancedController.m b/macosx/HBAdvancedController.m
index e4fbb775c..2bd81b198 100644
--- a/macosx/HBAdvancedController.m
+++ b/macosx/HBAdvancedController.m
@@ -86,9 +86,9 @@
return self;
}
-- (void)loadView
+- (void)viewDidLoad
{
- [super loadView];
+ [super viewDidLoad];
[self setHidden:NO];
}
diff --git a/macosx/HBChapterTitlesController.m b/macosx/HBChapterTitlesController.m
index 5154f0af2..5993fdac2 100644
--- a/macosx/HBChapterTitlesController.m
+++ b/macosx/HBChapterTitlesController.m
@@ -180,9 +180,9 @@
self.chapterTitles = job.chapterTitles;
}
-- (void)loadView
+- (void)viewDidLoad
{
- [super loadView];
+ [super viewDidLoad];
self.table.doubleAction = @selector(doubleClickAction:);
}
diff --git a/macosx/HBController.m b/macosx/HBController.m
index 4e38c5852..16c48d5c2 100644
--- a/macosx/HBController.m
+++ b/macosx/HBController.m
@@ -102,7 +102,7 @@
@property (nonatomic, weak) IBOutlet HBToolbarBadgedItem *showQueueToolbarItem;
-@property (nonatomic, unsafe_unretained) IBOutlet NSView *openTitleView;
+@property (nonatomic, weak) IBOutlet NSView *openTitleView;
@property (nonatomic, readwrite) BOOL scanSpecificTitle;
@property (nonatomic, readwrite) NSInteger scanSpecificTitleIdx;
diff --git a/macosx/HBDistributedArray.m b/macosx/HBDistributedArray.m
index 266382166..f92abfdf5 100644
--- a/macosx/HBDistributedArray.m
+++ b/macosx/HBDistributedArray.m
@@ -60,7 +60,6 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
@property (nonatomic, readwrite) NSTimeInterval modifiedTime;
@property (nonatomic, readonly) NSSet *objectClasses;
-@property (nonatomic, readonly) BOOL requiresSecureCoding;
@property (nonatomic, readonly) sem_t *mutex;
@property (nonatomic, readwrite) uint32_t mutexCount;
@@ -78,12 +77,6 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
_array = [[NSMutableArray alloc] init];
_objectClasses = [NSSet setWithObjects:[NSMutableArray class], objectClass, nil];
- // Enable secure coding only on 10.9 and later
- if ([NSURL instancesRespondToSelector:@selector(fileSystemRepresentation)])
- {
- _requiresSecureCoding = YES;
- }
-
NSString *identifier = [[NSBundle mainBundle] bundleIdentifier];
NSArray *runningInstances = [NSRunningApplication runningApplicationsWithBundleIdentifier:identifier];
const char *name = [NSString stringWithFormat:@"%@/%@", identifier, _fileURL.lastPathComponent.stringByDeletingPathExtension].UTF8String;
@@ -204,18 +197,11 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
NSMutableArray *jobsArray = nil;
@try
{
- if (self.requiresSecureCoding)
- {
- NSData *queue = [NSData dataWithContentsOfURL:self.fileURL];
- NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:queue];
- unarchiver.requiresSecureCoding = YES;
- jobsArray = [unarchiver decodeObjectOfClasses:self.objectClasses forKey:NSKeyedArchiveRootObjectKey];
- [unarchiver finishDecoding];
- }
- else
- {
- jobsArray = [NSKeyedUnarchiver unarchiveObjectWithFile:self.fileURL.path];
- }
+ NSData *queue = [NSData dataWithContentsOfURL:self.fileURL];
+ NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:queue];
+ unarchiver.requiresSecureCoding = YES;
+ jobsArray = [unarchiver decodeObjectOfClasses:self.objectClasses forKey:NSKeyedArchiveRootObjectKey];
+ [unarchiver finishDecoding];
}
@catch (NSException *exception)
{
diff --git a/macosx/HBEncodingProgressHUDController.m b/macosx/HBEncodingProgressHUDController.m
index 4ac16e1ea..da417bf02 100644
--- a/macosx/HBEncodingProgressHUDController.m
+++ b/macosx/HBEncodingProgressHUDController.m
@@ -20,16 +20,6 @@
return @"HBEncodingProgressHUDController";
}
-- (void)loadView
-{
- [super loadView];
-
- if (NSClassFromString(@"NSVisualEffectView") == NO)
- {
- self.infoLabel.textColor = [NSColor whiteColor];
- }
-}
-
- (BOOL)canBeHidden
{
return NO;
diff --git a/macosx/HBPictureHUDController.m b/macosx/HBPictureHUDController.m
index 1312e1a5d..8db23767b 100644
--- a/macosx/HBPictureHUDController.m
+++ b/macosx/HBPictureHUDController.m
@@ -30,17 +30,9 @@
return @"HBPictureHUDController";
}
-- (void)loadView
+- (void)viewDidLoad
{
- [super loadView];
-
- if (NSClassFromString(@"NSVisualEffectView") == NO)
- {
- self.scaleLabel.textColor = [NSColor whiteColor];
- self.infoLabel.textColor = [NSColor whiteColor];
- self.durationLabel.textColor = [NSColor whiteColor];
- self.durationUnitLabel.textColor = [NSColor whiteColor];
- }
+ [super viewDidLoad];
// we set the preview length popup in seconds
[self.durationPopUp removeAllItems];
diff --git a/macosx/HBPlayerHUDController.m b/macosx/HBPlayerHUDController.m
index 82b68b494..311a2b0d5 100644
--- a/macosx/HBPlayerHUDController.m
+++ b/macosx/HBPlayerHUDController.m
@@ -32,9 +32,9 @@
return @"HBPlayerHUDController";
}
-- (void)loadView
+- (void)viewDidLoad
{
- [super loadView];
+ [super viewDidLoad];
if ([[NSFont class] respondsToSelector:@selector(monospacedDigitSystemFontOfSize:weight:)]) {
_monospacedAttr = @{NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:[NSFont smallSystemFontSize] weight:NSFontWeightRegular]};
@@ -66,23 +66,20 @@
{
[self _buildTracksMenu];
- // 10.7 does not supports weak NSViewController,
- // so use self and disable the warning for now.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Warc-retain-cycles"
+ __weak HBPlayerHUDController *weakSelf = self;
self.periodicObserver = [self.player addPeriodicTimeObserverUsingBlock:^(NSTimeInterval time) {
- [self _refreshUI];
+ [weakSelf _refreshUI];
}];
self.rateObserver = [self.player addRateObserverUsingBlock:^{
- if (self.player.rate != 0.0)
+ if (weakSelf.player.rate != 0.0)
{
- self.playButton.image = [NSImage imageNamed:@"PauseTemplate"];
+ weakSelf.playButton.image = [NSImage imageNamed:@"PauseTemplate"];
}
else
{
- self.playButton.image = [NSImage imageNamed:@"PlayTemplate"];
+ weakSelf.playButton.image = [NSImage imageNamed:@"PlayTemplate"];
}
}];
diff --git a/macosx/HBPreferencesController.m b/macosx/HBPreferencesController.m
index 753f371fb..aa02821f6 100644
--- a/macosx/HBPreferencesController.m
+++ b/macosx/HBPreferencesController.m
@@ -104,15 +104,14 @@
}
/**
- * -[HBPreferencesController awakeFromNib]
*
* Called after all the outlets in the nib file have been attached. Sets up the
* toolbar and shows the "General" pane.
*
*/
-- (void) awakeFromNib
+- (void)windowDidLoad
{
- NSToolbar * toolbar = [[NSToolbar alloc] initWithIdentifier: @"Preferences Toolbar"];
+ NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier: @"Preferences Toolbar"];
[toolbar setDelegate: self];
[toolbar setAllowsUserCustomization: NO];
[toolbar setDisplayMode: NSToolbarDisplayModeIconAndLabel];
@@ -294,7 +293,7 @@
view.hidden = YES;
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
- if ([context respondsToSelector:@selector(setAllowsImplicitAnimation:)] && NSClassFromString(@"NSVisualEffectView"))
+ if ([context respondsToSelector:@selector(setAllowsImplicitAnimation:)])
{
context.allowsImplicitAnimation = YES;
}
diff --git a/macosx/HBPresetsViewController.m b/macosx/HBPresetsViewController.m
index 17e174f56..b2888d30f 100644
--- a/macosx/HBPresetsViewController.m
+++ b/macosx/HBPresetsViewController.m
@@ -83,9 +83,9 @@ static void *HBPresetsViewControllerContext = &HBPresetsViewControllerContext;
return self;
}
-- (void)loadView
+- (void)viewDidLoad
{
- [super loadView];
+ [super viewDidLoad];
if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_10)
{
diff --git a/macosx/HBPreviewView.m b/macosx/HBPreviewView.m
index ff97ad274..3f10b7c10 100644
--- a/macosx/HBPreviewView.m
+++ b/macosx/HBPreviewView.m
@@ -57,9 +57,7 @@
_backLayer = [CALayer layer];
[_backLayer setBounds:CGRectMake(0.0, 0.0, self.frame.size.width, self.frame.size.height)];
- CGColorRef white = CGColorCreateGenericRGB(1.0, 1.0, 1.0, 1.0);
- [_backLayer setBackgroundColor: white];
- CFRelease(white);
+ [_backLayer setBackgroundColor: NSColor.whiteColor.CGColor];
[_backLayer setShadowOpacity:0.5f];
[_backLayer setShadowOffset:CGSizeMake(0, 0)];
[_backLayer setAnchorPoint:CGPointMake(0, 0)];
diff --git a/macosx/HBPreviewViewController.m b/macosx/HBPreviewViewController.m
index a9e275e28..ca63d424a 100644
--- a/macosx/HBPreviewViewController.m
+++ b/macosx/HBPreviewViewController.m
@@ -38,9 +38,9 @@
return self;
}
-- (void)loadView
+- (void)viewDidLoad
{
- [super loadView];
+ [super viewDidLoad];
self.visible = YES;
self.previewView.showShadow = NO;
diff --git a/macosx/HBSummaryViewController.m b/macosx/HBSummaryViewController.m
index 453f31352..443767725 100644
--- a/macosx/HBSummaryViewController.m
+++ b/macosx/HBSummaryViewController.m
@@ -52,9 +52,9 @@ static void *HBSummaryViewControllerSubsContext = &HBSummaryViewControllerSubsCo
return self;
}
-- (void)loadView
+- (void)viewDidLoad
{
- [super loadView];
+ [super viewDidLoad];
self.previewViewController.view.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
self.previewViewController.view.frame = NSMakeRect(0, 0, self.previewView.frame.size.width, self.previewView.frame.size.height);
[self.previewView addSubview:self.previewViewController.view];
@@ -117,16 +117,13 @@ static void *HBSummaryViewControllerSubsContext = &HBSummaryViewControllerSubsCo
}
else if (context == HBSummaryViewControllerContainerContext)
{
- if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_10 && change[NSKeyValueChangeNewKey])
+ if ([change[NSKeyValueChangeNewKey] integerValue] & 0x030000)
{
- if ([change[NSKeyValueChangeNewKey] integerValue] & 0x030000)
- {
- self.bottomOptionsConstrain.active = YES;
- }
- else
- {
- self.bottomOptionsConstrain.active = NO;
- }
+ self.bottomOptionsConstrain.active = YES;
+ }
+ else
+ {
+ self.bottomOptionsConstrain.active = NO;
}
[self updateTracks:nil];
}
diff --git a/macosx/HBToolbarBadgedItem.m b/macosx/HBToolbarBadgedItem.m
index dfce12f5b..bae3ab133 100644
--- a/macosx/HBToolbarBadgedItem.m
+++ b/macosx/HBToolbarBadgedItem.m
@@ -85,19 +85,6 @@
#pragma mark -- Private Methods
-- (CGColorRef)copyNSColorToCGColor:(NSColor *)color
-{
- // CGColor property of NSColor has been added only in 10.8,
- // we need to support 10.7 too.
- NSInteger numberOfComponents = [color numberOfComponents];
- CGFloat components[numberOfComponents];
- CGColorSpaceRef colorSpace = [[color colorSpace] CGColorSpace];
- [color getComponents:(CGFloat *)&components];
- CGColorRef cgColor = CGColorCreate(colorSpace, components);
-
- return cgColor;
-}
-
- (void)HB_refreshBadge
{
if (_badgeValue.length)
@@ -194,9 +181,8 @@
CGContextAddArcToPoint(context, maxx, maxy, midx, maxy, radius);
CGContextAddArcToPoint(context, minx, maxy, minx, midy, radius);
CGContextClosePath(context);
- CGColorRef fillColor = [self copyNSColorToCGColor:_badgeFillColor];
+ CGColorRef fillColor = _badgeFillColor.CGColor;
CGContextSetFillColorWithColor(context,fillColor);
- CFRelease(fillColor);
CGContextDrawPath(context, kCGPathFill);
// Draw the text