]> granicus.if.org Git - handbrake/commitdiff
WinGui: Queue Recovery now sets the GUI to enabled if it recovers a job.
authorsr55 <sr55.hb@outlook.com>
Wed, 3 Jun 2015 17:21:56 +0000 (17:21 +0000)
committersr55 <sr55.hb@outlook.com>
Wed, 3 Jun 2015 17:21:56 +0000 (17:21 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7270 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs

index 57033ae9d5fa9c7617c4ff5b426f5b63590e68ad..c73ad26055405283a0803805ca1e4f53099860c9 100644 (file)
@@ -104,7 +104,7 @@ namespace HandBrakeWPF.Helpers
         /// <param name="errorService">\r
         /// The error Service.\r
         /// </param>\r
-        public static void RecoverQueue(IQueueProcessor encodeQueue, IErrorService errorService)\r
+        public static bool RecoverQueue(IQueueProcessor encodeQueue, IErrorService errorService)\r
         {\r
             string appDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\");\r
             List<string> queueFiles = CheckQueueRecovery();\r
@@ -124,6 +124,7 @@ namespace HandBrakeWPF.Helpers
 \r
             if (result == MessageBoxResult.Yes)\r
             {\r
+                bool isRecovered = false;\r
                 foreach (string file in queueFiles)\r
                 {\r
                     // Skip over the file if it belongs to another HandBrake instance.\r
@@ -138,7 +139,8 @@ namespace HandBrakeWPF.Helpers
                     }\r
 \r
                     // Recover the Queue\r
-                    encodeQueue.RestoreQueue(appDataPath + file); \r
+                    encodeQueue.RestoreQueue(appDataPath + file);\r
+                    isRecovered = true;\r
 \r
                     // Cleanup\r
                     if (!file.Contains(GeneralUtilities.ProcessId.ToString(CultureInfo.InvariantCulture)))\r
@@ -155,6 +157,8 @@ namespace HandBrakeWPF.Helpers
                         }\r
                     }\r
                 }\r
+\r
+                return isRecovered;\r
             }\r
             else\r
             {\r
@@ -177,6 +181,8 @@ namespace HandBrakeWPF.Helpers
                         File.Delete(Path.Combine(appDataPath, file));\r
                     }\r
                 }\r
+\r
+                return false;\r
             }\r
         }\r
     }\r
index 854bf48d950511c47da85e4074ae5b1f72fcb11a..2293df64a54bc6f4ca0e99f8ca8d0cb47aeca54f 100644 (file)
@@ -1194,7 +1194,11 @@ namespace HandBrakeWPF.ViewModels
             this.presetService.Load();\r
 \r
             // Queue Recovery\r
-            QueueRecoveryHelper.RecoverQueue(this.queueProcessor, this.errorService);\r
+            bool isRecovered = QueueRecoveryHelper.RecoverQueue(this.queueProcessor, this.errorService);\r
+            if (isRecovered)\r
+            {\r
+                this.HasSource = true;\r
+            }\r
 \r
             this.SelectedPreset = this.presetService.DefaultPreset;\r
 \r