From ec7ac4ba69c93cc382f771b0e089775c3c5b4627 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Mon, 18 Aug 2025 13:46:28 +0100 Subject: [PATCH] Move markup to resources in dev list command. --- Aaru.Localization/UI.resx | 6 +++--- Aaru/Commands/Device/List.cs | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Aaru.Localization/UI.resx b/Aaru.Localization/UI.resx index f1835322f..a663ba742 100644 --- a/Aaru.Localization/UI.resx +++ b/Aaru.Localization/UI.resx @@ -350,14 +350,14 @@ In you are unsure, please press N to not continue. No known devices attached. - Path + [bold][olive]Path[/][/] - Serial + [aqua]Serial[/] From "Serial number" - Supported? + [green]Supported?[/] Name of character encoding to use. diff --git a/Aaru/Commands/Device/List.cs b/Aaru/Commands/Device/List.cs index dc27a40d3..6e7ffc428 100644 --- a/Aaru/Commands/Device/List.cs +++ b/Aaru/Commands/Device/List.cs @@ -38,7 +38,6 @@ using Aaru.Devices; using Aaru.Localization; using Aaru.Logging; using JetBrains.Annotations; -using Serilog; using Spectre.Console; using Spectre.Console.Cli; @@ -85,25 +84,26 @@ sealed class ListDevicesCommand : Command else { Table table = new(); - table.AddColumn($"[bold][olive]{UI.Path}[/][/]"); - table.AddColumn($"[bold][blue]{UI.Title_Vendor}[/][/]"); - table.AddColumn($"[bold][purple]{UI.Title_Model}[/][/]"); - table.AddColumn($"[bold][aqua]{UI.Serial}[/][/]"); - table.AddColumn($"[bold][rosybrown]{UI.Title_Bus}[/][/]"); - table.AddColumn($"[bold][green]{UI.Supported_Question}[/][/]"); + table.AddColumn(UI.Path); + table.AddColumn(UI.Title_Vendor); + table.AddColumn(UI.Title_Model); + table.AddColumn(UI.Serial); + table.AddColumn(UI.Title_Bus); + table.AddColumn(UI.Supported_Question); table.Border(TableBorder.Rounded); table.BorderColor(Color.Yellow); foreach(DeviceInfo dev in devices.OrderBy(d => d.Path)) { - table.AddRow($"[italic][olive]{Markup.Escape(dev.Path ?? "")}[/][/]", - $"[italic][blue]{Markup.Escape(dev.Vendor ?? "")}[/][/]", - $"[italic][purple]{Markup.Escape(dev.Model ?? "")}[/][/]", - $"[italic][aqua]{Markup.Escape(dev.Serial ?? "")}[/][/]", - $"[italic][rosybrown]{Markup.Escape(dev.Bus ?? "")}[/][/]", + table.AddRow($"[italic][olive]{Markup.Escape(dev.Path ?? "")}[/][/]", + $"[italic][slateblue1]{Markup.Escape(dev.Vendor ?? "")}[/][/]", + $"[italic][purple]{Markup.Escape(dev.Model ?? "")}[/][/]", + $"[italic][aqua]{Markup.Escape(dev.Serial ?? "")}[/][/]", + $"[italic][rosybrown]{Markup.Escape(dev.Bus ?? "")}[/][/]", $"[italic]{(dev.Supported ? "[green]✓[/]" : "[red]✗[/]")}[/]"); - AaruLogging.Information("Path: {Path}, Vendor: {Vendor}, Model: {Model}, Serial: {Serial}, Bus: {Bus}, Supported: {Supported}", + AaruLogging + .Information("Path: {Path}, Vendor: {Vendor}, Model: {Model}, Serial: {Serial}, Bus: {Bus}, Supported: {Supported}", dev.Path, dev.Vendor, dev.Model,