From 5277cf539834f2843a769345cb9d7f035fbc29e2 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 20 Aug 2025 05:24:49 +0100 Subject: [PATCH] Colorize archive list. --- Aaru.Localization/UI.es.resx | 16 ++++----- Aaru.Localization/UI.resx | 16 ++++----- Aaru/Commands/Archive/List.cs | 65 ++++++++++++++++++++--------------- 3 files changed, 54 insertions(+), 43 deletions(-) diff --git a/Aaru.Localization/UI.es.resx b/Aaru.Localization/UI.es.resx index df7637e87..92d6870bc 100644 --- a/Aaru.Localization/UI.es.resx +++ b/Aaru.Localization/UI.es.resx @@ -2625,8 +2625,8 @@ Probadores: Etiqueta: - Hora - + [bold][dodgerblue1]Hora[/][/] + [bold][teal]Veces usado[/][/] @@ -2979,16 +2979,16 @@ Probadores: Abriendo archivo... - Atrib + [bold][gold3]Atrib[/][/] - Comprimido + [bold][teal]Comprimido[/][/] - Fecha + [bold][blue]Fecha[/][/] - Tamaño + [bold][lime]Tamaño[/][/] [red]No se pudo obtener información sobre el archivo...[/] @@ -2997,10 +2997,10 @@ Probadores: [red]No se pudo abrir el archivo[/] - {0} ficheros + [slateblue1][italic][teal]{0}[/] ficheros[/][/] - {0} ficheros, {1} carpetas + [slateblue1][italic][teal]{0}[/] ficheros, [teal]{1}[/] carpetas[/][/] Depuración diff --git a/Aaru.Localization/UI.resx b/Aaru.Localization/UI.resx index c7277eae7..d42cef70a 100644 --- a/Aaru.Localization/UI.resx +++ b/Aaru.Localization/UI.resx @@ -1721,8 +1721,8 @@ Testers: Clear - Time - + [bold][dodgerblue1]Time[/][/] + Module @@ -3057,26 +3057,26 @@ Do you want to continue? [red]Error [orange3]{0}[/] reading extended attribute [green]{1}[/] for archive entry [teal]#{2}[/].[/] - Date + [bold][blue]Date[/][/] - Attr + [bold][gold3]Attr[/][/] "Attributes" abbreviated to the smallest possible size, if allowed by language rules. - Size + [bold][lime]Size[/][/] - Compressed + [bold][teal]Compressed[/][/] Error {0} getting compressed size for archive entry #{1}. - {0} files, {1} folders + [slateblue1][italic][teal]{0}[/] files, [teal]{1}[/] folders[/][/] - {0} files + [slateblue1][italic][teal]{0}[/] files[/][/] Exception diff --git a/Aaru/Commands/Archive/List.cs b/Aaru/Commands/Archive/List.cs index fab8a85d5..9b62e46f4 100644 --- a/Aaru/Commands/Archive/List.cs +++ b/Aaru/Commands/Archive/List.cs @@ -180,6 +180,8 @@ sealed class ArchiveListCommand : Command .Start(ctx => { table.HideFooters(); + table.Border(TableBorder.Rounded); + table.BorderColor(Color.Yellow); table.AddColumn(new TableColumn(UI.Title_Date) { @@ -237,9 +239,7 @@ sealed class ArchiveListCommand : Command if(errno != ErrorNumber.NoError) { - AaruLogging.Error(UI.Error_0_getting_filename_for_archive_entry_1, - errno, - i); + AaruLogging.Error(UI.Error_0_getting_filename_for_archive_entry_1, errno, i); continue; } @@ -248,9 +248,7 @@ sealed class ArchiveListCommand : Command if(errno != ErrorNumber.NoError) { - AaruLogging.Error(UI.Error_0_retrieving_stat_for_archive_entry_1, - errno, - i); + AaruLogging.Error(UI.Error_0_retrieving_stat_for_archive_entry_1, errno, i); continue; } @@ -295,9 +293,9 @@ sealed class ArchiveListCommand : Command if(errno != ErrorNumber.NoError) { AaruLogging.Debug(MODULE_NAME, - UI.Error_0_getting_compressed_size_for_archive_entry_1, - errno, - i); + UI.Error_0_getting_compressed_size_for_archive_entry_1, + errno, + i); continue; } @@ -307,29 +305,42 @@ sealed class ArchiveListCommand : Command if(errno != ErrorNumber.NoError) { AaruLogging.Debug(MODULE_NAME, - UI.Error_0_getting_uncompressed_size_for_archive_entry_1, - errno, - i); + UI.Error_0_getting_uncompressed_size_for_archive_entry_1, + errno, + i); continue; } if(archive.ArchiveFeatures.HasFlag(ArchiveSupportedFeature.SupportsCompression)) { - table.AddRow(stat.CreationTime?.ToShortDateString() ?? "", - stat.CreationTime?.ToLongTimeString() ?? "", - new string(attr), - uncompressedSize.ToString(), - compressedSize.ToString(), - fileName); + table.AddRow($"[blue]{stat.CreationTime?.ToShortDateString() ?? ""}[/]", + $"[dodgerblue1]{stat.CreationTime?.ToLongTimeString() ?? ""}[/]", + $"[gold3]{new string(attr)}[/]", + $"[lime]{uncompressedSize}[/]", + $"[teal]{compressedSize}[/]", + $"[green]{Markup.Escape(fileName)}[/]"); + + AaruLogging.Information($"Date: {stat.CreationTime?.ToShortDateString() ?? ""} " + + $"Time: ({stat.CreationTime?.ToLongTimeString() ?? ""}), " + + $"Attributes: {new string(attr)}, " + + $"Uncompressed Size: {uncompressedSize}, " + + $"Compressed Size: {compressedSize}, " + + $"File Name: {fileName}"); } else { - table.AddRow(stat.CreationTime?.ToShortDateString() ?? "", - stat.CreationTime?.ToLongTimeString() ?? "", - new string(attr), - uncompressedSize.ToString(), - fileName); + table.AddRow($"[blue]{stat.CreationTime?.ToShortDateString() ?? ""}[/]", + $"[dodgerblue1]{stat.CreationTime?.ToLongTimeString() ?? ""}[/]", + $"[gold3]{new string(attr)}[/]", + $"[lime]{uncompressedSize}[/]", + $"[green]{Markup.Escape(fileName)}[/]"); + + AaruLogging.Information($"Date: {stat.CreationTime?.ToShortDateString() ?? ""} " + + $"Time: ({stat.CreationTime?.ToLongTimeString() ?? ""}), " + + $"Attributes: {new string(attr)}, " + + $"Uncompressed Size: {uncompressedSize}, " + + $"File Name: {fileName}"); } totalSize += compressedSize; @@ -339,13 +350,13 @@ sealed class ArchiveListCommand : Command } table.ShowFooters(); - table.Columns[0].Footer(inputFilter.CreationTime.ToShortDateString()); - table.Columns[1].Footer(inputFilter.CreationTime.ToLongTimeString()); - table.Columns[3].Footer(totalUncompressed.ToString()); + table.Columns[0].Footer($"[blue]{inputFilter.CreationTime.ToShortDateString()}[/]"); + table.Columns[1].Footer($"[dodgerblue1]{inputFilter.CreationTime.ToLongTimeString()}[/]"); + table.Columns[3].Footer($"[lime]{totalUncompressed}[/]"); if(archive.ArchiveFeatures.HasFlag(ArchiveSupportedFeature.SupportsCompression)) { - table.Columns[4].Footer(totalSize.ToString()); + table.Columns[4].Footer($"[teal]{totalSize}[/]"); table.Columns[5] .Footer(archive.ArchiveFeatures.HasFlag(ArchiveSupportedFeature