]> granicus.if.org Git - handbrake/commitdiff
WinGui: Minor change that might help #688
authorsr55 <sr55.hb@outlook.com>
Sat, 29 Apr 2017 19:08:07 +0000 (20:08 +0100)
committersr55 <sr55.hb@outlook.com>
Sat, 29 Apr 2017 19:08:07 +0000 (20:08 +0100)
win/CS/HandBrakeWPF/Services/Scan/LibScan.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs

index fdeb88b2d9401902545d5cb93bb9f0ee811185ea..eac84f263172e3c1e3ec203a7dc3e5590ac674c6 100644 (file)
@@ -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 ...");
             }
         }
 
index c11400bd7541fc089fb5dcd0b15f2f87b2a6ae3d..c8a59bbbc41715f4d0ed7e87f9bba564fe47db1a 100644 (file)
@@ -2336,6 +2336,8 @@ namespace HandBrakeWPF.ViewModels
         /// </param>\r
         private void ScanCompleted(object sender, ScanCompletedEventArgs e)\r
         {\r
+            this.ShowStatusWindow = false;\r
+\r
             if (e.ScannedSource != null && !e.Cancelled)\r
             {\r
                 if (this.ScannedSource == null)\r
@@ -2351,9 +2353,7 @@ namespace HandBrakeWPF.ViewModels
 \r
             Execute.OnUIThread(() =>\r
             {\r
-                this.ShowStatusWindow = false;\r
-\r
-                if (e.Successful)\r
+                if (e.Successful && this.ScannedSource != null)\r
                 {\r
                     this.NotifyOfPropertyChange(() => this.ScannedSource);\r
                     this.NotifyOfPropertyChange(() => this.ScannedSource.Titles);\r