From a1ec14ed42477093ebeba9fb77f403ce1e9c5c25 Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Tue, 20 Aug 2024 08:47:20 +0300 Subject: [PATCH] it's getting better --- src/manual_partitioning_page/func.rs | 4 ++++ src/manual_partitioning_page/mod.rs | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/manual_partitioning_page/func.rs b/src/manual_partitioning_page/func.rs index b0742bd..9461c62 100644 --- a/src/manual_partitioning_page/func.rs +++ b/src/manual_partitioning_page/func.rs @@ -740,6 +740,10 @@ pub fn create_mount_row( row.set_langaction(language_changed_action); + row.set_id(*extra_mount_id_refcell.borrow()); + + (*extra_mount_id_refcell.borrow_mut()) += 1; + let null_checkbutton = gtk::CheckButton::builder().build(); diff --git a/src/manual_partitioning_page/mod.rs b/src/manual_partitioning_page/mod.rs index f31c21b..ec38ab4 100644 --- a/src/manual_partitioning_page/mod.rs +++ b/src/manual_partitioning_page/mod.rs @@ -32,7 +32,7 @@ pub fn manual_partitioning_page( let partition_array_refcell = Rc::new(RefCell::new(get_partitions())); let used_partition_array_refcell: Rc>> = Rc::new(RefCell::default()); let subvol_partition_array_refcell: Rc>> = Rc::new(RefCell::default()); - //let subvol_partition_array_refcell: Rc>> = Rc::new(RefCell::default()); + let extra_mount_id_refcell: Rc> = Rc::new(RefCell::default()); // @@ -73,6 +73,7 @@ pub fn manual_partitioning_page( &language_changed_action, &used_partition_array_refcell, &subvol_partition_array_refcell, + &extra_mount_id_refcell ); let open_disk_utility_button = gtk::Button::builder() @@ -154,6 +155,8 @@ pub fn manual_partitioning_page( partition_method_manual_luks_enabled_refcell, #[strong] partition_method_manual_crypttab_entry_array_refcell, + #[strong] + extra_mount_id_refcell, move |_| { while let Some(row) = drive_mounts_adw_listbox.last_child() { drive_mounts_adw_listbox.remove(&row); @@ -172,6 +175,7 @@ pub fn manual_partitioning_page( &language_changed_action, &used_partition_array_refcell, &subvol_partition_array_refcell, + &extra_mount_id_refcell ); } )); @@ -414,6 +418,7 @@ fn create_hardcoded_rows( language_changed_action: &gio::SimpleAction, used_partition_array_refcell: &Rc>>, subvol_partition_array_refcell: &Rc>>, + extra_mount_id_refcell: &Rc>, ) { let drive_mount_add_button_icon = gtk::Image::builder() .icon_name("list-add") @@ -482,6 +487,8 @@ fn create_hardcoded_rows( used_partition_array_refcell, #[strong] subvol_partition_array_refcell, + #[strong] + extra_mount_id_refcell, move |_| { func::create_mount_row( &drive_mounts_adw_listbox, @@ -491,6 +498,7 @@ fn create_hardcoded_rows( &language_changed_action, &used_partition_array_refcell, &subvol_partition_array_refcell, + &extra_mount_id_refcell ); } ));