summaryrefslogtreecommitdiffstats
path: root/macosx/Controller.m
diff options
context:
space:
mode:
authordynaflash <[email protected]>2011-09-02 22:35:04 +0000
committerdynaflash <[email protected]>2011-09-02 22:35:04 +0000
commitbda88d1a98a98a5ddac7087ea8b37889dd14bc7b (patch)
tree54eadd163ceb26f831cae0e8da6718a1ea299fbb /macosx/Controller.m
parent1423d3020bc950b81c2993387958e78103bdaaad (diff)
MacGui: Behold that which is hidden ... Batch Queueing Support.
- Add batch queueing support to the macgui. - Currently accessed under File > Add All Titles To Queue - No toolbar button yet since it needs to soak for a while and needs refinement. - Applies all current settings to all titles. - Best used with batch scanning flat files. - Works with a dvd scan where the dvd titles are in the title structure ... but not recommended. - Use at your own peril! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4201 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/Controller.m')
-rw-r--r--macosx/Controller.m41
1 files changed, 40 insertions, 1 deletions
diff --git a/macosx/Controller.m b/macosx/Controller.m
index 8821e758f..865cc7f60 100644
--- a/macosx/Controller.m
+++ b/macosx/Controller.m
@@ -1329,7 +1329,7 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It
if (fHandle)
{
- if (action == @selector(addToQueue:) || action == @selector(showPicturePanel:) || action == @selector(showAddPresetPanel:))
+ if (action == @selector(addToQueue:) || action == @selector(addAllTitlesToQueue:) || action == @selector(showPicturePanel:) || action == @selector(showAddPresetPanel:))
return SuccessfulScan && [fWindow attachedSheet] == nil;
if (action == @selector(browseSources:))
@@ -4197,6 +4197,45 @@ bool one_burned = FALSE;
}
#pragma mark -
+#pragma mark Batch Queue Titles Methods
+- (IBAction) addAllTitlesToQueue: (id) sender
+{
+ NSBeginCriticalAlertSheet( NSLocalizedString( @"You are about to add ALL titles to the queue!", @"" ),
+ NSLocalizedString( @"Cancel", @"" ), NSLocalizedString( @"Yes, I want to add all titles to the queue.", @"" ), nil, fWindow, self,
+ @selector( addAllTitlesToQueueAlertDone:returnCode:contextInfo: ),
+ NULL, NULL, [NSString stringWithFormat:
+ NSLocalizedString( @"Current settings will be applied to all %d titles. Are you sure you want to do this?", @"" ),[fSrcTitlePopUp numberOfItems]] );
+}
+
+- (void) addAllTitlesToQueueAlertDone: (NSWindow *) sheet
+ returnCode: (int) returnCode contextInfo: (void *) contextInfo
+{
+ if( returnCode == NSAlertAlternateReturn )
+ [self doAddAllTitlesToQueue];
+}
+
+- (void) doAddAllTitlesToQueue
+{
+
+ /* first get the currently selected index so we can choose it again after cycling through the available titles. */
+ int currentlySelectedTitle = [fSrcTitlePopUp indexOfSelectedItem];
+
+ /* For each title in the fSrcTitlePopUp select it ... */
+ for( int i = 0; i < [fSrcTitlePopUp numberOfItems]; i++ )
+ {
+ [fSrcTitlePopUp selectItemAtIndex:i];
+ /* Now call titlePopUpChanged to load it up ... */
+ [self titlePopUpChanged:nil];
+ /* now add the title to the queue */
+ [self addToQueue:nil];
+ }
+ /* Now that we are done, reselect the previously selected title.*/
+ [fSrcTitlePopUp selectItemAtIndex: currentlySelectedTitle];
+ /* Now call titlePopUpChanged to load it up ... */
+ [self titlePopUpChanged:nil];
+}
+
+#pragma mark -
#pragma mark GUI Controls Changed Methods
- (IBAction) titlePopUpChanged: (id) sender