]> git.proxmox.com Git - pve-installer.git/commitdiff
tui: display proper keyboard layout name in summary
authorChristoph Heiss <c.heiss@proxmox.com>
Thu, 15 Jun 2023 08:22:35 +0000 (10:22 +0200)
committerChristoph Heiss <c.heiss@proxmox.com>
Thu, 15 Jun 2023 08:22:35 +0000 (10:22 +0200)
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
proxmox-tui-installer/src/main.rs
proxmox-tui-installer/src/options.rs

index c430a43fb84ab26f7ed9ea74f9d6e5d4167c03a7..e055faf22f58348dbca7db4dc3d6cdbf8f0bde31 100644 (file)
@@ -520,7 +520,7 @@ fn summary_dialog(siv: &mut Cursive) -> InstallerView {
                     ("name".to_owned(), "Option".to_owned()),
                     ("value".to_owned(), "Selected value".to_owned()),
                 ])
-                .items(state.options.to_summary()),
+                .items(state.options.to_summary(&state.locales)),
         ))
         .child(
             LinearLayout::horizontal()
index 4ac8ceb7ced420dec5647544c17f09abd539211c..0eb52bc26bc7884d2afb7f0f0d69663c987596c8 100644 (file)
@@ -1,4 +1,5 @@
 use crate::{
+    setup::LocaleInfo,
     utils::{CidrAddress, Fqdn},
     SummaryOption,
 };
@@ -316,7 +317,13 @@ pub struct InstallerOptions {
 }
 
 impl InstallerOptions {
-    pub fn to_summary(&self) -> Vec<SummaryOption> {
+    pub fn to_summary(&self, locales: &LocaleInfo) -> Vec<SummaryOption> {
+        let kb_layout = locales
+            .kmap
+            .get(&self.timezone.kb_layout)
+            .map(|l| &l.name)
+            .unwrap_or(&self.timezone.kb_layout);
+
         vec![
             SummaryOption::new("Bootdisk filesystem", self.bootdisk.fstype.to_string()),
             SummaryOption::new(
@@ -329,7 +336,7 @@ impl InstallerOptions {
                     .join(", "),
             ),
             SummaryOption::new("Timezone", &self.timezone.timezone),
-            SummaryOption::new("Keyboard layout", &self.timezone.kb_layout),
+            SummaryOption::new("Keyboard layout", kb_layout),
             SummaryOption::new("Administator email", &self.password.email),
             SummaryOption::new("Management interface", &self.network.ifname),
             SummaryOption::new("Hostname", self.network.fqdn.to_string()),