From dcdbfd6a12b7ad09ffd869d81a2ca181c0d48eda Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 3 Jun 2015 17:21:56 +0000 Subject: WinGui: Queue Recovery now sets the GUI to enabled if it recovers a job. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7270 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs') diff --git a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs index 57033ae9d..c73ad2605 100644 --- a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs @@ -104,7 +104,7 @@ namespace HandBrakeWPF.Helpers /// /// The error Service. /// - public static void RecoverQueue(IQueueProcessor encodeQueue, IErrorService errorService) + public static bool RecoverQueue(IQueueProcessor encodeQueue, IErrorService errorService) { string appDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\"); List queueFiles = CheckQueueRecovery(); @@ -124,6 +124,7 @@ namespace HandBrakeWPF.Helpers if (result == MessageBoxResult.Yes) { + bool isRecovered = false; foreach (string file in queueFiles) { // Skip over the file if it belongs to another HandBrake instance. @@ -138,7 +139,8 @@ namespace HandBrakeWPF.Helpers } // Recover the Queue - encodeQueue.RestoreQueue(appDataPath + file); + encodeQueue.RestoreQueue(appDataPath + file); + isRecovered = true; // Cleanup if (!file.Contains(GeneralUtilities.ProcessId.ToString(CultureInfo.InvariantCulture))) @@ -155,6 +157,8 @@ namespace HandBrakeWPF.Helpers } } } + + return isRecovered; } else { @@ -177,6 +181,8 @@ namespace HandBrakeWPF.Helpers File.Delete(Path.Combine(appDataPath, file)); } } + + return false; } } } -- cgit v1.2.3