]> granicus.if.org Git - handbrake/commitdiff
WinGui: Don't allow multiple preview windows to be opened.
authorsr55 <sr55.hb@outlook.com>
Fri, 14 Dec 2018 20:57:01 +0000 (20:57 +0000)
committersr55 <sr55.hb@outlook.com>
Fri, 14 Dec 2018 20:57:01 +0000 (20:57 +0000)
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml

index 9c0788bf6ff96573087a3046b8df339d54e6b823..a64e0cb39378797c628a846b27909c248edad8db 100644 (file)
@@ -1457,7 +1457,7 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         public void OpenPreviewWindow()\r
         {\r
-            if (!string.IsNullOrEmpty(this.CurrentTask.Source))\r
+            if (!string.IsNullOrEmpty(this.CurrentTask.Source) && !this.StaticPreviewViewModel.IsOpen)\r
             {\r
                 this.StaticPreviewViewModel.IsOpen = true;\r
                 this.StaticPreviewViewModel.UpdatePreviewFrame(this.CurrentTask, this.ScannedSource);\r
index 7989cd85a96d7ef8ceab4338f744a52c147ccd15..d8ad6e9b9f711bebd18657e0649340869bf13163 100644 (file)
@@ -525,7 +525,7 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         public void Close()\r
         {\r
-            this.TryClose();\r
+            this.IsOpen = false;\r
         }\r
 \r
         /// <summary>\r
index 48323b2595f2f4db7d45844ca9d7697ce740ecf4..6f1b546940208a422ade1689e926fcf8e3bf3508 100644 (file)
@@ -9,6 +9,7 @@
              mc:Ignorable="d" SizeToContent="WidthAndHeight"\r
              TextOptions.TextFormattingMode="Display"\r
              WindowStartupLocation="CenterScreen"\r
+             cal:Message.Attach="[Event Closing] = [Action Close]"\r
              Title="{Binding Title}">\r
 \r
     <Window.Resources>\r