]> granicus.if.org Git - handbrake/commitdiff
WinGui: Don't grab previews when the preview window hasn't been opened. (Note, there...
authorsr55 <sr55.hb@outlook.com>
Sat, 24 May 2014 17:25:48 +0000 (17:25 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 24 May 2014 17:25:48 +0000 (17:25 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6205 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs
win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs

index a1d6b465c52fc734920c6db53fb69ab4e849778f..6d42d4d5580c5decb8a5ac63e627ce1ea39ca872 100644 (file)
@@ -23,5 +23,10 @@ namespace HandBrakeWPF.ViewModels.Interfaces
         /// The task.\r
         /// </param>\r
         void UpdatePreviewFrame(EncodeTask task);\r
+\r
+        /// <summary>\r
+        /// Gets or sets a value indicating whether is open.\r
+        /// </summary>\r
+        bool IsOpen { get; set; }\r
     }\r
 }\r
index b10c0f292b17d71494e3f1c4408e1a38641c6d0c..51c018ad9cd2396d02104e467dd4967ac16113b6 100644 (file)
@@ -12,6 +12,7 @@ namespace HandBrakeWPF.ViewModels
     using System;\r
     using System.Collections.Generic;\r
     using System.Globalization;\r
+    using System.Windows;\r
     using System.Windows.Media.Imaging;\r
 \r
     using Caliburn.Micro;\r
@@ -825,6 +826,7 @@ namespace HandBrakeWPF.ViewModels
         {\r
             if (!string.IsNullOrEmpty(this.Task.Source))\r
             {\r
+                this.StaticPreviewViewModel.IsOpen = true;\r
                 this.StaticPreviewViewModel.UpdatePreviewFrame(this.Task);\r
                 this.WindowManager.ShowWindow(this.StaticPreviewViewModel);\r
             }\r
@@ -1197,7 +1199,7 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         private void UpdatePreviewImage()\r
         {\r
-            if (delayedPreviewprocessor != null && this.Task != null)\r
+            if (delayedPreviewprocessor != null && this.Task != null && this.StaticPreviewViewModel != null && this.StaticPreviewViewModel.IsOpen)\r
             {\r
                 delayedPreviewprocessor.PerformTask(() => this.StaticPreviewViewModel.UpdatePreviewFrame(this.Task), 800);\r
             }\r
index 279cc6fc8b07c4f7badc1c2ea706979a1ff83c61..622319f61b3dc259a26885b483bfcae067da44bc 100644 (file)
@@ -194,6 +194,11 @@ namespace HandBrakeWPF.ViewModels
             this.Title = Properties.Resources.Preview;\r
         }\r
 \r
+        /// <summary>\r
+        /// Gets or sets a value indicating whether is open.\r
+        /// </summary>\r
+        public bool IsOpen { get; set; }\r
+\r
         /// <summary>\r
         ///     The update preview frame.\r
         /// </summary>\r