summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-06-03 17:21:56 +0000
committersr55 <[email protected]>2015-06-03 17:21:56 +0000
commitdcdbfd6a12b7ad09ffd869d81a2ca181c0d48eda (patch)
tree3913a561cd3f2ae615fc8249a244e7098abccd03 /win/CS
parentb9533021140307974a5bd07d89aefa202ea47ad8 (diff)
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
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs10
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs6
2 files changed, 13 insertions, 3 deletions
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
/// <param name="errorService">
/// The error Service.
/// </param>
- 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<string> 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;
}
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 854bf48d9..2293df64a 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1194,7 +1194,11 @@ namespace HandBrakeWPF.ViewModels
this.presetService.Load();
// Queue Recovery
- QueueRecoveryHelper.RecoverQueue(this.queueProcessor, this.errorService);
+ bool isRecovered = QueueRecoveryHelper.RecoverQueue(this.queueProcessor, this.errorService);
+ if (isRecovered)
+ {
+ this.HasSource = true;
+ }
this.SelectedPreset = this.presetService.DefaultPreset;