diff options
author | dynaflash <[email protected]> | 2007-04-25 18:28:41 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2007-04-25 18:28:41 +0000 |
commit | 2aa8401380b0efd6b5fe488059d31ca822a483b7 (patch) | |
tree | efcd00df36d773b70ba4a3d24d09108df99f6274 /macosx/Controller.mm | |
parent | ea0847e6cfa041c9a5553bd266b9101cb615844a (diff) |
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
Diffstat (limited to 'macosx/Controller.mm')
-rw-r--r-- | macosx/Controller.mm | 45 |
1 files changed, 17 insertions, 28 deletions
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]] ) { |