mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Remove WinForms from MainViewModel
This commit is contained in:
@@ -13,7 +13,6 @@ using MPF.Core.Utilities;
|
||||
using MPF.Core.UI.ComboBoxItems;
|
||||
using SabreTools.RedumpLib.Data;
|
||||
using WPFCustomMessageBox;
|
||||
using WinForms = System.Windows.Forms;
|
||||
|
||||
namespace MPF.UI.Core.ViewModels
|
||||
{
|
||||
@@ -871,15 +870,6 @@ namespace MPF.UI.Core.ViewModels
|
||||
/// </summary>
|
||||
public static void ExitApplication() => Application.Current.Shutdown();
|
||||
|
||||
/// <summary>
|
||||
/// Set the output path from a dialog box
|
||||
/// </summary>
|
||||
public void SetOutputPath()
|
||||
{
|
||||
BrowseFile();
|
||||
EnsureDiscInformation();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show the About text popup
|
||||
/// </summary>
|
||||
@@ -1141,40 +1131,6 @@ namespace MPF.UI.Core.ViewModels
|
||||
|
||||
#region Helpers
|
||||
|
||||
/// <summary>
|
||||
/// Browse for an output file path
|
||||
/// </summary>
|
||||
private void BrowseFile()
|
||||
{
|
||||
// Get the current path, if possible
|
||||
string currentPath = this.OutputPath;
|
||||
if (string.IsNullOrWhiteSpace(currentPath))
|
||||
currentPath = Path.Combine(this.Options.DefaultOutputPath, "track.bin");
|
||||
if (string.IsNullOrWhiteSpace(currentPath))
|
||||
currentPath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "track.bin");
|
||||
|
||||
// Get the full path
|
||||
currentPath = Path.GetFullPath(currentPath);
|
||||
|
||||
// Get the directory
|
||||
string directory = Path.GetDirectoryName(currentPath);
|
||||
|
||||
// Get the filename
|
||||
string filename = Path.GetFileName(currentPath);
|
||||
|
||||
WinForms.FileDialog fileDialog = new WinForms.SaveFileDialog
|
||||
{
|
||||
FileName = filename,
|
||||
InitialDirectory = directory,
|
||||
};
|
||||
WinForms.DialogResult result = fileDialog.ShowDialog();
|
||||
|
||||
if (result == WinForms.DialogResult.OK)
|
||||
{
|
||||
this.OutputPath = fileDialog.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cache the current disc type to internal variable
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user