From bfbae5cf5c9d1d406eac77fcb162c8acd8dfd355 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 15 Mar 2021 22:06:31 -0700 Subject: [PATCH] Fix default output directory in UI --- MPF/Windows/MainWindow.xaml.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MPF/Windows/MainWindow.xaml.cs b/MPF/Windows/MainWindow.xaml.cs index b773179a..850d05d4 100644 --- a/MPF/Windows/MainWindow.xaml.cs +++ b/MPF/Windows/MainWindow.xaml.cs @@ -421,10 +421,6 @@ namespace MPF.Windows KnownSystem? systemType = SystemTypeComboBox.SelectedItem as KnownSystemComboBoxItem; MediaType? mediaType = MediaTypeComboBox.SelectedItem as Element; - // Set the output directory, if we changed drives or it's not already - if (driveChanged || string.IsNullOrEmpty(OutputDirectoryTextBox.Text)) - OutputDirectoryTextBox.Text = Path.Combine(UIOptions.Options.DefaultOutputPath, drive?.VolumeLabel ?? string.Empty); - // Get the extension for the file for the next two statements string extension = Env.Parameters?.GetDefaultExtension(mediaType); @@ -435,6 +431,10 @@ namespace MPF.Windows // If the extension for the file changed, update that automatically else if (Path.GetExtension(OutputFilenameTextBox.Text) != extension) OutputFilenameTextBox.Text = Path.GetFileNameWithoutExtension(OutputFilenameTextBox.Text) + (extension ?? ".bin"); + + // Set the output directory, if we changed drives or it's not already + if (driveChanged || string.IsNullOrEmpty(OutputDirectoryTextBox.Text)) + OutputDirectoryTextBox.Text = Path.Combine(UIOptions.Options.DefaultOutputPath, Path.GetFileNameWithoutExtension(OutputFilenameTextBox.Text) ?? string.Empty); } ///