Changeset 2203 for trunk/eraser


Ignore:
Timestamp:
6/19/2010 2:48:37 AM (5 years ago)
Author:
lowjoel
Message:

Allow tasks to report that their progress is indeterminate, and reflect this in the UI appropriately.

Location:
trunk/eraser/Eraser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser/ProgressForm.cs

    r2190 r2203  
    165165                timeLeft.Text = S._("Unknown"); 
    166166 
    167             if (targetProgress.Progress >= 0.0f) 
     167            if (!targetProgress.ProgressIndeterminate) 
    168168            { 
    169169                itemProgress.Style = ProgressBarStyle.Continuous; 
     
    178178            } 
    179179 
    180             overallProgress.Value = (int)(task.Progress.Progress * 1000); 
    181             overallProgressLbl.Text = S._("Total: {0,2:#0.00%}", task.Progress.Progress); 
     180            if (!task.Progress.ProgressIndeterminate) 
     181            { 
     182                overallProgress.Style = ProgressBarStyle.Continuous; 
     183                overallProgress.Value = (int)(task.Progress.Progress * 1000); 
     184                overallProgressLbl.Text = S._("Total: {0,2:#0.00%}", task.Progress.Progress); 
     185            } 
     186            else 
     187            { 
     188                overallProgress.Style = ProgressBarStyle.Marquee; 
     189                overallProgressLbl.Text = S._("Total: Unknown"); 
     190            } 
    182191        } 
    183192 
  • trunk/eraser/Eraser/SchedulerPanel.cs

    r2141 r2203  
    231231            //Update the progress bar 
    232232            ErasureTarget target = (ErasureTarget)sender; 
    233             schedulerProgress.Value = (int)(target.Task.Progress.Progress * 1000.0); 
     233            SteppedProgressManager progress = target.Task.Progress; 
     234            schedulerProgress.Style = progress.ProgressIndeterminate ? 
     235                ProgressBarStyle.Marquee : ProgressBarStyle.Continuous; 
     236             
     237            if (!progress.ProgressIndeterminate) 
     238                schedulerProgress.Value = (int)(progress.Progress * 1000.0); 
    234239        } 
    235240 
Note: See TracChangeset for help on using the changeset viewer.