diff --git a/Aaru.Gui/ViewModels/Windows/ImageVerifyViewModel.cs b/Aaru.Gui/ViewModels/Windows/ImageVerifyViewModel.cs index a05b33bd4..d788a608d 100644 --- a/Aaru.Gui/ViewModels/Windows/ImageVerifyViewModel.cs +++ b/Aaru.Gui/ViewModels/Windows/ImageVerifyViewModel.cs @@ -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 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}[/]"; }); } diff --git a/Aaru.Gui/Views/Windows/ImageVerify.xaml b/Aaru.Gui/Views/Windows/ImageVerify.xaml index d717848e8..fe1aeaf13 100644 --- a/Aaru.Gui/Views/Windows/ImageVerify.xaml +++ b/Aaru.Gui/Views/Windows/ImageVerify.xaml @@ -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}"> - - - + + + - + - - - - - - + + + + + + + Binding="{Binding Lba, Mode=OneWay}" /> - - - - + + + + + Binding="{Binding Lba, Mode=OneWay}" /> + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/Aaru.Localization/UI.Designer.cs b/Aaru.Localization/UI.Designer.cs index e68f96589..2c0ecbfbe 100644 --- a/Aaru.Localization/UI.Designer.cs +++ b/Aaru.Localization/UI.Designer.cs @@ -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); + } + } } } diff --git a/Aaru.Localization/UI.es.resx b/Aaru.Localization/UI.es.resx index e1fd8dca6..cf8b871ab 100644 --- a/Aaru.Localization/UI.es.resx +++ b/Aaru.Localization/UI.es.resx @@ -26,10 +26,10 @@ [red]todos los sectores.[/] - La integridad de todos los sectores es desconocida + [olive]La integridad de todos los sectores es desconocida[/] - Todos los sectores contienen errores + [red]Todos los sectores contienen errores[/] [green]El checksum de todos los sectores es correcto[/] @@ -389,10 +389,10 @@ Comprobando sectores... - [slateblue1]Comprobando sector [lime]{0}[/] de [violet]{1}[/] + [slateblue1]Comprobando sector [lime]{0}[/] de [violet]{1}[/][/] - [slateblue1]Comprobando sector [lime]{0}[/] de [violet]{1}[/], en la pista [teal]{2}[/] + [slateblue1]Comprobando sector [lime]{0}[/] de [violet]{1}[/], en la pista [teal]{2}[/][/] [slateblue1]Comprobar los checksums de los sectores tomó [aqua]{0}[/][/] @@ -1467,7 +1467,7 @@ [slateblue1]LBAs sin checksum:[/] - [slateblue1]LBAs sin errores:[/] + [bold][slateblue1]LBAs con errores:[/][/] Tupla de Información del Producto o Versión Nivel 1 @@ -2778,7 +2778,7 @@ Probadores: Funcionalidad desconocida - LBAs desconocidos: + [bold][slateblue1]LBAs desconocidos:[/][/] ilimitada @@ -3113,4 +3113,7 @@ Probadores: SSC + + Verificar imagen + \ No newline at end of file diff --git a/Aaru.Localization/UI.resx b/Aaru.Localization/UI.resx index d18c67101..5c47e1f77 100644 --- a/Aaru.Localization/UI.resx +++ b/Aaru.Localization/UI.resx @@ -2802,13 +2802,13 @@ Do you want to continue? Verifying track {0} of {1} - All sectors contain errors + [red]All sectors contain errors[/] - All sectors are unknown + [olive]All sectors are unknown[/] - Unknown LBAs: + [bold][slateblue1]Unknown LBAs:[/][/] Images @@ -3189,4 +3189,7 @@ Do you want to continue? SSC + + Verify image + \ No newline at end of file