Skip to content

Commit

Permalink
Add Error count to the Status bar when queue completes.
Browse files Browse the repository at this point in the history
  • Loading branch information
sr55 committed Nov 8, 2015
1 parent 96b99ea commit ca28edf
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
9 changes: 9 additions & 0 deletions win/CS/HandBrakeWPF/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions win/CS/HandBrakeWPF/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -730,4 +730,7 @@ If it fails, it will archive off the old file and create a new one.</value>

Your old presets file was archived to:</value>
</data>
<data name="Main_QueueFinishedErrors" xml:space="preserve">
<value> with {0} errors detected.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ public interface IQueueProcessor
/// </summary>
int Count { get; }

/// <summary>
/// The number of errors detected in the queue.
/// </summary>
int ErrorCount { get; }

/// <summary>
/// Gets the IEncodeService instance.
/// </summary>
Expand Down
11 changes: 11 additions & 0 deletions win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ public int Count
}
}

/// <summary>
/// The number of errors detected.
/// </summary>
public int ErrorCount
{
get
{
return this.queue.Count(item => item.Status == QueueItemStatus.Error);
}
}

/// <summary>
/// Gets the IEncodeService instance.
/// </summary>
Expand Down
8 changes: 7 additions & 1 deletion win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2247,7 +2247,13 @@ private void QueueCompleted(object sender, EventArgs e)
Execute.OnUIThread(
() =>
{
this.ProgramStatusLabel = Resources.Main_QueueFinished;
string errorDesc = string.Empty;
if (this.queueProcessor.ErrorCount > 0)
{
errorDesc += string.Format(Resources.Main_QueueFinishedErrors, this.queueProcessor.ErrorCount);
}

this.ProgramStatusLabel = Resources.Main_QueueFinished + errorDesc;
this.IsEncoding = false;

if (this.windowsSeven.IsWindowsSeven)
Expand Down

0 comments on commit ca28edf

Please sign in to comment.