summaryrefslogtreecommitdiffstats
path: root/win/C#/frmMain.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-07-15 20:15:08 +0000
committersr55 <[email protected]>2010-07-15 20:15:08 +0000
commit6c9b4d2c4cf5928bb2b472beca76c2edc4c41f03 (patch)
tree85ba020472dfb475f4db0424ed139da20fa6b64e /win/C#/frmMain.cs
parent5c8cab7ea3c07e36b74bcb8c8198f8ef796e1530 (diff)
WinGui:
- Multiple instance support. Each instance has a unique id. id = 0 will use the standard log/queue files. id = 1,2...n will use standard file names but with the instance id added to the end. This means that each instance will have it's own queue. Queue is not shared between Instances If multiple queue files are found when starting up, it will offer to load them all in. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3440 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmMain.cs')
-rw-r--r--win/C#/frmMain.cs36
1 files changed, 26 insertions, 10 deletions
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index 7f46139a2..91ed40423 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -211,21 +211,37 @@ namespace Handbrake
// Startup Functions
private void queueRecovery()
{
- if (Main.CheckQueueRecovery())
+ DialogResult result = DialogResult.None;
+ List<string> queueFiles = Main.CheckQueueRecovery();
+ if (queueFiles.Count == 1)
{
- DialogResult result =
- MessageBox.Show(
+ 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)
- encodeQueue.LoadQueueFromFile("hb_queue_recovery.xml"); // Start Recovery
- else
+ if (result == DialogResult.Yes)
+ {
+ foreach (string file in queueFiles)
+ {
+ encodeQueue.LoadQueueFromFile(file); // Start Recovery
+ }
+ }
+ else
+ {
+ if (Main.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)
{
- // Remove the Queue recovery file if the user doesn't want to recovery the last queue.
- string queuePath = Path.Combine(Path.GetTempPath(), "hb_queue_recovery.xml");
- if (File.Exists(queuePath))
- File.Delete(queuePath);
+ if (File.Exists(Path.Combine(tempPath, file)))
+ File.Delete(Path.Combine(tempPath, file));
}
}
}