Use default directory for folder browsing, if possible (fixes #412)

This commit is contained in:
Matt Nadareski
2022-10-04 20:45:28 -07:00
parent 7b506586cd
commit 9dc7f726e9
2 changed files with 10 additions and 1 deletions

View File

@@ -129,6 +129,7 @@
- Update to DIC 20220909
- Possibly fix PIC parsing
- Add PS3 folder/file checks for detection
- Use default directory for folder browsing, if possible
### 2.3 (2022-02-05)
- Start overhauling Redump information pulling, again

View File

@@ -793,7 +793,15 @@ namespace MPF.UI.ViewModels
/// </summary>
private void BrowseFolder()
{
WinForms.FolderBrowserDialog folderDialog = new WinForms.FolderBrowserDialog { ShowNewFolderButton = false, SelectedPath = System.AppDomain.CurrentDomain.BaseDirectory };
string currentPath = App.Options.DefaultOutputPath;
if (string.IsNullOrWhiteSpace(currentPath) || !Directory.Exists(currentPath))
currentPath = System.AppDomain.CurrentDomain.BaseDirectory;
WinForms.FolderBrowserDialog folderDialog = new WinForms.FolderBrowserDialog
{
ShowNewFolderButton = false,
SelectedPath = currentPath,
};
WinForms.DialogResult result = folderDialog.ShowDialog();
if (result == WinForms.DialogResult.OK)