]> granicus.if.org Git - handbrake/commitdiff
WinGui: Allow the UI to silently attempt to auto-create folders when adding to the...
authorsr55 <sr55.hb@outlook.com>
Sun, 4 Nov 2018 20:14:30 +0000 (20:14 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 4 Nov 2018 20:14:30 +0000 (20:14 +0000)
win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs

index 7a58721b31f485fc4f67338d9a60699cbe5449f1..c66a45c0c346330f6f126cba7ed747b2fb146120 100644 (file)
@@ -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))
                 {
                 }
index 9cfe574ca9262c036e8ea7f05277f05e78f66019..45904cb0e2e1c88a30c1ca6cdf7ad947e059f4d4 100644 (file)
@@ -1514,7 +1514,7 @@ namespace HandBrakeWPF.ViewModels
                 }           \r
             }\r
 \r
-            if (!DirectoryUtilities.IsWritable(Path.GetDirectoryName(this.CurrentTask.Destination), true, this.errorService))\r
+            if (!DirectoryUtilities.IsWritable(Path.GetDirectoryName(this.CurrentTask.Destination), false, this.errorService))\r
             {\r
                 this.errorService.ShowMessageBox(Resources.Main_NoPermissionsOrMissingDirectory, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);\r
                 return false;\r