<!--
// /***************************************************************************
// Aaru Data Preservation Suite
// ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
//
// Filename       : ImageConvert.xaml
// Author(s)      : Natalia Portillo <claunia@claunia.com>
//
// Component      : GUI windows.
//
// ‐‐[ Description ] ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
//
//     Image conversion 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-2025 Natalia Portillo
// ****************************************************************************/
-->
<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:windows="clr-namespace:Aaru.Gui.ViewModels.Windows"
        mc:Ignorable="d"
        d:DesignWidth="800"
        d:DesignHeight="450"
        x:Class="Aaru.Gui.Views.Windows.ImageConvert"
        Icon="/Assets/aaru-logo.png"
        Title="{Binding Title}">
    <Design.DataContext>
        <windows:ImageConvertViewModel />
    </Design.DataContext>
    <StackPanel Orientation="Vertical">
        <TextBlock Text="{Binding SourceImageLabel}" />
        <TextBox Text="{Binding SourceText}"
                 IsReadOnly="True" />
        <TextBlock Text="{Binding OutputFormatLabel}" />
        <ComboBox ItemsSource="{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="{Binding ChooseLabel}" />
            </Button>
        </StackPanel>
        <StackPanel Orientation="Vertical"
                    IsVisible="{Binding OptionsVisible}">
            <StackPanel Orientation="Horizontal">
                <NumericUpDown Increment="1"
                               Minimum="1"
                               Maximum="16384"
                               Value="{Binding SectorsValue}" />
                <TextBlock Text="{Binding SectorsLabel}" />
            </StackPanel>
            <CheckBox IsChecked="{Binding ForceChecked}">
                <TextBlock Text="{Binding ForceLabel}" />
            </CheckBox>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding CreatorLabel}" /> <TextBox Text="{Binding CreatorText}" />
                <Button Command="{Binding CreatorCommand}"
                        IsVisible="{Binding CreatorVisible}">
                    <TextBlock Text="{Binding GetFromSourceImageLabel}" />
                </Button>
            </StackPanel>
            <StackPanel>
                <TextBlock Text="{Binding MetadataLabel}" />
                <TabControl>
                    <TabItem>
                        <TabItem.Header>
                            <TextBlock Text="{Binding MediaLabel}" />
                        </TabItem.Header>
                        <StackPanel Orientation="Vertical">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding TitleLabel}" /> <TextBox Text="{Binding MediaTitleText}" />
                                <Button Command="{Binding MediaTitleCommand}"
                                        IsVisible="{Binding MediaTitleVisible}">
                                    <TextBlock Text="{Binding GetFromSourceImageLabel}" />
                                </Button>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding ManufacturerLabel}" />
                                <TextBox Text="{Binding MediaManufacturerText}" />
                                <Button Command="{Binding MediaManufacturerCommand}"
                                        IsVisible="{Binding MediaManufacturerVisible}">
                                    <TextBlock Text="{Binding GetFromSourceImageLabel}" />
                                </Button>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding ModelLabel}" /> <TextBox Text="{Binding MediaModelText}" />
                                <Button Command="{Binding MediaModelCommand}"
                                        IsVisible="{Binding MediaModelVisible}">
                                    <TextBlock Text="{Binding GetFromSourceImageLabel}" />
                                </Button>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding SerialNumberLabel}" />
                                <TextBox Text="{Binding MediaSerialNumberText}" />
                                <Button Command="{Binding MediaSerialNumberCommand}"
                                        IsVisible="{Binding MediaSerialNumberVisible}">
                                    <TextBlock Text="{Binding GetFromSourceImageLabel}" />
                                </Button>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding BarcodeLabel}" />
                                <TextBox Text="{Binding MediaBarcodeText}" />
                                <Button Command="{Binding MediaBarcodeCommand}"
                                        IsVisible="{Binding MediaBarcodeVisible}">
                                    <TextBlock Text="{Binding GetFromSourceImageLabel}" />
                                </Button>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding PartNumberLabel}" />
                                <TextBox Text="{Binding MediaPartNumberText}" />
                                <Button Command="{Binding MediaPartNumberCommand}"
                                        IsVisible="{Binding MediaPartNumberVisible}">
                                    <TextBlock Text="{Binding GetFromSourceImageLabel}" />
                                </Button>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding NumberInSequenceLabel}" />
                                <NumericUpDown Increment="1"
                                               Value="{Binding MediaSequenceValue}"
                                               Minimum="0" />
                                <Button Command="{Binding MediaSequenceCommand}"
                                        IsVisible="{Binding MediaSequenceVisible}">
                                    <TextBlock Text="{Binding GetFromSourceImageLabel}" />
                                </Button>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding LastMediaOfTheSequenceLabel}" />
                                <NumericUpDown Increment="1"
                                               Value="{Binding LastMediaSequenceValue}"
                                               Minimum="0" />
                                <Button Command="{Binding LastMediaSequenceCommand}"
                                        IsVisible="{Binding LastMediaSequenceVisible}">
                                    <TextBlock Text="{Binding GetFromSourceImageLabel}" />
                                </Button>
                            </StackPanel>
                        </StackPanel>
                    </TabItem>
                    <TabItem>
                        <TabItem.Header>
                            <TextBlock Text="{Binding DriveLabel}" />
                        </TabItem.Header>
                        <StackPanel Orientation="Vertical">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding ManufacturerLabel}" />
                                <TextBox Text="{Binding DriveManufacturerText}" />
                                <Button Command="{Binding DriveManufacturerCommand}"
                                        IsVisible="{Binding DriveManufacturerVisible}">
                                    <TextBlock Text="{Binding GetFromSourceImageLabel}" />
                                </Button>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding ModelLabel}" /> <TextBox Text="{Binding DriveModelText}" />
                                <Button Command="{Binding DriveModelCommand}"
                                        IsVisible="{Binding DriveModelVisible}">
                                    <TextBlock Text="{Binding GetFromSourceImageLabel}" />
                                </Button>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding SerialNumberLabel}" />
                                <TextBox Text="{Binding DriveSerialNumberText}" />
                                <Button Command="{Binding DriveSerialNumberCommand}"
                                        IsVisible="{Binding DriveSerialNumberVisible}">
                                    <TextBlock Text="{Binding GetFromSourceImageLabel}" />
                                </Button>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding FirmwareRevisionLabel}" />
                                <TextBox Text="{Binding DriveFirmwareRevisionText}" />
                                <Button Command="{Binding DriveFirmwareRevisionCommand}"
                                        IsVisible="{Binding DriveFirmwareRevisionVisible}">
                                    <TextBlock Text="{Binding GetFromSourceImageLabel}" />
                                </Button>
                            </StackPanel>
                        </StackPanel>
                    </TabItem>
                    <TabItem>
                        <TabItem.Header>
                            <TextBlock Text="{Binding CommentsLabel}" />
                        </TabItem.Header>
                        <StackPanel Orientation="Vertical">
                            <TextBox Text="{Binding CommentsText}" />
                            <Button Command="{Binding CommentsCommand}"
                                    IsVisible="{Binding CommentsVisible}">
                                <TextBlock Text="{Binding GetFromSourceImageLabel}" />
                            </Button>
                        </StackPanel>
                    </TabItem>
                </TabControl>
                <TextBlock Text="{Binding AaruMetadataLabel}" />
                <StackPanel Orientation="Horizontal">
                    <TextBox Text="{Binding MetadataJsonText}"
                             IsReadOnly="True" />
                    <Button Command="{Binding AaruMetadataFromImageCommand}"
                            IsVisible="{Binding AaruMetadataFromImageVisible}">
                        <TextBlock Text="{Binding FromImageLabel}" />
                    </Button>
                    <Button Command="{Binding AaruMetadataCommand}">
                        <TextBlock Text="{Binding ChooseLabel}" />
                    </Button>
                </StackPanel>
                <TextBlock Text="{Binding ResumeFileLabel}" />
                <StackPanel Orientation="Horizontal">
                    <TextBox Text="{Binding ResumeFileText}"
                             IsReadOnly="True" />
                    <Button Command="{Binding ResumeFileFromImageCommand}"
                            IsVisible="{Binding ResumeFileFromImageVisible}">
                        <TextBlock Text="{Binding FromImageLabel}" />
                    </Button>
                    <Button Command="{Binding ResumeFileCommand}">
                        <TextBlock Text="{Binding ChooseLabel}" />
                    </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="{Binding StartLabel}" />
            </Button>
            <Button Command="{Binding CloseCommand}"
                    IsVisible="{Binding CloseVisible}">
                <TextBlock Text="{Binding CloseLabel}" />
            </Button>
            <Button Command="{Binding StopCommand}"
                    IsVisible="{Binding StopVisible}"
                    IsEnabled="{Binding StopEnabled}">
                <TextBlock Text="{Binding StopLabel}" />
            </Button>
        </StackPanel>
    </StackPanel>
</Window>