From ca28edf93c380f3133444d5861a771206007fbd5 Mon Sep 17 00:00:00 2001 From: Scott Date: Sun, 8 Nov 2015 17:41:49 +0000 Subject: Add Error count to the Status bar when queue completes. --- win/CS/HandBrakeWPF/Properties/Resources.Designer.cs | 9 +++++++++ win/CS/HandBrakeWPF/Properties/Resources.resx | 3 +++ .../HandBrakeWPF/Services/Queue/Interfaces/IQueueProcessor.cs | 5 +++++ win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs | 11 +++++++++++ win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 8 +++++++- 5 files changed, 35 insertions(+), 1 deletion(-) (limited to 'win') diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index 30084463c..52b7258f9 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -729,6 +729,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to with {0} errors detected.. + /// + public static string Main_QueueFinishedErrors { + get { + return ResourceManager.GetString("Main_QueueFinishedErrors", resourceCulture); + } + } + /// /// Looks up a localized string similar to Show Queue{0}. /// diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 7ce2bf391..ba36e3013 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -730,4 +730,7 @@ If it fails, it will archive off the old file and create a new one. Your old presets file was archived to: + + with {0} errors detected. + \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Services/Queue/Interfaces/IQueueProcessor.cs b/win/CS/HandBrakeWPF/Services/Queue/Interfaces/IQueueProcessor.cs index 7a27f685f..d0bef608f 100644 --- a/win/CS/HandBrakeWPF/Services/Queue/Interfaces/IQueueProcessor.cs +++ b/win/CS/HandBrakeWPF/Services/Queue/Interfaces/IQueueProcessor.cs @@ -53,6 +53,11 @@ namespace HandBrakeWPF.Services.Queue.Interfaces /// int Count { get; } + /// + /// The number of errors detected in the queue. + /// + int ErrorCount { get; } + /// /// Gets the IEncodeService instance. /// diff --git a/win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs b/win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs index 94d9775d4..31fd7acee 100644 --- a/win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs +++ b/win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs @@ -140,6 +140,17 @@ namespace HandBrakeWPF.Services.Queue } } + /// + /// The number of errors detected. + /// + public int ErrorCount + { + get + { + return this.queue.Count(item => item.Status == QueueItemStatus.Error); + } + } + /// /// Gets the IEncodeService instance. /// diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 69d38f159..bc6caa38a 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -2247,7 +2247,13 @@ namespace HandBrakeWPF.ViewModels 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) -- cgit v1.2.3