Initial commit: Futonizer MKV track stripper
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using Microsoft.Win32;
|
||||
using Futonizer.Models;
|
||||
using Wpf.Ui.Controls;
|
||||
|
||||
namespace Futonizer.Views;
|
||||
|
||||
public partial class SettingsWindow : FluentWindow
|
||||
{
|
||||
public AppSettings? Result { get; private set; }
|
||||
|
||||
public SettingsWindow(AppSettings current)
|
||||
{
|
||||
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this);
|
||||
InitializeComponent();
|
||||
MkvMergePathBox.Text = current.MkvMergePath;
|
||||
OutputFolderBox.Text = current.OutputFolder;
|
||||
}
|
||||
|
||||
private void BrowseMkvMergeButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dlg = new OpenFileDialog
|
||||
{
|
||||
Title = "Locate mkvmerge.exe",
|
||||
Filter = "mkvmerge.exe|mkvmerge.exe|Executable files (*.exe)|*.exe|All files (*.*)|*.*",
|
||||
CheckFileExists = true,
|
||||
};
|
||||
if (dlg.ShowDialog(this) == true)
|
||||
MkvMergePathBox.Text = dlg.FileName;
|
||||
}
|
||||
|
||||
private void BrowseOutputFolderButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dlg = new OpenFolderDialog { Title = "Select output folder" };
|
||||
if (dlg.ShowDialog(this) == true)
|
||||
OutputFolderBox.Text = dlg.FolderName;
|
||||
}
|
||||
|
||||
private void SaveButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Result = new AppSettings
|
||||
{
|
||||
MkvMergePath = MkvMergePathBox.Text.Trim(),
|
||||
OutputFolder = OutputFolderBox.Text.Trim(),
|
||||
};
|
||||
DialogResult = true;
|
||||
}
|
||||
|
||||
private void CancelButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DialogResult = false;
|
||||
}
|
||||
|
||||
private void ViewHistoryButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var win = new HistoryWindow { Owner = this };
|
||||
win.ShowDialog();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user