mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Migrate media dump window from Eto.Forms to Avalonia.
This commit is contained in:
94
Aaru.Gui/Views/MediaDumpWindow.xaml
Normal file
94
Aaru.Gui/Views/MediaDumpWindow.xaml
Normal file
@@ -0,0 +1,94 @@
|
||||
<Window xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="clr-namespace:Aaru.Gui.ViewModels;assembly=Aaru.Gui"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="800"
|
||||
d:DesignHeight="450" x:Class="Aaru.Gui.Views.MediaDumpWindow" Icon="/Assets/aaru-logo.png"
|
||||
Title="{Binding Title}">
|
||||
<Design.DataContext>
|
||||
<vm:MediaDumpViewModel />
|
||||
</Design.DataContext>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<StackPanel Orientation="Vertical" IsVisible="{Binding OptionsVisible}">
|
||||
<TextBlock Text="Output format" />
|
||||
<ComboBox Items="{Binding PluginsList}" SelectedItem="{Binding SelectedPlugin}"
|
||||
IsEnabled="{Binding FormatReadOnly}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox Text="{Binding Destination}" IsReadOnly="True" />
|
||||
<Button Command="{Binding DestinationCommand}" IsEnabled="{Binding DestinationEnabled}">
|
||||
<TextBlock Text="Choose..." />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<CheckBox IsChecked="{Binding StopOnError}">
|
||||
<TextBlock Text="Stop media dump on first error" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding Force}">
|
||||
<TextBlock Text="Continue dumping whatever happens" />
|
||||
</CheckBox>
|
||||
<NumericUpDown Text="Retry passes" Value="{Binding Retries}" Increment="1" Minimum="0" />
|
||||
<CheckBox IsChecked="{Binding Persistent}">
|
||||
<TextBlock Text="Try to recover partial or incorrect data" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding Resume}">
|
||||
<TextBlock Text="Create/use resume mapfile" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding Track1Pregap}" IsVisible="{Binding Track1PregapVisible}">
|
||||
<TextBlock Text="Try to read track 1 pregap" />
|
||||
</CheckBox>
|
||||
<NumericUpDown Text="Skipped sectors on error" Increment="1" Minimum="1" Value="{Binding Skipped}" />
|
||||
<CheckBox IsChecked="{Binding Sidecar}">
|
||||
<TextBlock Text="Create CICM XML metadata sidecar" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding Trim}">
|
||||
<TextBlock Text="Trim errors from skipped sectors" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding ExistingMetadata}">
|
||||
<TextBlock Text="Take metadata from existing CICM XML sidecar" />
|
||||
</CheckBox>
|
||||
<StackPanel IsVisible="{Binding EncodingVisible}">
|
||||
<TextBox Text="Encoding to use on metadata sidecar creation" />
|
||||
<ComboBox Items="{Binding Encodings}" SelectedItem="{Binding SelectedEncoding}"
|
||||
IsEnabled="{Binding EncodingEnabled}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
<!-- TODO: Image options -->
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical" IsVisible="{Binding ProgressVisible}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Writing image to:" /> <TextBlock Text="{Binding Destination}" />
|
||||
</StackPanel>
|
||||
<TextBlock Text="Log" /> <TextBox Text="{Binding Log}" IsReadOnly="True" />
|
||||
<StackPanel Orientation="Vertical" IsVisible="{Binding Progress1Visible}">
|
||||
<TextBox Text="{Binding ProgressText}" />
|
||||
<ProgressBar Value="{Binding ProgressValue}" Maximum="{Binding ProgressMaxValue}"
|
||||
IsIndeterminate="{Binding ProgressIndeterminate}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical" IsVisible="{Binding Progress2Visible}">
|
||||
<TextBox Text="{Binding Progress2Text}" />
|
||||
<ProgressBar Value="{Binding Progress2Value}" Maximum="{Binding Progress2MaxValue}"
|
||||
IsIndeterminate="{Binding Progress2Indeterminate}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Command="{Binding StartCommand}" IsVisible="{Binding StartVisible}">
|
||||
<TextBlock Text="Start" />
|
||||
</Button>
|
||||
<Button Command="{Binding CloseCommand}" IsVisible="{Binding CloseVisible}">
|
||||
<TextBlock Text="Close" />
|
||||
</Button>
|
||||
<Button Command="{Binding StopCommand}" IsVisible="{Binding StopVisible}" IsEnabled="{Binding StopEnabled}">
|
||||
<TextBlock Text="Stop" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Window>
|
||||
27
Aaru.Gui/Views/MediaDumpWindow.xaml.cs
Normal file
27
Aaru.Gui/Views/MediaDumpWindow.xaml.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.ComponentModel;
|
||||
using Aaru.Gui.ViewModels;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Aaru.Gui.Views
|
||||
{
|
||||
public class MediaDumpWindow : Window
|
||||
{
|
||||
public MediaDumpWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
#if DEBUG
|
||||
this.AttachDevTools();
|
||||
#endif
|
||||
}
|
||||
|
||||
void InitializeComponent() => AvaloniaXamlLoader.Load(this);
|
||||
|
||||
protected override void OnClosing(CancelEventArgs e)
|
||||
{
|
||||
(DataContext as MediaDumpViewModel)?.ExecuteStopCommand();
|
||||
base.OnClosing(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user