From 4228b01470a3f5d8798bce4aaad28d8481497911 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 30 Sep 2012 14:35:20 +0000 Subject: WinGui: Improvements to status messages. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4999 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Services/ScanService.cs | 13 +++++++++-- win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 25 ++++++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) (limited to 'win/CS') diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs index e2ce19ff0..020aaf0ad 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs @@ -56,6 +56,11 @@ namespace HandBrake.ApplicationServices.Services /// private Process hbProc; + /// + /// The stop scan. + /// + private bool cancelScan; + #endregion /// @@ -156,6 +161,8 @@ namespace HandBrake.ApplicationServices.Services this.readData.OnScanProgress -= this.OnScanProgress; } + cancelScan = true; + if (this.hbProc != null && !this.hbProc.HasExited) { this.hbProc.Kill(); @@ -225,6 +232,8 @@ namespace HandBrake.ApplicationServices.Services try { this.IsScanning = true; + this.cancelScan = false; + if (this.ScanStared != null) { this.ScanStared(this, new EventArgs()); @@ -311,7 +320,7 @@ namespace HandBrake.ApplicationServices.Services else { throw new Exception( - "The Log file has not been written to disk as it has grown above the 100MB limit. This indicates there was a problem during the scan process."); + "The Log file has not been written to disk as it has grown above the 50MB limit. This indicates there was a problem during the scan process."); } } @@ -326,7 +335,7 @@ namespace HandBrake.ApplicationServices.Services { if (this.ScanCompleted != null) { - this.ScanCompleted(this, new ScanCompletedEventArgs(true, null, string.Empty)); + this.ScanCompleted(this, new ScanCompletedEventArgs(!this.cancelScan, null, string.Empty)); } } } diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index b68237883..081272a4d 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1627,8 +1627,29 @@ namespace HandBrakeWPF.ViewModels } this.ShowStatusWindow = false; - this.SourceLabel = "Scan Completed"; - this.StatusLabel = "Scan Completed"; + if (e.Successful) + { + if (this.SelectedTitle != null && !string.IsNullOrEmpty(this.SelectedTitle.SourceName)) + { + this.SourceLabel = this.SelectedTitle.SourceName; + } + else + { + this.SourceLabel = this.SourceName; + } + + this.StatusLabel = "Scan Completed"; + } + else if (!e.Successful && e.Exception == null) + { + this.SourceLabel = "Scan Cancelled."; + this.StatusLabel = "Scan Cancelled."; + } + else + { + this.SourceLabel = "Scan Failed... See Activity Log for details."; + this.StatusLabel = "Scan Failed... See Activity Log for details."; + } }); } -- cgit v1.2.3