From 2aa8401380b0efd6b5fe488059d31ca822a483b7 Mon Sep 17 00:00:00 2001 From: dynaflash Date: Wed, 25 Apr 2007 18:28:41 +0000 Subject: MacGui: Queue modifications - Queue is now integral to encoding - removed "Enable Queue" Checkbox - made "Add to Queue" and "Show queue" always usable - Rip method in controller.mm always calls addToQueue even for one rip, but then automatically rips it. - Added queue status field. - fixes bug in 0.8.5 where having queue enabled and clicking rip with nothing in the queue causes HB to do nothing. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@550 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.h | 4 +- macosx/Controller.mm | 45 ++++++++------------- macosx/English.lproj/MainMenu.nib/classes.nib | 4 +- macosx/English.lproj/MainMenu.nib/info.nib | 6 ++- macosx/English.lproj/MainMenu.nib/keyedobjects.nib | Bin 102083 -> 101934 bytes 5 files changed, 26 insertions(+), 33 deletions(-) (limited to 'macosx') diff --git a/macosx/Controller.h b/macosx/Controller.h index ce9750947..7ae2c8d5b 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -29,7 +29,7 @@ /* Queue panel */ IBOutlet QueueController * fQueueController; IBOutlet NSPanel * fQueuePanel; - IBOutlet NSButton * fQueueCheck; + IBOutlet NSTextField * fQueueStatus; IBOutlet NSButton * fQueueAddButton; IBOutlet NSButton * fQueueShowButton; @@ -191,7 +191,7 @@ - (IBAction) ShowPicturePanel: (id) sender; - (IBAction) CalculatePictureSizing: (id) sender; -- (IBAction) EnableQueue: (id) sender; + - (IBAction) AddToQueue: (id) sender; - (IBAction) ShowQueuePanel: (id) sender; diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 9290cb67a..a9aa9bc73 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -546,21 +546,20 @@ static int FormatSettings[3][4] = } } - /* FIXME: we should only do that when necessary */ - if( [fQueueCheck state] == NSOnState ) - { + /* Lets show the queue status + here in the main window*/ + int count = hb_count( fHandle ); if( count ) { - [fQueueCheck setTitle: [NSString stringWithFormat: - @"Enable queue (%d task%s in queue)", + [fQueueStatus setStringValue: [NSString stringWithFormat: + @"%d task%s in the queue", count, ( count > 1 ) ? "s" : ""]]; } else { - [fQueueCheck setTitle: @"Enable queue (no task in queue)"]; + [fQueueStatus setStringValue: @""]; } - } [[NSRunLoop currentRunLoop] addTimer: [NSTimer scheduledTimerWithTimeInterval: 0.2 target: self @@ -582,7 +581,7 @@ static int FormatSettings[3][4] = fAudLang1Field, fAudLang1PopUp, fAudLang2Field, fAudLang2PopUp, fAudTrack1MixLabel, fAudTrack1MixPopUp, fAudTrack2MixLabel, fAudTrack2MixPopUp, fAudRateField, fAudRatePopUp, fAudBitrateField, - fAudBitratePopUp, fPictureButton, fQueueCheck, + fAudBitratePopUp, fPictureButton,fQueueStatus, fPicSrcWidth,fPicSrcHeight,fPicSettingWidth,fPicSettingHeight, fPicSettingARkeep,fPicSettingDeinterlace,fPicSettingARkeepDsply, fPicSettingDeinterlaceDsply,fPicLabelSettings,fPicLabelSrc,fPicLabelOutp, @@ -877,13 +876,7 @@ static int FormatSettings[3][4] = } -- (IBAction) EnableQueue: (id) sender -{ - bool e = ( [fQueueCheck state] == NSOnState ); - [fQueueAddButton setHidden: !e]; - [fQueueShowButton setHidden: !e]; - [fRipButton setTitle: e ? @"Start" : @"Start"]; -} + - (IBAction) AddToQueue: (id) sender { @@ -942,25 +935,21 @@ static int FormatSettings[3][4] = - (IBAction) Rip: (id) sender { - - /* Rip or Cancel ? */ if( [[fRipButton title] isEqualToString: _( @"Cancel" )] ) { [self Cancel: sender]; return; } - - if( [fQueueCheck state] == NSOffState ) - { - - [self AddToQueue: sender]; - - - - } - - /* We check for duplicate name here */ + /* if there is no job in the queue, then add it to the queue and rip + otherwise, there are already jobs in queue, so just rip the queue */ + int count = hb_count( fHandle ); + if( count < 1 ) + { + [self AddToQueue: sender]; + } + + /* We check for duplicate name here */ if( [[NSFileManager defaultManager] fileExistsAtPath: [fDstFile2Field stringValue]] ) { diff --git a/macosx/English.lproj/MainMenu.nib/classes.nib b/macosx/English.lproj/MainMenu.nib/classes.nib index f10f110dc..0ab36a683 100644 --- a/macosx/English.lproj/MainMenu.nib/classes.nib +++ b/macosx/English.lproj/MainMenu.nib/classes.nib @@ -39,7 +39,7 @@ LANGUAGE = ObjC; OUTLETS = { fAddPresetPanel = NSPanel; - fAddToQuButton = NSTableView; + fAddToQuButton = NSButton; fAudBitrateField = NSTextField; fAudBitratePopUp = NSPopUpButton; fAudLang1Field = NSTextField; @@ -98,10 +98,10 @@ fPresetsAdd = NSButton; fPresetsDelete = NSButton; fQueueAddButton = NSButton; - fQueueCheck = NSButton; fQueueController = QueueController; fQueuePanel = NSPanel; fQueueShowButton = NSButton; + fQueueStatus = NSTextField; fRipButton = NSButton; fRipIndicator = NSProgressIndicator; fScanController = ScanController; diff --git a/macosx/English.lproj/MainMenu.nib/info.nib b/macosx/English.lproj/MainMenu.nib/info.nib index b845f1d90..7ee52d21e 100644 --- a/macosx/English.lproj/MainMenu.nib/info.nib +++ b/macosx/English.lproj/MainMenu.nib/info.nib @@ -3,7 +3,7 @@ IBDocumentLocation - 1484 151 630 601 1440 0 1280 1024 + 6 277 630 601 0 0 1440 878 IBEditorPositions 1843 @@ -17,6 +17,10 @@ 1477 + IBOpenObjects + + 21 + IBSystem Version 8P2137 IBUserGuides diff --git a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib index 560c26596..145999c6e 100644 Binary files a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib and b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib differ -- cgit v1.2.3