summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-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;