diff options
author | sr55 <[email protected]> | 2018-11-04 20:14:30 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2018-11-04 20:14:30 +0000 |
commit | 0971a9aaca0b2ff8fa64f64a1f60830b2f47940a (patch) | |
tree | 86349bd7af39e5e6b05fe8ba5fa390d4a16a1601 /win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs | |
parent | e566794de8b26fc97b1d4316eb6170a482d022c1 (diff) |
WinGui: Allow the UI to silently attempt to auto-create folders when adding to the queue. Subsequent deletion of said folder will still prompt a queue failure as this is an abnormal situation that would be best reviewed by the user #1654
Diffstat (limited to 'win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs b/win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs index 7a58721b3..c66a45c0c 100644 --- a/win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs +++ b/win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs @@ -70,12 +70,20 @@ namespace HandBrakeWPF.Utilities { if (!Directory.Exists(dirPath)) { - MessageBoxResult result = errorService.ShowMessageBox(string.Format(Resources.DirectoryUtils_CreateFolderMsg, dirPath), Resources.DirectoryUtils_CreateFolder, MessageBoxButton.YesNo, MessageBoxImage.Question); - if (result == MessageBoxResult.Yes) + if (createDirectoryPrompt) { - Directory.CreateDirectory(dirPath); + MessageBoxResult result = errorService.ShowMessageBox(string.Format(Resources.DirectoryUtils_CreateFolderMsg, dirPath), Resources.DirectoryUtils_CreateFolder, MessageBoxButton.YesNo, MessageBoxImage.Question); + if (result == MessageBoxResult.Yes) + { + Directory.CreateDirectory(dirPath); + } } + else + { + Directory.CreateDirectory(dirPath); + } } + using (File.Create(Path.Combine(dirPath, Path.GetRandomFileName()), 1, FileOptions.DeleteOnClose)) { } |