From 0b53bb9222932362e6e052a5217508c5850fdaae Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Thu, 22 Aug 2024 21:51:27 +0300 Subject: [PATCH] Add fstab rows --- locales/en_US.json | 2 ++ src/installation_summary_page/mod.rs | 22 ++++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/locales/en_US.json b/locales/en_US.json index cfcb491..4691547 100644 --- a/locales/en_US.json +++ b/locales/en_US.json @@ -115,6 +115,8 @@ "install_confirm_detail_partition_method_manual_crypttab_entry_title": "Manual Crypttab Entry", "install_confirm_detail_partition_method_manual_crypttab_entry_subtitle_auto": "{LUKS_NAME} Unlocked Automatically With Root Unlock", "install_confirm_detail_partition_method_manual_crypttab_entry_subtitle_manual": "{LUKS_NAME} Unlocked Manually Via Password On System Startup", + "install_confirm_detail_partition_method_manual_fstab_entry_title": "Manual FSTAB Entry", + "install_confirm_detail_partition_method_manual_fstab_entry_subtitle": "{PART_NAME} ({PART_SIZE} {PART_FS}) Mounted On ({MOUNTPOINT})", "mounted_on_detail": " mounted on ", "install_target_detail": "Install Target:", "install_confirm_button_label": "Confirm & Install PikaOS" diff --git a/src/installation_summary_page/mod.rs b/src/installation_summary_page/mod.rs index 2928341..1cddbaf 100644 --- a/src/installation_summary_page/mod.rs +++ b/src/installation_summary_page/mod.rs @@ -86,12 +86,14 @@ pub fn installation_summary_page( #[strong] partition_method_automatic_target_refcell, #[strong] - partition_method_manual_luks_enabled_refcell, - #[strong] partition_method_automatic_seperation_refcell, #[strong] partition_method_automatic_ratio_refcell, #[strong] + partition_method_manual_fstab_entry_array_refcell, + #[strong] + partition_method_manual_luks_enabled_refcell, + #[strong] partition_method_manual_crypttab_entry_array_refcell, move|_, action_arg| { @@ -235,6 +237,22 @@ pub fn installation_summary_page( installation_summary_row_viewport_listbox.append(&install_confirm_detail_partition_method_manual_crypttab_entry); } } + for fstab_entry in partition_method_manual_fstab_entry_array_refcell.borrow().iter() { + let install_confirm_detail_partition_method_manual_fstab_entry = adw::ActionRow::builder() + .title(t!("install_confirm_detail_partition_method_manual_fstab_entry_title")) + .subtitle(strfmt::strfmt( + &t!("install_confirm_detail_partition_method_manual_fstab_entry_subtitle"), + &std::collections::HashMap::from([ + ("PART_NAME".to_string(), fstab_entry.partition.part_name.as_str()), + ("PART_SIZE".to_string(), fstab_entry.partition.part_size_pretty.as_str()), + ("PART_FS".to_string(), fstab_entry.partition.part_fs.as_str()), + ("MOUNTPOINT".to_string(), fstab_entry.mountpoint.as_str()), + ]) + ).unwrap()) + .build(); + install_confirm_detail_partition_method_manual_fstab_entry.add_css_class("property"); + installation_summary_row_viewport_listbox.append(&install_confirm_detail_partition_method_manual_fstab_entry); + } } _ => panic!() }