diff options
author | sr55 <[email protected]> | 2011-04-27 19:40:41 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-04-27 19:40:41 +0000 |
commit | f3d48d42f46644795c5a35bf117edaeefe496ca3 (patch) | |
tree | c9a7056d0b48c13f20aa7bf687da3441c3177042 /win/CS/frmMain.cs | |
parent | 2d81a5ec8e0851b306b82eea9fead769ff6517b3 (diff) |
WinGui:
- Automatically attempt to create destination path if it does not exist when starting an encode.
- When adding to queue, it'll optionally ask.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3962 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/frmMain.cs')
-rw-r--r-- | win/CS/frmMain.cs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/win/CS/frmMain.cs b/win/CS/frmMain.cs index 51678516b..5c82fd2c9 100644 --- a/win/CS/frmMain.cs +++ b/win/CS/frmMain.cs @@ -1113,9 +1113,32 @@ namespace Handbrake if (!Directory.Exists(Path.GetDirectoryName(jobDestination)))
{
if (showError)
- MessageBox.Show(string.Format("Destination Path does not exist.\nPath: {0}\n\nThis item was not added to the Queue.", Path.GetDirectoryName(jobDestination)), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ {
+ DialogResult result =
+ MessageBox.Show(
+ string.Format("Destination Path does not exist.\nPath: {0}\n\n Would you like to create it now?", Path.GetDirectoryName(jobDestination)),
+ "Warning",
+ MessageBoxButtons.YesNo,
+ MessageBoxIcon.Question);
+
+ if (result == DialogResult.Yes)
+ {
+ // Make sure the path exists, attempt to create it if it doesn't
+ string path = Directory.GetParent(jobDestination).ToString();
+ if (!Directory.Exists(path))
+ {
+ Directory.CreateDirectory(path);
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
return false;
}
+
// Make sure we don't have a duplciate on the queue.
if (this.queueProcessor.QueueManager.CheckForDestinationPathDuplicates(jobDestination))
|