summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorritsuka <[email protected]>2015-01-25 08:02:47 +0000
committerritsuka <[email protected]>2015-01-25 08:02:47 +0000
commit8e7fdbaed7f2ece531fee19ebc6c3f0f284b795d (patch)
treeb812001465c02d5ff86e8eaa7ae80a80bca885da /macosx
parentffc93adeaa23923c1c8b401e45cf4b155e4e99eb (diff)
MacGui: add a "Add Titles to Queue…" menu item that let select which titles are added to the queue.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6810 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r--macosx/English.lproj/HBTitleSelection.xib141
-rw-r--r--macosx/English.lproj/MainMenu.xib10
-rw-r--r--macosx/HBController.m132
-rw-r--r--macosx/HBTitleSelectionController.h19
-rw-r--r--macosx/HBTitleSelectionController.m112
-rw-r--r--macosx/HandBrake.xcodeproj/project.pbxproj30
6 files changed, 396 insertions, 48 deletions
diff --git a/macosx/English.lproj/HBTitleSelection.xib b/macosx/English.lproj/HBTitleSelection.xib
new file mode 100644
index 000000000..c1ddb8235
--- /dev/null
+++ b/macosx/English.lproj/HBTitleSelection.xib
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6724" systemVersion="14C106a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+ <dependencies>
+ <deployment identifier="macosx"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6724"/>
+ </dependencies>
+ <objects>
+ <customObject id="-2" userLabel="File's Owner" customClass="HBTitleSelectionController">
+ <connections>
+ <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
+ </connections>
+ </customObject>
+ <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+ <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+ <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" oneShot="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="F0z-JX-Cv5">
+ <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
+ <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
+ <rect key="contentRect" x="196" y="240" width="504" height="250"/>
+ <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
+ <value key="minSize" type="size" width="300" height="200"/>
+ <view key="contentView" id="se5-gp-TjO">
+ <rect key="frame" x="0.0" y="7" width="504" height="250"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <subviews>
+ <scrollView autohidesScrollers="YES" horizontalLineScroll="18" horizontalPageScroll="10" verticalLineScroll="18" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="a1K-L9-fU9">
+ <rect key="frame" x="20" y="57" width="464" height="151"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <clipView key="contentView" id="dTc-E7-D15">
+ <rect key="frame" x="1" y="0.0" width="238" height="134"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" alternatingRowBackgroundColors="YES" columnReordering="NO" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="14" id="wM9-Ln-dr0">
+ <rect key="frame" x="0.0" y="0.0" width="462" height="19"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <size key="intercellSpacing" width="3" height="4"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <tableViewGridLines key="gridStyleMask" vertical="YES"/>
+ <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
+ <tableColumns>
+ <tableColumn identifier="index" width="30" minWidth="30" maxWidth="30" id="4XY-C0-SwE">
+ <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="right">
+ <font key="font" metaFont="smallSystem"/>
+ <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
+ </tableHeaderCell>
+ <textFieldCell key="dataCell" controlSize="small" lineBreakMode="truncatingTail" alignment="right" title="Text Cell" id="zwi-rc-q6x">
+ <font key="font" metaFont="smallSystem"/>
+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
+ </tableColumn>
+ <tableColumn identifier="title" width="333" minWidth="40" maxWidth="2000" id="FQY-Ye-g0f">
+ <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
+ <font key="font" metaFont="smallSystem"/>
+ <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
+ </tableHeaderCell>
+ <buttonCell key="dataCell" type="check" title="Check" bezelStyle="regularSquare" imagePosition="left" controlSize="small" inset="2" id="k84-a6-eZ7">
+ <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+ <font key="font" metaFont="smallSystem"/>
+ </buttonCell>
+ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
+ </tableColumn>
+ <tableColumn identifier="duration" width="90" minWidth="90" maxWidth="90" id="a6r-ky-REh">
+ <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
+ <font key="font" metaFont="smallSystem"/>
+ <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
+ </tableHeaderCell>
+ <textFieldCell key="dataCell" controlSize="small" lineBreakMode="truncatingTail" alignment="left" title="Text Cell" id="Fcv-FE-8Fv">
+ <font key="font" metaFont="smallSystem"/>
+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
+ </tableColumn>
+ </tableColumns>
+ <connections>
+ <outlet property="dataSource" destination="-2" id="bFm-Ca-P9Y"/>
+ <outlet property="delegate" destination="-2" id="jJ2-f7-lui"/>
+ </connections>
+ </tableView>
+ </subviews>
+ <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+ </clipView>
+ <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="KUp-wz-bHB">
+ <rect key="frame" x="1" y="119" width="223" height="15"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </scroller>
+ <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="iFv-s2-21F">
+ <rect key="frame" x="224" y="17" width="15" height="102"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </scroller>
+ </scrollView>
+ <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="5Jw-On-iU3">
+ <rect key="frame" x="18" y="216" width="263" height="14"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Select the titles to add to the queue:" id="5tD-fg-g4t">
+ <font key="font" metaFont="smallSystemBold"/>
+ <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ </textField>
+ <button verticalHuggingPriority="750" id="TFh-c7-W2w">
+ <rect key="frame" x="425" y="14" width="64" height="28"/>
+ <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+ <buttonCell key="cell" type="push" title="Add" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="mOe-XL-tl1">
+ <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+ <font key="font" metaFont="smallSystem"/>
+ <string key="keyEquivalent" base64-UTF8="YES">
+DQ
+</string>
+ </buttonCell>
+ <connections>
+ <action selector="add:" target="-2" id="3wk-rU-eSZ"/>
+ </connections>
+ </button>
+ <button verticalHuggingPriority="750" id="t5w-9e-K60">
+ <rect key="frame" x="342" y="14" width="81" height="28"/>
+ <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+ <buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="jHg-nh-9NJ">
+ <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+ <font key="font" metaFont="smallSystem"/>
+ <string key="keyEquivalent" base64-UTF8="YES">
+Gw
+</string>
+ </buttonCell>
+ <connections>
+ <action selector="cancel:" target="-2" id="DP7-vq-pVX"/>
+ </connections>
+ </button>
+ </subviews>
+ </view>
+ <connections>
+ <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
+ </connections>
+ <point key="canvasLocation" x="501" y="-14"/>
+ </window>
+ </objects>
+</document>
diff --git a/macosx/English.lproj/MainMenu.xib b/macosx/English.lproj/MainMenu.xib
index 112c27a1f..486f503f0 100644
--- a/macosx/English.lproj/MainMenu.xib
+++ b/macosx/English.lproj/MainMenu.xib
@@ -97,9 +97,15 @@
<action selector="addToQueue:" target="-1" id="9mH-2S-tBG"/>
</connections>
</menuItem>
- <menuItem title="Add All Titles To Queue…" keyEquivalent="B" id="5897">
+ <menuItem title="Add Titles To Queue…" keyEquivalent="B" id="5897">
<connections>
- <action selector="addAllTitlesToQueue:" target="-1" id="EyT-yw-TMf"/>
+ <action selector="addTitlesToQueue:" target="-1" id="Ohu-Az-0ME"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Add All Titles To Queue" alternate="YES" keyEquivalent="B" id="oYh-V7-kbx">
+ <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+ <connections>
+ <action selector="addAllTitlesToQueue:" target="-1" id="zTW-SV-C4n"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="Kee-pg-bfk">
diff --git a/macosx/HBController.m b/macosx/HBController.m
index e9a884c98..9de07ef23 100644
--- a/macosx/HBController.m
+++ b/macosx/HBController.m
@@ -7,6 +7,7 @@
#import "HBController.h"
#import "HBQueueController.h"
+#import "HBTitleSelectionController.h"
#import "HBPresetsManager.h"
#import "HBPreset.h"
@@ -27,12 +28,14 @@
#import "HBCore.h"
#import "HBJob.h"
-@interface HBController () <HBPresetsViewControllerDelegate, HBPreviewControllerDelegate, HBPictureControllerDelegate>
+@interface HBController () <HBPresetsViewControllerDelegate, HBPreviewControllerDelegate, HBPictureControllerDelegate, HBTitleSelectionDelegate>
@property (assign) IBOutlet NSView *openTitleView;
@property (nonatomic, readwrite) BOOL scanSpecificTitle;
@property (nonatomic, readwrite) NSInteger scanSpecificTitleIdx;
+@property (nonatomic, readwrite, retain) HBTitleSelectionController *titlesSelectionController;
+
/**
* The name of the source, it might differ from the source
* last path component if it's a package or a folder.
@@ -373,7 +376,7 @@
{
SEL action = [menuItem action];
- if (action == @selector(addToQueue:) || action == @selector(addAllTitlesToQueue:) ||
+ if (action == @selector(addToQueue:) || action == @selector(addAllTitlesToQueue:) || action == @selector(addTitlesToQueue:) ||
action == @selector(showPicturePanel:) || action == @selector(showAddPresetPanel:) ||
action == @selector(showPreviewWindow:))
{
@@ -516,12 +519,22 @@
{
if (result == NSOKButton)
{
- NSURL *scanURL = panel.URL;
- // we set the last searched source directory in the prefs here
- [[NSUserDefaults standardUserDefaults] setURL:scanURL.URLByDeletingLastPathComponent forKey:@"HBLastSourceDirectoryURL"];
-
NSURL *url = panel.URL;
+ // Check if we selected a folder or not
+ id outValue = nil;
+ [url getResourceValue:&outValue forKey:NSURLIsDirectoryKey error:NULL];
+
+ // we set the last searched source directory in the prefs here
+ if ([outValue boolValue])
+ {
+ [[NSUserDefaults standardUserDefaults] setURL:url forKey:@"HBLastSourceDirectoryURL"];
+ }
+ else
+ {
+ [[NSUserDefaults standardUserDefaults] setURL:url.URLByDeletingLastPathComponent forKey:@"HBLastSourceDirectoryURL"];
+ }
+
// We check to see if the chosen file at path is a package
if ([[NSWorkspace sharedWorkspace] isFilePackageAtPath:url.path])
{
@@ -592,7 +605,9 @@
}];
}
-/* Here we actually tell hb_scan to perform the source scan, using the path to source and title number*/
+/**
+ * Here we actually tell hb_scan to perform the source scan, using the path to source and title number
+ */
- (void)performScan:(NSURL *)scanURL scanTitleNum:(NSInteger)scanTitleNum
{
// Save the current settings
@@ -1145,56 +1160,93 @@
- (IBAction)pause:(id)sender
{
- if (fQueueController.core.state == HBStatePaused)
- {
- [fQueueController.core resume];
- }
- else
- {
- [fQueueController.core pause];
- }
+ [fQueueController togglePauseResume:sender];
}
#pragma mark -
#pragma mark Batch Queue Titles Methods
-- (IBAction)addAllTitlesToQueue:(id)sender
+- (IBAction)addTitlesToQueue:(id)sender
{
- NSAlert *alert = [[NSAlert alloc] init];
- [alert setMessageText:NSLocalizedString(@"You are about to add ALL titles to the queue!", @"")];
- [alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Current preset will be applied to all %ld titles. Are you sure you want to do this?", @""), self.core.titles.count]];
- [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"")];
- [alert addButtonWithTitle:NSLocalizedString(@"Yes, I want to add all titles to the queue", @"")];
- [alert setAlertStyle:NSCriticalAlertStyle];
-
- [alert beginSheetModalForWindow:self.window modalDelegate:self didEndSelector:@selector(addAllTitlesToQueueAlertDone:returnCode:contextInfo:) contextInfo:NULL];
- [alert release];
+ self.titlesSelectionController = [[[HBTitleSelectionController alloc] initWithTitles:self.core.titles delegate:self] autorelease];
+
+ [NSApp beginSheet:self.titlesSelectionController.window
+ modalForWindow:self.window
+ modalDelegate:nil
+ didEndSelector:NULL
+ contextInfo:NULL];
}
-- (void)addAllTitlesToQueueAlertDone:(NSAlert *)alert
- returnCode:(NSInteger)returnCode
- contextInfo:(void *)contextInfo
+- (void)didSelectIndexes:(NSIndexSet *)indexes
{
- if (returnCode == NSAlertSecondButtonReturn)
- {
- [self doAddAllTitlesToQueue];
- }
+ [self.titlesSelectionController.window orderOut:nil];
+ [NSApp endSheet:self.titlesSelectionController.window];
+
+ [self doAddTitlesAtIndexesToQueue:indexes];
}
-- (void)doAddAllTitlesToQueue
+- (void)doAddTitlesAtIndexesToQueue:(NSIndexSet *)indexes;
{
NSMutableArray *jobs = [[NSMutableArray alloc] init];
+ BOOL fileExists = NO;
for (HBTitle *title in self.core.titles)
{
- HBJob *job = [[HBJob alloc] initWithTitle:title andPreset:self.selectedPreset];
- job.destURL = [self destURLForJob:job];
- [jobs addObject:job];
- [job release];
+ if ([indexes containsIndex:title.index])
+ {
+ HBJob *job = [[HBJob alloc] initWithTitle:title andPreset:self.selectedPreset];
+ job.destURL = [self destURLForJob:job];
+ job.title = nil;
+ [jobs addObject:job];
+ [job release];
+
+ if ([[NSFileManager defaultManager] fileExistsAtPath:job.destURL.path] || [fQueueController jobExistAtURL:job.destURL])
+ {
+ fileExists = YES;
+ }
+ }
+ }
+
+ if (fileExists)
+ {
+ // File exist, warn user
+ NSAlert *alert = [[NSAlert alloc] init];
+ [alert setMessageText:NSLocalizedString(@"File already exists.", nil)];
+ [alert setInformativeText:NSLocalizedString(@"One or more file already exists. Do you want to overwrite?", nil)];
+ [alert addButtonWithTitle:NSLocalizedString(@"Cancel", nil)];
+ [alert addButtonWithTitle:NSLocalizedString(@"Overwrite", nil)];
+ [alert setAlertStyle:NSCriticalAlertStyle];
+
+ [alert beginSheetModalForWindow:self.window modalDelegate:self didEndSelector:@selector(overwriteAddTitlesToQueueAlertDone:returnCode:contextInfo:) contextInfo:jobs];
+ [alert release];
}
+ else
+ {
+ [fQueueController addJobsFromArray:jobs];
+ [jobs release];
+ }
+}
- [fQueueController addJobsFromArray:jobs];
- [jobs release];
+- (void)overwriteAddTitlesToQueueAlertDone:(NSAlert *)alert
+ returnCode:(NSInteger)returnCode
+ contextInfo:(void *)contextInfo
+{
+ if (returnCode == NSAlertSecondButtonReturn)
+ {
+ NSArray *jobs = (NSArray *)contextInfo;
+ [fQueueController addJobsFromArray:jobs];
+ [jobs release];
+ }
+}
+
+- (IBAction)addAllTitlesToQueue:(id)sender
+{
+ NSMutableIndexSet *indexes = [NSMutableIndexSet indexSet];
+ for (HBTitle *title in self.core.titles)
+ {
+ [indexes addIndex:title.index];
+ }
+ [self doAddTitlesAtIndexesToQueue:indexes];
}
#pragma mark - Picture
@@ -1374,7 +1426,7 @@
[panel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result)
{
NSURL *importPresetsFile = [panel URL];
- NSURL *importPresetsDirectory = nil;//[importPresetsFile URLByDeletingLastPathComponent];
+ NSURL *importPresetsDirectory = [importPresetsFile URLByDeletingLastPathComponent];
[[NSUserDefaults standardUserDefaults] setURL:importPresetsDirectory forKey:@"LastPresetImportDirectoryURL"];
// NOTE: here we need to do some sanity checking to verify we do not hose up our presets file
diff --git a/macosx/HBTitleSelectionController.h b/macosx/HBTitleSelectionController.h
new file mode 100644
index 000000000..3dda1984b
--- /dev/null
+++ b/macosx/HBTitleSelectionController.h
@@ -0,0 +1,19 @@
+/* HBTitleSelectionController.h
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr/>.
+ It may be used under the terms of the GNU General Public License. */
+
+#import <Cocoa/Cocoa.h>
+
+@protocol HBTitleSelectionDelegate <NSObject>
+
+- (void)didSelectIndexes:(NSIndexSet *)indexes;
+
+@end
+
+@interface HBTitleSelectionController : NSWindowController
+
+- (instancetype)initWithTitles:(NSArray *)titles delegate:(id<HBTitleSelectionDelegate>)delegate;
+
+@end
diff --git a/macosx/HBTitleSelectionController.m b/macosx/HBTitleSelectionController.m
new file mode 100644
index 000000000..814c78991
--- /dev/null
+++ b/macosx/HBTitleSelectionController.m
@@ -0,0 +1,112 @@
+/* HBTitleSelectionController.h
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr/>.
+ It may be used under the terms of the GNU General Public License. */
+
+#import "HBTitleSelectionController.h"
+#import "HBTitle.h"
+
+@interface HBTitleSelectionController () <NSTableViewDataSource, NSTableViewDelegate>
+
+@property (nonatomic, readonly) NSArray *titles;
+@property (nonatomic, readonly) NSMutableArray *selection;
+
+@property (nonatomic, readonly) id<HBTitleSelectionDelegate> delegate;
+
+@end
+
+@implementation HBTitleSelectionController
+
+- (instancetype)initWithTitles:(NSArray *)titles delegate:(id<HBTitleSelectionDelegate>)delegate
+{
+ self = [super initWithWindowNibName:@"HBTitleSelection"];
+ if (self)
+ {
+ _titles = [titles retain];
+ _selection = [[NSMutableArray alloc] initWithCapacity:titles.count];
+ _delegate = delegate;
+
+ for (NSUInteger i = 0; i < titles.count; i++)
+ {
+ _selection[i] = @YES;
+ }
+ }
+
+ return self;
+}
+
+- (void)dealloc
+{
+ [_titles release];
+ _titles = nil;
+
+ [_selection release];
+ _selection = nil;
+
+ [super dealloc];
+}
+
+- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView
+{
+ return self.titles.count;
+}
+
+- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
+{
+ HBTitle *title = self.titles[row];
+
+ if ([tableColumn.identifier isEqualTo:@"index"])
+ {
+ return @(title.index);
+ }
+ else if ([tableColumn.identifier isEqualTo:@"title"])
+ {
+ return self.selection[row];
+ }
+ else if ([tableColumn.identifier isEqualTo:@"duration"])
+ {
+ return title.timeCode;
+ }
+
+ return nil;
+}
+
+- (void)tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row;
+{
+ if ([tableColumn.identifier isEqualTo:@"title"])
+ {
+ self.selection[row] = object;
+ }
+}
+
+- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
+{
+ if ([tableColumn.identifier isEqualTo:@"title"])
+ {
+ HBTitle *title = self.titles[row];
+ [aCell setTitle:title.name];
+ }
+}
+
+- (IBAction)add:(id)sender
+{
+ NSMutableIndexSet *indexes = [NSMutableIndexSet indexSet];
+
+ [self.selection enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+ if ([obj boolValue])
+ {
+ HBTitle *title = self.titles[idx];
+ [indexes addIndex:title.index];
+ }
+
+ }];
+ [self.delegate didSelectIndexes:indexes];
+}
+
+- (IBAction)cancel:(id)sender
+{
+ [self.delegate didSelectIndexes:[NSIndexSet indexSet]];
+}
+
+@end
diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj
index 05fa21643..f052c27ae 100644
--- a/macosx/HandBrake.xcodeproj/project.pbxproj
+++ b/macosx/HandBrake.xcodeproj/project.pbxproj
@@ -157,6 +157,8 @@
A9BB0F2719A0ECE40079F1C1 /* HBHUDButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A9BB0F2619A0ECE40079F1C1 /* HBHUDButtonCell.m */; };
A9BC24C91A69293E007DC41A /* HBAttributedStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A9BC24C81A69293E007DC41A /* HBAttributedStringAdditions.m */; };
A9C0DB85197E7B0000DF55B3 /* SubtitlesDefaults.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9C0DB83197E7B0000DF55B3 /* SubtitlesDefaults.xib */; };
+ A9C183961A716B8F00C897C2 /* HBTitleSelectionController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C183941A716B8F00C897C2 /* HBTitleSelectionController.m */; };
+ A9C1839D1A716BCC00C897C2 /* HBTitleSelection.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9C1839B1A716BCC00C897C2 /* HBTitleSelection.xib */; };
A9C9F88919A733FE00DC8923 /* HBHUDView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C9F88819A733FE00DC8923 /* HBHUDView.m */; };
A9CF25F11990D62C0023F727 /* Presets.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9CF25EF1990D62C0023F727 /* Presets.xib */; };
A9CF25F41990D64E0023F727 /* HBPreset.m in Sources */ = {isa = PBXBuildFile; fileRef = A9CF25F31990D64E0023F727 /* HBPreset.m */; };
@@ -429,6 +431,9 @@
A9BC24C71A69293E007DC41A /* HBAttributedStringAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBAttributedStringAdditions.h; sourceTree = "<group>"; };
A9BC24C81A69293E007DC41A /* HBAttributedStringAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBAttributedStringAdditions.m; sourceTree = "<group>"; };
A9C0DB84197E7B0000DF55B3 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = SubtitlesDefaults.xib; sourceTree = "<group>"; };
+ A9C183931A716B8F00C897C2 /* HBTitleSelectionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBTitleSelectionController.h; sourceTree = "<group>"; };
+ A9C183941A716B8F00C897C2 /* HBTitleSelectionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBTitleSelectionController.m; sourceTree = "<group>"; };
+ A9C1839C1A716BCC00C897C2 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = HBTitleSelection.xib; sourceTree = "<group>"; };
A9C9F88719A733FE00DC8923 /* HBHUDView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBHUDView.h; sourceTree = "<group>"; };
A9C9F88819A733FE00DC8923 /* HBHUDView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBHUDView.m; sourceTree = "<group>"; };
A9CF25F01990D62C0023F727 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Presets.xib; sourceTree = "<group>"; };
@@ -795,6 +800,7 @@
273F217C14ADDDA10021BE6D /* InfoPlist.strings */,
273F217E14ADDDA10021BE6D /* MainMenu.xib */,
A92268791A6E569B00A8D5C5 /* MainWindow.xib */,
+ A9C1839B1A716BCC00C897C2 /* HBTitleSelection.xib */,
A9CF25EF1990D62C0023F727 /* Presets.xib */,
A9E2FD291A21BC6F000E8D3F /* AddPreset.xib */,
A93E0ED51972958C00FD67FB /* Video.xib */,
@@ -971,16 +977,18 @@
A9B34D701976841800871B7D /* Main Window View Controllers */,
A9AA447C1970726500D7DEFC /* HBQueueController.h */,
A9906B2B1A710920001D82D5 /* HBQueueController.m */,
- 273F209B14ADBE670021BE6D /* HBOutputPanelController.h */,
- 273F209C14ADBE670021BE6D /* HBOutputPanelController.m */,
- 273F209F14ADBE670021BE6D /* HBPreferencesController.h */,
- 273F20A014ADBE670021BE6D /* HBPreferencesController.m */,
+ A9C183931A716B8F00C897C2 /* HBTitleSelectionController.h */,
+ A9C183941A716B8F00C897C2 /* HBTitleSelectionController.m */,
+ A9E2FD241A21BC4A000E8D3F /* HBAddPresetController.h */,
+ A9E2FD251A21BC4A000E8D3F /* HBAddPresetController.m */,
273F20A914ADBE670021BE6D /* HBPictureController.h */,
273F20AA14ADBE670021BE6D /* HBPictureController.m */,
273F20A314ADBE670021BE6D /* HBPreviewController.h */,
273F20A414ADBE670021BE6D /* HBPreviewController.m */,
- A9E2FD241A21BC4A000E8D3F /* HBAddPresetController.h */,
- A9E2FD251A21BC4A000E8D3F /* HBAddPresetController.m */,
+ 273F209B14ADBE670021BE6D /* HBOutputPanelController.h */,
+ 273F209C14ADBE670021BE6D /* HBOutputPanelController.m */,
+ 273F209F14ADBE670021BE6D /* HBPreferencesController.h */,
+ 273F20A014ADBE670021BE6D /* HBPreferencesController.m */,
);
name = Controllers;
sourceTree = "<group>";
@@ -1142,6 +1150,7 @@
A9CF25F11990D62C0023F727 /* Presets.xib in Resources */,
273F216114ADCBF80021BE6D /* JobSmall.png in Resources */,
273F216714ADCBF80021BE6D /* Reveal.png in Resources */,
+ A9C1839D1A716BCC00C897C2 /* HBTitleSelection.xib in Resources */,
273F216814ADCBF80021BE6D /* RevealHighlight.png in Resources */,
A91C02521A165EA200DEA6F3 /* EncodeComplete.png in Resources */,
273F216914ADCBF80021BE6D /* RevealHighlightPressed.png in Resources */,
@@ -1272,6 +1281,7 @@
273F20BE14ADC09F0021BE6D /* main.mm in Sources */,
A9537BF01A48A85C00141102 /* HBJob+UIAdditions.m in Sources */,
A9EA43681A2210C400785E95 /* HBQueueOutlineView.m in Sources */,
+ A9C183961A716B8F00C897C2 /* HBTitleSelectionController.m in Sources */,
A91726E7197291BC00D1AFEF /* HBChapterTitlesController.m in Sources */,
A9C9F88919A733FE00DC8923 /* HBHUDView.m in Sources */,
A932E26F198833920047D13E /* HBAudioDefaultsController.m in Sources */,
@@ -1403,6 +1413,14 @@
name = SubtitlesDefaults.xib;
sourceTree = "<group>";
};
+ A9C1839B1A716BCC00C897C2 /* HBTitleSelection.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ A9C1839C1A716BCC00C897C2 /* English */,
+ );
+ name = HBTitleSelection.xib;
+ sourceTree = "<group>";
+ };
A9CF25EF1990D62C0023F727 /* Presets.xib */ = {
isa = PBXVariantGroup;
children = (