diff options
author | ritsuka <[email protected]> | 2009-03-02 07:41:45 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2009-03-02 07:41:45 +0000 |
commit | ef033a746b1c09f7df53e6998d5a2a99c09ee73d (patch) | |
tree | c2a20b117dc787373c4cca640ba84ed725fe9d4f /macosx | |
parent | 8cfa7b9504c66677bff67d9097541f62ea7e3a40 (diff) |
MacGui:
- Limited the handbrake dock icon refresh to a maximum of 20 for encode. It was a bit pointless to update it two times a second.
- Another try at fixing the main window progress indicator.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2196 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Controller.h | 2 | ||||
-rw-r--r-- | macosx/Controller.mm | 19 |
2 files changed, 15 insertions, 6 deletions
diff --git a/macosx/Controller.h b/macosx/Controller.h index 73cb8eccc..d0d281a0c 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -252,6 +252,8 @@ BOOL fIsDragging; BOOL applyQueueToScan; NSString * currentSource; NSString * browsedSourceDisplayName; + + double dockIconProgress; } - (void) writeToActivityLog:(char *) format, ...; diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 3d078cf5e..990f6b89e 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -106,6 +106,8 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It [fPresetsOutlineView setAutosaveName:@"Presets View"]; [fPresetsOutlineView setAutosaveExpandedItems:YES]; + + dockIconProgress = 0; /* Call UpdateUI every 1/2 sec */ [[NSRunLoop currentRunLoop] addTimer:[NSTimer @@ -711,10 +713,9 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It /* Set the status string in fQueueController as well */ [fQueueController setQueueStatusString: string]; /* Update slider */ - double progress_total; - progress_total = ( p.progress + p.job_cur - 1 ) / p.job_count; + double progress_total = ( p.progress + p.job_cur - 1 ) / p.job_count; [fRipIndicator setIndeterminate: NO]; - [fRipIndicator setDoubleValue: 100.0 * progress_total]; + [fRipIndicator setDoubleValue: (double) 100.0 * progress_total]; //[fRipIndicator setDoubleValue: 100.0 * p.progress]; // If progress bar hasn't been revealed at the bottom of the window, do @@ -732,10 +733,14 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It fRipIndicatorShown = YES; } - + /* Update dock icon */ - [self UpdateDockIcon: progress_total]; - + if( dockIconProgress < 100.0 * progress_total ) + { + [self UpdateDockIcon: progress_total]; + dockIconProgress += 5; + } + break; } #undef p @@ -775,11 +780,13 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It /* Set the status string in fQueueController as well */ [fQueueController setQueueStatusString: NSLocalizedString( @"Encode Finished.", @"" )]; [fRipIndicator setIndeterminate: NO]; + [fRipIndicator stopAnimation: nil]; [fRipIndicator setDoubleValue: 0.0]; [[fWindow toolbar] validateVisibleItems]; /* Restore dock icon */ [self UpdateDockIcon: -1.0]; + dockIconProgress = 0; if( fRipIndicatorShown ) { |