mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Migrate image convert from Eto.Forms to Avalonia.
This commit is contained in:
8
.idea/.idea.Aaru/.idea/contentModel.xml
generated
8
.idea/.idea.Aaru/.idea/contentModel.xml
generated
@@ -1221,12 +1221,8 @@
|
||||
<e p="frmDecodeMediaTags.xeto.cs" t="Include" />
|
||||
<e p="frmDump.xeto" t="Include" />
|
||||
<e p="frmDump.xeto.cs" t="Include" />
|
||||
<e p="frmImageConvert.xeto" t="Include" />
|
||||
<e p="frmImageConvert.xeto.cs" t="Include" />
|
||||
<e p="frmImageSidecar.xeto" t="Include" />
|
||||
<e p="frmImageSidecar.xeto.cs" t="Include" />
|
||||
<e p="frmImageVerify.xeto" t="Include" />
|
||||
<e p="frmImageVerify.xeto.cs" t="Include" />
|
||||
<e p="frmMain.xeto" t="Include" />
|
||||
<e p="frmMain.xeto.cs" t="Include" />
|
||||
<e p="frmMediaScan.xeto" t="Include" />
|
||||
@@ -1244,6 +1240,7 @@
|
||||
<e p="EncodingModel.cs" t="Include" />
|
||||
<e p="FileSystemModel.cs" t="Include" />
|
||||
<e p="ImageModel.cs" t="Include" />
|
||||
<e p="ImagePluginModel.cs" t="Include" />
|
||||
<e p="ImagesRootModel.cs" t="Include" />
|
||||
<e p="IsrcModel.cs" t="Include" />
|
||||
<e p="LbaModel.cs" t="Include" />
|
||||
@@ -1313,6 +1310,7 @@
|
||||
<e p="DvdWritableInfoViewModel.cs" t="Include" />
|
||||
<e p="EncodingsDialogViewModel.cs" t="Include" />
|
||||
<e p="ImageChecksumViewModel.cs" t="Include" />
|
||||
<e p="ImageConvertViewModel.cs" t="Include" />
|
||||
<e p="ImageEntropyViewModel.cs" t="Include" />
|
||||
<e p="ImageInfoViewModel.cs" t="Include" />
|
||||
<e p="ImageVerifyViewModel.cs" t="Include" />
|
||||
@@ -1337,6 +1335,8 @@
|
||||
<e p="EncodingsDialog.xaml.cs" t="Include" />
|
||||
<e p="ImageChecksumWindow.xaml" t="Include" />
|
||||
<e p="ImageChecksumWindow.xaml.cs" t="Include" />
|
||||
<e p="ImageConvertWindow.xaml" t="Include" />
|
||||
<e p="ImageConvertWindow.xaml.cs" t="Include" />
|
||||
<e p="ImageEntropyWindow.xaml" t="Include" />
|
||||
<e p="ImageEntropyWindow.xaml.cs" t="Include" />
|
||||
<e p="ImageVerifyWindow.xaml" t="Include" />
|
||||
|
||||
@@ -1,240 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!--
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ============================================================================
|
||||
//
|
||||
// Filename : frmImageConvert.xeto
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Image conversion window.
|
||||
//
|
||||
// ==[ Description ] ==========================================================
|
||||
//
|
||||
// Defines the structure for the image conversion GUI window.
|
||||
//
|
||||
// ==[ License ] ==============================================================
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ============================================================================
|
||||
// Copyright © 2011-2020 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
-->
|
||||
<Form xmlns="http://schema.picoe.ca/eto.forms" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="Convert image" ClientSize="800, 600" Padding="10">
|
||||
<StackLayout Orientation="Vertical" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
|
||||
<Label Text="Source image"/>
|
||||
<TextBox ID="txtSource" ReadOnly="True"/>
|
||||
<Label Text="Output format"/>
|
||||
<ComboBox ID="cmbFormat" ReadOnly="True" SelectedIndexChanged="OnCmbFormatSelectedIndexChanged"/>
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextBox ID="txtDestination" ReadOnly="True"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnDestination" Text="Choose..." Click="OnBtnDestinationClick" Enabled="False"/>
|
||||
</StackLayout>
|
||||
<StackLayout Orientation="Vertical" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
ID="stkOptions">
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<NumericStepper ID="numCount" MinValue="1" MaxValue="16384" Value="64"/>
|
||||
<Label ID="txtCount" Text="How many sectors to convert at once."/>
|
||||
</StackLayout>
|
||||
<CheckBox ID="chkForce"
|
||||
Text="Continue conversion even if sector or media tags will be lost in the process."/>
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<Label ID="lblCreator" Text="Who (person) created the image?"/>
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextBox ID="txtCreator"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnCreator" Text="Get from source image" Click="OnBtnCreator"/>
|
||||
</StackLayout>
|
||||
<GroupBox ID="grpMetadata" Text="Metadata">
|
||||
<StackLayout Orientation="Vertical" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<TabControl>
|
||||
<TabPage Text="Media">
|
||||
<StackLayout Orientation="Vertical" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<Label ID="lblMediaTitle" Text="Title"/>
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextBox ID="txtMediaTitle"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnMediaTitle" Text="Get from source image" Click="OnBtnMediaTitle"/>
|
||||
</StackLayout>
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<Label ID="lblMediaManufacturer" Text="Manufacturer"/>
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextBox ID="txtMediaManufacturer"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnMediaManufacturer" Text="Get from source image"
|
||||
Click="OnBtnMediaManufacturer"/>
|
||||
</StackLayout>
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<Label ID="lblMediaModel" Text="Model"/>
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextBox ID="txtMediaModel"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnMediaModel" Text="Get from source image" Click="OnBtnMediaModel"/>
|
||||
</StackLayout>
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<Label ID="lblMediaSerialNumber" Text="Serial number"/>
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextBox ID="txtMediaSerialNumber"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnMediaSerialNumber" Text="Get from source image"
|
||||
Click="OnBtnMediaSerialNumber"/>
|
||||
</StackLayout>
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<Label ID="lblMediaBarcode" Text="Barcode"/>
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextBox ID="txtMediaBarcode"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnMediaBarcode" Text="Get from source image"
|
||||
Click="OnBtnMediaBarcode"/>
|
||||
</StackLayout>
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<Label ID="lblMediaPartNumber" Text="Part number"/>
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextBox ID="txtMediaPartNumber"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnMediaPartNumber" Text="Get from source image"
|
||||
Click="OnBtnMediaPartNumber"/>
|
||||
</StackLayout>
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<Label ID="lblMediaSequence" Text="Number in sequence"/>
|
||||
<NumericStepper ID="numMediaSequence" MinValue="0"/>
|
||||
<Button ID="btnMediaSequence" Text="Get from source image"
|
||||
Click="OnBtnMediaSequence"/>
|
||||
</StackLayout>
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<Label ID="lblLastMediaSequence" Text="Last media of the sequence"/>
|
||||
<NumericStepper ID="numLastMediaSequence" MinValue="0"/>
|
||||
<Button ID="btnLastMediaSequence" Text="Get from source image"
|
||||
Click="OnBtnLastMediaSequence"/>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
<TabPage Text="Drive">
|
||||
<StackLayout Orientation="Vertical" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<Label ID="lblDriveManufacturer" Text="Manufacturer"/>
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextBox ID="txtDriveManufacturer"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnDriveManufacturer" Text="Get from source image"
|
||||
Click="OnBtnDriveManufacturer"/>
|
||||
</StackLayout>
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<Label ID="lblDriveModel" Text="Model"/>
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextBox ID="txtDriveModel"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnDriveModel" Text="Get from source image" Click="OnBtnDriveModel"/>
|
||||
</StackLayout>
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<Label ID="lblDriveSerialNumber" Text="Serial number"/>
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextBox ID="txtDriveSerialNumber"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnDriveSerialNumber" Text="Get from source image"
|
||||
Click="OnBtnDriveSerialNumber"/>
|
||||
</StackLayout>
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<Label ID="lblDriveFirmwareRevision" Text="Firmware revision"/>
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextBox ID="txtDriveFirmwareRevision"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnDriveFirmwareRevision" Text="Get from source image"
|
||||
Click="OnBtnDriveFirmwareRevision"/>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
<TabPage Text="Comments">
|
||||
<StackLayout Orientation="Vertical" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextArea ID="txtComments"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnComments" Text="Get from source image" Click="OnBtnComments"/>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
</TabControl>
|
||||
<Label Text="Existing CICM XML sidecar"/>
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextBox ID="txtCicmXml" ReadOnly="True"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnCicmXmlFromImage" Text="From image..." Click="OnBtnCicmXmlFromImageClick"/>
|
||||
<Button ID="btnCicmXml" Text="Choose..." Click="OnBtnCicmXmlClick"/>
|
||||
</StackLayout>
|
||||
<Label Text="Existing resume file"/>
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch">
|
||||
<StackLayoutItem Expand="True">
|
||||
<TextBox ID="txtResumeFile" ReadOnly="True"/>
|
||||
</StackLayoutItem>
|
||||
<Button ID="btnResumeFileFromImage" Text="From image..." Click="OnBtnResumeFileFromImageClick"/>
|
||||
<Button ID="btnResumeFile" Text="Choose..." Click="OnBtnResumeFileClick"/>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</GroupBox>
|
||||
<GroupBox ID="grpOptions" Text="Options" Visible="False"/>
|
||||
</StackLayout>
|
||||
<StackLayout Orientation="Vertical" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
ID="stkProgress" Visible="False">
|
||||
<StackLayout Orientation="Vertical" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
ID="stkProgress1">
|
||||
<StackLayoutItem HorizontalAlignment="Center" Expand="True">
|
||||
<Label ID="lblProgress"/>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Center" Expand="True">
|
||||
<ProgressBar ID="prgProgress"/>
|
||||
</StackLayoutItem>
|
||||
</StackLayout>
|
||||
<StackLayout Orientation="Vertical" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
ID="stkProgress2">
|
||||
<StackLayoutItem HorizontalAlignment="Center" Expand="True">
|
||||
<Label ID="lblProgress2"/>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Center" Expand="True">
|
||||
<ProgressBar ID="prgProgress2"/>
|
||||
</StackLayoutItem>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
<StackLayoutItem HorizontalAlignment="Right" Expand="True">
|
||||
<StackLayout Orientation="Horizontal" HorizontalContentAlignment="Right" VerticalContentAlignment="Bottom">
|
||||
<Button ID="btnStart" Text="Start" Click="OnBtnStart"/>
|
||||
<Button ID="btnClose" Text="Close" Click="OnBtnClose"/>
|
||||
<Button ID="btnStop" Text="Stop" Enabled="False" Visible="False" Click="OnBtnStop"/>
|
||||
</StackLayout>
|
||||
</StackLayoutItem>
|
||||
</StackLayout>
|
||||
</Form>
|
||||
File diff suppressed because it is too large
Load Diff
10
Aaru.Gui/Models/ImagePluginModel.cs
Normal file
10
Aaru.Gui/Models/ImagePluginModel.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Gui.Models
|
||||
{
|
||||
public class ImagePluginModel
|
||||
{
|
||||
public string Name => Plugin.Name;
|
||||
public IWritableImage Plugin { get; set; }
|
||||
}
|
||||
}
|
||||
1738
Aaru.Gui/ViewModels/ImageConvertViewModel.cs
Normal file
1738
Aaru.Gui/ViewModels/ImageConvertViewModel.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -31,9 +31,10 @@ namespace Aaru.Gui.ViewModels
|
||||
readonly Window _view;
|
||||
IFilter _filter;
|
||||
ImageChecksumWindow _imageChecksumWindow;
|
||||
ImageEntropyWindow _imageEntropyWindow;
|
||||
ImageVerifyWindow _imageVerifyWindow;
|
||||
string _imagePath;
|
||||
ImageConvertWindow _imageConvertWindow;
|
||||
ImageEntropyWindow _imageEntropyWindow;
|
||||
readonly string _imagePath;
|
||||
ImageVerifyWindow _imageVerifyWindow;
|
||||
|
||||
public ImageInfoViewModel(string imagePath, IFilter filter, IMediaImage imageFormat, Window view)
|
||||
|
||||
@@ -766,23 +767,22 @@ namespace Aaru.Gui.ViewModels
|
||||
|
||||
protected void ExecuteConvertCommand()
|
||||
{
|
||||
/* TODO: frmImageConvert
|
||||
if(frmImageConvert != null)
|
||||
if(_imageConvertWindow != null)
|
||||
{
|
||||
frmImageConvert.Show();
|
||||
_imageConvertWindow.Show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
frmImageConvert = new frmImageConvert(imageFormat, imagePath);
|
||||
_imageConvertWindow = new ImageConvertWindow();
|
||||
_imageConvertWindow.DataContext = new ImageConvertViewModel(_imageFormat, _imagePath, _imageConvertWindow);
|
||||
|
||||
frmImageConvert.Closed += (s, ea) =>
|
||||
_imageConvertWindow.Closed += (sender, args) =>
|
||||
{
|
||||
frmImageConvert = null;
|
||||
_imageConvertWindow = null;
|
||||
};
|
||||
|
||||
frmImageConvert.Show();
|
||||
*/
|
||||
_imageConvertWindow.Show();
|
||||
}
|
||||
|
||||
protected void ExecuteCreateSidecarCommand()
|
||||
|
||||
202
Aaru.Gui/Views/ImageConvertWindow.xaml
Normal file
202
Aaru.Gui/Views/ImageConvertWindow.xaml
Normal file
@@ -0,0 +1,202 @@
|
||||
<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.ImageConvertWindow" Icon="/Assets/aaru-logo.png"
|
||||
Title="{Binding Title}">
|
||||
<Design.DataContext>
|
||||
<vm:ImageConvertViewModel />
|
||||
</Design.DataContext>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Text="Source image" /> <TextBox Text="{Binding SourceText}" IsReadOnly="True" />
|
||||
<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 DestinationText}" IsReadOnly="True" />
|
||||
<Button Command="{Binding DestinationCommand}" IsEnabled="{Binding DestinationEnabled}"
|
||||
IsVisible="{Binding DestinationVisible}">
|
||||
<TextBlock Text="Choose..." />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical" IsVisible="{Binding OptionsVisible}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<NumericUpDown Increment="1" Minimum="1" Maximum="16384" Value="{Binding SectorsValue}" />
|
||||
<TextBlock Text="How many sectors to convert at once." />
|
||||
</StackPanel>
|
||||
<CheckBox IsChecked="{Binding ForceChecked}">
|
||||
<TextBlock Text="Continue conversion even if sector or media tags will be lost in the process." />
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Who (person) created the image?" /> <TextBox Text="{Binding CreatorText}" />
|
||||
<Button Command="{Binding CreatorCommand}" IsVisible="{Binding CreatorVisible}">
|
||||
<TextBlock Text="Get from source image" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="Metadata" />
|
||||
<TabControl>
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="Media" />
|
||||
</TabItem.Header>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Title" /> <TextBox Text="{Binding MediaTitleText}" />
|
||||
<Button Command="{Binding MediaTitleCommand}" IsVisible="{Binding MediaTitleVisible}">
|
||||
<TextBlock Text="Get from source image" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Manufacturer" /> <TextBox Text="{Binding MediaManufacturerText}" />
|
||||
<Button Command="{Binding MediaManufacturerCommand}"
|
||||
IsVisible="{Binding MediaManufacturerVisible}">
|
||||
<TextBlock Text="Get from source image" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Model" /> <TextBox Text="{Binding MediaModelText}" />
|
||||
<Button Command="{Binding MediaModelCommand}" IsVisible="{Binding MediaModelVisible}">
|
||||
<TextBlock Text="Get from source image" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Serial number" /> <TextBox Text="{Binding MediaSerialNumberText}" />
|
||||
<Button Command="{Binding MediaSerialNumberCommand}"
|
||||
IsVisible="{Binding MediaSerialNumberVisible}">
|
||||
<TextBlock Text="Get from source image" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Barcode" /> <TextBox Text="{Binding MediaBarcodeText}" />
|
||||
<Button Command="{Binding MediaBarcodeCommand}"
|
||||
IsVisible="{Binding MediaBarcodeVisible}">
|
||||
<TextBlock Text="Get from source image" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Part number" /> <TextBox Text="{Binding MediaPartNumberText}" />
|
||||
<Button Command="{Binding MediaPartNumberCommand}"
|
||||
IsVisible="{Binding MediaPartNumberVisible}">
|
||||
<TextBlock Text="Get from source image" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Number in sequence" />
|
||||
<NumericUpDown Increment="1" Value="{Binding MediaSequenceValue}" Minimum="0" />
|
||||
<Button Command="{Binding MediaSequenceCommand}"
|
||||
IsVisible="{Binding MediaSequenceVisible}">
|
||||
<TextBlock Text="Get from source image" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Last media of the sequence" />
|
||||
<NumericUpDown Increment="1" Value="{Binding LastMediaSequenceValue}" Minimum="0" />
|
||||
<Button Command="{Binding LastMediaSequenceCommand}"
|
||||
IsVisible="{Binding LastMediaSequenceVisible}">
|
||||
<TextBlock Text="Get from source image" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="Drive" />
|
||||
</TabItem.Header>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Manufacturer" /> <TextBox Text="{Binding DriveManufacturerText}" />
|
||||
<Button Command="{Binding DriveManufacturerCommand}"
|
||||
IsVisible="{Binding DriveManufacturerVisible}">
|
||||
<TextBlock Text="Get from source image" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Model" /> <TextBox Text="{Binding DriveModelText}" />
|
||||
<Button Command="{Binding DriveModelCommand}" IsVisible="{Binding DriveModelVisible}">
|
||||
<TextBlock Text="Get from source image" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Serial number" /> <TextBox Text="{Binding DriveSerialNumberText}" />
|
||||
<Button Command="{Binding DriveSerialNumberCommand}"
|
||||
IsVisible="{Binding DriveSerialNumberVisible}">
|
||||
<TextBlock Text="Get from source image" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Firmware revision" />
|
||||
<TextBox Text="{Binding DriveFirmwareRevisionText}" />
|
||||
<Button Command="{Binding DriveFirmwareRevisionCommand}"
|
||||
IsVisible="{Binding DriveFirmwareRevisionVisible}">
|
||||
<TextBlock Text="Get from source image" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="Comments" />
|
||||
</TabItem.Header>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBox Text="{Binding CommentsText}" />
|
||||
<Button Command="{Binding CommentsCommand}" IsVisible="{Binding CommentsVisible}">
|
||||
<TextBlock Text="Get from source image" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<TextBlock Text="Existing CICM XML sidecar" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox Text="{Binding CicmXmlText}" IsReadOnly="True" />
|
||||
<Button Command="{Binding CicmXmlFromImageCommand}" IsVisible="{Binding CicmXmlFromImageVisible}">
|
||||
<TextBlock Text="From image..." />
|
||||
</Button>
|
||||
<Button Command="{Binding CicmXmlCommand}">
|
||||
<TextBlock Text="Choose..." />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TextBlock Text="Existing resume file" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox Text="{Binding ResumeFileText}" IsReadOnly="True" />
|
||||
<Button Command="{Binding ResumeFileFromImageCommand}"
|
||||
IsVisible="{Binding ResumeFileFromImageVisible}">
|
||||
<TextBlock Text="From image..." />
|
||||
</Button>
|
||||
<Button Command="{Binding ResumeFileCommand}">
|
||||
<TextBlock Text="Choose..." />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical" IsVisible="{Binding ProgressVisible}">
|
||||
<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/ImageConvertWindow.xaml.cs
Normal file
27
Aaru.Gui/Views/ImageConvertWindow.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 ImageConvertWindow : Window
|
||||
{
|
||||
public ImageConvertWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
#if DEBUG
|
||||
this.AttachDevTools();
|
||||
#endif
|
||||
}
|
||||
|
||||
void InitializeComponent() => AvaloniaXamlLoader.Load(this);
|
||||
|
||||
protected override void OnClosing(CancelEventArgs e)
|
||||
{
|
||||
(DataContext as ImageConvertViewModel)?.ExecuteStopCommand();
|
||||
base.OnClosing(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user