mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[GUI] Redesign and reorganize ImageVerify window.
This commit is contained in:
@@ -35,6 +35,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Windows.Input;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
@@ -146,6 +147,8 @@ public sealed partial class ImageVerifyViewModel : ViewModelBase
|
||||
CloseVisible = true;
|
||||
StartVisible = true;
|
||||
OptionsVisible = true;
|
||||
|
||||
VerifySectorsVisible = _inputFormat is IOpticalMediaImage or IVerifiableSectorsImage;
|
||||
}
|
||||
|
||||
public ObservableCollection<LbaModel> ErrorList { get; }
|
||||
@@ -165,8 +168,6 @@ public sealed partial class ImageVerifyViewModel : ViewModelBase
|
||||
ProgressVisible = true;
|
||||
Progress2Visible = false;
|
||||
|
||||
VerifySectorsVisible = _inputFormat is IOpticalMediaImage or IVerifiableSectorsImage;
|
||||
|
||||
// TODO: Do not offer the option to use this form if the image does not support any kind of verification
|
||||
new Thread(DoWork).Start();
|
||||
}
|
||||
@@ -343,9 +344,9 @@ public sealed partial class ImageVerifyViewModel : ViewModelBase
|
||||
out tempUnknownLbas);
|
||||
}
|
||||
|
||||
failingLbas.AddRange(tempFailingLbas);
|
||||
failingLbas.AddRange(tempFailingLbas.Select(lba => lba + currentTrack.StartSector));
|
||||
|
||||
unknownLbas.AddRange(tempUnknownLbas);
|
||||
unknownLbas.AddRange(tempUnknownLbas.Select(lba => lba + currentTrack.StartSector));
|
||||
|
||||
if(remainingSectors < 512)
|
||||
{
|
||||
@@ -435,7 +436,7 @@ public sealed partial class ImageVerifyViewModel : ViewModelBase
|
||||
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
if(failingLbas.Count > 0)
|
||||
if(failingLbas.Count > 0 || unknownLbas.Count > 0)
|
||||
{
|
||||
if(failingLbas.Count == (int)_inputFormat.Info.Sectors)
|
||||
{
|
||||
@@ -444,7 +445,6 @@ public sealed partial class ImageVerifyViewModel : ViewModelBase
|
||||
}
|
||||
else
|
||||
{
|
||||
SectorErrorsText = UI.LBAs_with_error;
|
||||
SectorErrorsVisible = true;
|
||||
|
||||
foreach(ulong t in failingLbas)
|
||||
@@ -457,7 +457,7 @@ public sealed partial class ImageVerifyViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
if(unknownLbas.Count > 0)
|
||||
if(failingLbas.Count > 0 || unknownLbas.Count > 0)
|
||||
{
|
||||
if(unknownLbas.Count == (int)_inputFormat.Info.Sectors)
|
||||
{
|
||||
@@ -466,7 +466,6 @@ public sealed partial class ImageVerifyViewModel : ViewModelBase
|
||||
}
|
||||
else
|
||||
{
|
||||
SectorsUnknownsText = UI.Unknown_LBAs;
|
||||
SectorsUnknownsVisible = true;
|
||||
|
||||
foreach(ulong t in unknownLbas)
|
||||
@@ -479,13 +478,11 @@ public sealed partial class ImageVerifyViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
SectorSummaryVisible = true;
|
||||
TotalSectorsText = string.Format(UI.Total_sectors, _inputFormat.Info.Sectors);
|
||||
TotalSectorErrorsText = string.Format(UI.Total_errors, failingLbas.Count);
|
||||
TotalSectorUnknownsText = string.Format(UI.Total_unknowns, unknownLbas.Count);
|
||||
|
||||
TotalSectorErrorsUnknownsText =
|
||||
string.Format(UI.Total_errors_plus_unknowns, failingLbas.Count + unknownLbas.Count);
|
||||
SectorSummaryVisible = true;
|
||||
TotalSectorsText = $"[lime]{_inputFormat.Info.Sectors}[/]";
|
||||
TotalSectorErrorsText = $"[red]{failingLbas.Count}[/]";
|
||||
TotalSectorUnknownsText = $"[olive]{unknownLbas.Count}[/]";
|
||||
TotalSectorErrorsUnknownsText = $"[fuchsia]{failingLbas.Count + unknownLbas.Count}[/]";
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -37,94 +37,155 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:windows="clr-namespace:Aaru.Gui.ViewModels.Windows"
|
||||
xmlns:localization="clr-namespace:Aaru.Localization;assembly=Aaru.Localization"
|
||||
xmlns:controls="clr-namespace:Aaru.Gui.Controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignWidth="800"
|
||||
d:DesignHeight="450"
|
||||
Width="640"
|
||||
Height="400"
|
||||
x:Class="Aaru.Gui.Views.Windows.ImageVerify"
|
||||
Icon="/Assets/aaru-logo.png"
|
||||
Title="{Binding Title}">
|
||||
Title="{x:Static localization:UI.Title_Verify_image}">
|
||||
<Design.DataContext>
|
||||
<windows:ImageVerifyViewModel />
|
||||
</Design.DataContext>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<StackPanel Orientation="Vertical"
|
||||
IsVisible="{Binding OptionsVisible}">
|
||||
<CheckBox IsChecked="{Binding VerifyImageChecked}"
|
||||
IsEnabled="{Binding VerifyImageEnabled}">
|
||||
<Grid RowDefinitions="Auto,*,Auto"
|
||||
RowSpacing="8"
|
||||
Margin="12">
|
||||
<Grid Grid.Row="0"
|
||||
RowDefinitions="Auto,Auto"
|
||||
RowSpacing="8"
|
||||
IsVisible="{Binding OptionsVisible, Mode=OneWay}">
|
||||
<CheckBox Grid.Row="0"
|
||||
IsChecked="{Binding VerifyImageChecked, Mode=TwoWay}"
|
||||
IsEnabled="{Binding VerifyImageEnabled, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Verify_media_image_if_supported}" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding VerifySectorsChecked}"
|
||||
IsEnabled="{Binding VerifySectorsEnabled}"
|
||||
IsVisible="{Binding VerifySectorsVisible}">
|
||||
<CheckBox Grid.Row="1"
|
||||
IsChecked="{Binding VerifySectorsChecked, Mode=TwoWay}"
|
||||
IsEnabled="{Binding VerifySectorsEnabled, Mode=OneWay}"
|
||||
IsVisible="{Binding VerifySectorsVisible, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Verify_all_sectors_if_supported}" />
|
||||
</CheckBox>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical"
|
||||
IsVisible="{Binding ResultsVisible}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Orientation="Vertical"
|
||||
IsVisible="{Binding SectorErrorsVisible}">
|
||||
<TextBlock Text="{Binding SectorErrorsText}" />
|
||||
<DataGrid ItemsSource="{Binding ErrorList}">
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
RowDefinitions="*, Auto"
|
||||
RowSpacing="8"
|
||||
IsVisible="{Binding ResultsVisible, Mode=OneWay}">
|
||||
<Grid Grid.Row="0"
|
||||
RowDefinitions="*, *"
|
||||
RowSpacing="8">
|
||||
<Grid Grid.Row="0"
|
||||
RowDefinitions="Auto, *"
|
||||
RowSpacing="8"
|
||||
IsVisible="{Binding SectorErrorsVisible, Mode=OneWay}">
|
||||
<controls:SpectreTextBlock Grid.Row="0"
|
||||
Text="{x:Static localization:UI.LBAs_with_error}" />
|
||||
<DataGrid Grid.Row="1"
|
||||
ItemsSource="{Binding ErrorList, Mode=OneWay}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{x:Static localization:UI.Title_LBA}"
|
||||
Binding="{Binding Lba}" />
|
||||
Binding="{Binding Lba, Mode=OneWay}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical"
|
||||
IsVisible="{Binding SectorsUnknownsVisible}">
|
||||
<TextBlock Text="{Binding SectorsUnknownsText}" />
|
||||
<DataGrid ItemsSource="{Binding UnknownList}">
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
RowDefinitions="Auto, *"
|
||||
RowSpacing="8"
|
||||
IsVisible="{Binding SectorsUnknownsVisible, Mode=OneWay}">
|
||||
<controls:SpectreTextBlock Grid.Row="0"
|
||||
Text="{x:Static localization:UI.Unknown_LBAs}" />
|
||||
<DataGrid Grid.Row="1"
|
||||
ItemsSource="{Binding UnknownList, Mode=OneWay}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{x:Static localization:UI.Title_LBA}"
|
||||
Binding="{Binding Lba}" />
|
||||
Binding="{Binding Lba, Mode=OneWay}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto"
|
||||
IsVisible="{Binding SectorSummaryVisible,Mode=OneWay}">
|
||||
<controls:SpectreTextBlock Grid.Row="0"
|
||||
Text="{Binding ImageResultText, Mode=OneWay}"
|
||||
IsVisible="{Binding ImageResultVisible, Mode=OneWay}" />
|
||||
<controls:SpectreTextBlock Grid.Row="1"
|
||||
Text="{x:Static localization:UI.All_sectors_contain_errors}"
|
||||
IsVisible="{Binding SectorsErrorsAllVisible, Mode=OneWay}" />
|
||||
<controls:SpectreTextBlock Grid.Row="2"
|
||||
Text="{x:Static localization:UI.All_sectors_are_unknown}"
|
||||
IsVisible="{Binding SectorsUnknownAllVisible, Mode=OneWay}" />
|
||||
<StackPanel Grid.Row="3"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<controls:SpectreTextBlock Text="{x:Static localization:UI.Total_sectors}" />
|
||||
<controls:SpectreTextBlock Text="{Binding TotalSectorsText, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel IsVisible="{Binding SectorSummaryVisible}">
|
||||
<TextBlock Text="{Binding ImageResultText}"
|
||||
IsVisible="{Binding ImageResultVisible}" />
|
||||
<TextBlock Text="{Binding SectorsErrorsAllText}"
|
||||
IsVisible="{Binding SectorsErrorsAllVisible}" />
|
||||
<TextBlock Text="{Binding SectorsUnknownAllText}"
|
||||
IsVisible="{Binding SectorsUnknownAllVisible}" />
|
||||
<TextBlock Text="{Binding TotalSectorsText}" /> <TextBlock Text="{Binding TotalSectorErrorsText}" />
|
||||
<TextBlock Text="{Binding TotalSectorUnknownsText}" />
|
||||
<TextBlock Text="{Binding TotalSectorErrorsUnknownsText}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical"
|
||||
IsVisible="{Binding ProgressVisible}">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Text="{Binding ProgressText}" />
|
||||
<ProgressBar Maximum="{Binding ProgressMaxValue}"
|
||||
IsIndeterminate="{Binding ProgressIndeterminate}"
|
||||
Value="{Binding ProgressValue}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical"
|
||||
IsVisible="{Binding Progress2Visible}">
|
||||
<TextBlock Text="{Binding Progress2Text}" />
|
||||
<ProgressBar Maximum="{Binding Progress2MaxValue}"
|
||||
IsIndeterminate="{Binding Progress2Indeterminate}"
|
||||
Value="{Binding Progress2Value}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Command="{Binding StartCommand}"
|
||||
IsVisible="{Binding StartVisible}">
|
||||
<StackPanel Grid.Row="4"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<controls:SpectreTextBlock Text="{x:Static localization:UI.Total_errors}" />
|
||||
<controls:SpectreTextBlock Text="{Binding TotalSectorErrorsText, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="5"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<controls:SpectreTextBlock Text="{x:Static localization:UI.Total_unknowns}" />
|
||||
<controls:SpectreTextBlock Text="{Binding TotalSectorUnknownsText, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="6"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<controls:SpectreTextBlock Text="{x:Static localization:UI.Total_errors_plus_unknowns}" />
|
||||
<controls:SpectreTextBlock Text="{Binding TotalSectorErrorsUnknownsText, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
RowDefinitions="Auto,Auto"
|
||||
RowSpacing="8"
|
||||
IsVisible="{Binding ProgressVisible, Mode=OneWay}">
|
||||
<Grid RowDefinitions="Auto, Auto"
|
||||
Grid.Row="0"
|
||||
RowSpacing="8">
|
||||
<controls:SpectreTextBlock Grid.Row="0"
|
||||
Text="{Binding ProgressText, Mode=OneWay}" />
|
||||
<ProgressBar Grid.Row="1"
|
||||
Maximum="{Binding ProgressMaxValue, Mode=OneWay}"
|
||||
IsIndeterminate="{Binding ProgressIndeterminate, Mode=OneWay}"
|
||||
Value="{Binding ProgressValue, Mode=OneWay}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
RowDefinitions="Auto, Auto"
|
||||
RowSpacing="8"
|
||||
IsVisible="{Binding Progress2Visible, Mode=OneWay}">
|
||||
<controls:SpectreTextBlock Grid.Row="0"
|
||||
Text="{Binding Progress2Text, Mode=OneWay}" />
|
||||
<ProgressBar Grid.Row="1"
|
||||
Maximum="{Binding Progress2MaxValue, Mode=OneWay}"
|
||||
IsIndeterminate="{Binding Progress2Indeterminate, Mode=OneWay}"
|
||||
Value="{Binding Progress2Value, Mode=OneWay}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<StackPanel Grid.Row="2"
|
||||
Orientation="Horizontal"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Right"
|
||||
Spacing="8">
|
||||
<Button Command="{Binding StartCommand, Mode=OneWay}"
|
||||
IsVisible="{Binding StartVisible, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.ButtonLabel_Start}" />
|
||||
</Button>
|
||||
<Button Command="{Binding CloseCommand}"
|
||||
IsVisible="{Binding CloseVisible}">
|
||||
<Button Command="{Binding CloseCommand, Mode=OneWay}"
|
||||
IsVisible="{Binding CloseVisible, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.ButtonLabel_Close}" />
|
||||
</Button>
|
||||
<Button Command="{Binding StopCommand}"
|
||||
IsVisible="{Binding StopVisible}"
|
||||
IsEnabled="{Binding StopEnabled}">
|
||||
<Button Command="{Binding StopCommand, Mode=OneWay}"
|
||||
IsVisible="{Binding StopVisible, Mode=OneWay}"
|
||||
IsEnabled="{Binding StopEnabled, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.ButtonLabel_Stop}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
6
Aaru.Localization/UI.Designer.cs
generated
6
Aaru.Localization/UI.Designer.cs
generated
@@ -6225,5 +6225,11 @@ namespace Aaru.Localization {
|
||||
return ResourceManager.GetString("SSC_Label", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public static string Title_Verify_image {
|
||||
get {
|
||||
return ResourceManager.GetString("Title_Verify_image", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
<value>[red]todos los sectores.[/]</value>
|
||||
</data>
|
||||
<data name="All_sectors_are_unknown" xml:space="preserve">
|
||||
<value>La integridad de todos los sectores es desconocida</value>
|
||||
<value>[olive]La integridad de todos los sectores es desconocida[/]</value>
|
||||
</data>
|
||||
<data name="All_sectors_contain_errors" xml:space="preserve">
|
||||
<value>Todos los sectores contienen errores</value>
|
||||
<value>[red]Todos los sectores contienen errores[/]</value>
|
||||
</data>
|
||||
<data name="All_sector_checksums_are_correct" xml:space="preserve">
|
||||
<value>[green]El checksum de todos los sectores es correcto[/]</value>
|
||||
@@ -389,10 +389,10 @@
|
||||
<value>Comprobando sectores...</value>
|
||||
</data>
|
||||
<data name="Checking_sector_0_of_1" xml:space="preserve">
|
||||
<value>[slateblue1]Comprobando sector [lime]{0}[/] de [violet]{1}[/]</value>
|
||||
<value>[slateblue1]Comprobando sector [lime]{0}[/] de [violet]{1}[/][/]</value>
|
||||
</data>
|
||||
<data name="Checking_sector_0_of_1_on_track_2" xml:space="preserve">
|
||||
<value>[slateblue1]Comprobando sector [lime]{0}[/] de [violet]{1}[/], en la pista [teal]{2}[/]</value>
|
||||
<value>[slateblue1]Comprobando sector [lime]{0}[/] de [violet]{1}[/], en la pista [teal]{2}[/][/]</value>
|
||||
</data>
|
||||
<data name="Checking_sector_checksums_took_0" xml:space="preserve">
|
||||
<value>[slateblue1]Comprobar los checksums de los sectores tomó [aqua]{0}[/][/]</value>
|
||||
@@ -1467,7 +1467,7 @@
|
||||
<value>[slateblue1]LBAs sin checksum:[/]</value>
|
||||
</data>
|
||||
<data name="LBAs_with_error" xml:space="preserve">
|
||||
<value>[slateblue1]LBAs sin errores:[/]</value>
|
||||
<value>[bold][slateblue1]LBAs con errores:[/][/]</value>
|
||||
</data>
|
||||
<data name="Level_1_Version_Product_Information_Tuple" xml:space="preserve">
|
||||
<value>Tupla de Información del Producto o Versión Nivel 1</value>
|
||||
@@ -2778,7 +2778,7 @@ Probadores:
|
||||
<value>Funcionalidad desconocida</value>
|
||||
</data>
|
||||
<data name="Unknown_LBAs" xml:space="preserve">
|
||||
<value>LBAs desconocidos:</value>
|
||||
<value>[bold][slateblue1]LBAs desconocidos:[/][/]</value>
|
||||
</data>
|
||||
<data name="unlimited_as_in_speed" xml:space="preserve">
|
||||
<value>ilimitada</value>
|
||||
@@ -3113,4 +3113,7 @@ Probadores:
|
||||
<data name="SSC_Label" xml:space="preserve">
|
||||
<value>SSC</value>
|
||||
</data>
|
||||
<data name="Title_Verify_image" xml:space="preserve">
|
||||
<value>Verificar imagen</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -2802,13 +2802,13 @@ Do you want to continue?</value>
|
||||
<value>Verifying track {0} of {1}</value>
|
||||
</data>
|
||||
<data name="All_sectors_contain_errors" xml:space="preserve">
|
||||
<value>All sectors contain errors</value>
|
||||
<value>[red]All sectors contain errors[/]</value>
|
||||
</data>
|
||||
<data name="All_sectors_are_unknown" xml:space="preserve">
|
||||
<value>All sectors are unknown</value>
|
||||
<value>[olive]All sectors are unknown[/]</value>
|
||||
</data>
|
||||
<data name="Unknown_LBAs" xml:space="preserve">
|
||||
<value>Unknown LBAs:</value>
|
||||
<value>[bold][slateblue1]Unknown LBAs:[/][/]</value>
|
||||
</data>
|
||||
<data name="Title_Images" xml:space="preserve">
|
||||
<value>Images</value>
|
||||
@@ -3189,4 +3189,7 @@ Do you want to continue?</value>
|
||||
<data name="SSC_Label" xml:space="preserve">
|
||||
<value>SSC</value>
|
||||
</data>
|
||||
<data name="Title_Verify_image" xml:space="preserve">
|
||||
<value>Verify image</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user