summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-07-17 21:48:41 +0000
committersr55 <[email protected]>2010-07-17 21:48:41 +0000
commit4cacc7fd60440725739f4560f14eadf40e335890 (patch)
tree00ae8169d08d09105ce1d32281e98a0e879cb009 /win/C#/Functions
parent3c92cad4fe545eb2159cbb576c57f8e3d1ee6bb5 (diff)
WinGui:
- Remove the old school splash screen. Doesn't really serve a purpose now. - Added Jobs Pending to the current Encode status string in the Main window task bar. - Some minor refactoring. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3444 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions')
-rw-r--r--win/C#/Functions/Main.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs
index 15714ee75..148f8f315 100644
--- a/win/C#/Functions/Main.cs
+++ b/win/C#/Functions/Main.cs
@@ -18,6 +18,7 @@ namespace Handbrake.Functions
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Parsing;
+ using HandBrake.ApplicationServices.Services.Interfaces;
using Model;
@@ -408,6 +409,46 @@ namespace Handbrake.Functions
}
/// <summary>
+ /// Recover a queue from file.
+ /// </summary>
+ public static void RecoverQueue(IQueue encodeQueue)
+ {
+ DialogResult result = DialogResult.None;
+ List<string> queueFiles = CheckQueueRecovery();
+ if (queueFiles.Count == 1)
+ {
+ result = MessageBox.Show(
+ "HandBrake has detected unfinished items on the queue from the last time the application was launched. Would you like to recover these?",
+ "Queue Recovery Possible", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
+ }
+ else if (queueFiles.Count > 1)
+ {
+ result = MessageBox.Show(
+ "HandBrake has detected multiple unfinished queue files. These will be from multiple instances of HandBrake running. Would you like to recover all unfinished jobs?",
+ "Queue Recovery Possible", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
+ }
+
+ if (result == DialogResult.Yes)
+ {
+ foreach (string file in queueFiles)
+ {
+ encodeQueue.LoadQueueFromFile(file); // Start Recovery
+ }
+ }
+ else
+ {
+ if (IsMultiInstance) return; // Don't tamper with the files if we are multi instance
+
+ string tempPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\");
+ foreach (string file in queueFiles)
+ {
+ if (File.Exists(Path.Combine(tempPath, file)))
+ File.Delete(Path.Combine(tempPath, file));
+ }
+ }
+ }
+
+ /// <summary>
/// Checks if this HandBrake is running multiple instances
/// </summary>
/// <returns>True if the UI has another instance running</returns>