From b652292b6ae12e95f6ef24804a4cf8b51f32c47a Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 29 Apr 2017 20:08:07 +0100 Subject: WinGui: Minor change that might help #688 --- win/CS/HandBrakeWPF/Services/Scan/LibScan.cs | 4 ++-- win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'win/CS') diff --git a/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs b/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs index fdeb88b2d..eac84f263 100644 --- a/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs +++ b/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs @@ -144,8 +144,7 @@ namespace HandBrakeWPF.Services.Scan { this.ServiceLogMessage("Stopping Scan ..."); this.IsScanning = false; - this.instance.StopScan(); - this.ServiceLogMessage("Scan Stopped ..."); + this.instance.StopScan(); } catch (Exception exc) { @@ -154,6 +153,7 @@ namespace HandBrakeWPF.Services.Scan finally { this.ScanCompleted?.Invoke(this, new ScanCompletedEventArgs(this.isCancelled, null, null, null)); + this.ServiceLogMessage("Scan Stopped ..."); } } diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index c11400bd7..c8a59bbbc 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -2336,6 +2336,8 @@ namespace HandBrakeWPF.ViewModels /// private void ScanCompleted(object sender, ScanCompletedEventArgs e) { + this.ShowStatusWindow = false; + if (e.ScannedSource != null && !e.Cancelled) { if (this.ScannedSource == null) @@ -2351,9 +2353,7 @@ namespace HandBrakeWPF.ViewModels Execute.OnUIThread(() => { - this.ShowStatusWindow = false; - - if (e.Successful) + if (e.Successful && this.ScannedSource != null) { this.NotifyOfPropertyChange(() => this.ScannedSource); this.NotifyOfPropertyChange(() => this.ScannedSource.Titles); -- cgit v1.2.3