diff options
author | titer <[email protected]> | 2006-04-17 20:15:56 +0000 |
---|---|---|
committer | titer <[email protected]> | 2006-04-17 20:15:56 +0000 |
commit | 72738ac78c91e391c1e03714f7142d325116d5a6 (patch) | |
tree | 97ca67433b78b0acbd1bebae1ab63e1488d9de13 /macosx/ExpressController.m | |
parent | c1dbdecc75629ddebad41f236445a89b6cc9cd9a (diff) |
Implemented cancel
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@63 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/ExpressController.m')
-rw-r--r-- | macosx/ExpressController.m | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/macosx/ExpressController.m b/macosx/ExpressController.m index f496accdc..285b5a8f6 100644 --- a/macosx/ExpressController.m +++ b/macosx/ExpressController.m @@ -12,6 +12,7 @@ - (void) openTimer: (NSTimer *) timer; - (void) convertShow; +- (void) convertEnable: (BOOL) b; - (void) convertTimer: (NSTimer *) timer; @end @@ -292,6 +293,14 @@ NSTimer * timer = [NSTimer scheduledTimerWithTimeInterval: 0.5 target: self selector: @selector( convertTimer: ) userInfo: nil repeats: YES]; + + [self convertEnable: NO]; +} + +- (void) convertCancel: (id) sender +{ + hb_stop( fHandle ); + [fConvertGoButton setEnabled: NO]; } @end @@ -454,6 +463,29 @@ [image16 unlockFocus]; [item setImage: image16]; [image16 release]; + + [self convertEnable: YES]; +} + +- (void) convertEnable: (BOOL) b +{ + [fConvertTableView setEnabled: b]; + [fConvertFolderPopUp setEnabled: b]; + [fConvertFormatPopUp setEnabled: b]; + [fConvertAspectPopUp setEnabled: b]; + [fConvertAudioPopUp setEnabled: b]; + [fConvertSubtitlePopUp setEnabled: b]; + [fConvertOpenButton setEnabled: b]; + if( b ) + { + [fConvertGoButton setTitle: @"Convert"]; + [fConvertGoButton setAction: @selector(convertGo:)]; + } + else + { + [fConvertGoButton setTitle: @"Cancel"]; + [fConvertGoButton setAction: @selector(convertCancel:)]; + } } - (void) convertTimer: (NSTimer *) timer @@ -502,6 +534,13 @@ [fConvertInfoString setStringValue: @"Done."]; [fConvertIndicator setIndeterminate: NO]; [fConvertIndicator setDoubleValue: 0.0]; + [self convertEnable: YES]; + + hb_job_t * job; + while( ( job = hb_job( fHandle, 0 ) ) ) + { + hb_rem( fHandle, job ); + } break; default: |