From 3e211fd09464fe5b7d7bdd92d7da878ff2c62014 Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Tue, 24 Sep 2024 21:10:10 +0300 Subject: [PATCH] make list reload on edit --- src/bin/gui/apt_manage_page/deb822_edit_dialog.rs | 5 +++++ src/bin/gui/apt_manage_page/mod.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bin/gui/apt_manage_page/deb822_edit_dialog.rs b/src/bin/gui/apt_manage_page/deb822_edit_dialog.rs index 9381b52..79eeeae 100644 --- a/src/bin/gui/apt_manage_page/deb822_edit_dialog.rs +++ b/src/bin/gui/apt_manage_page/deb822_edit_dialog.rs @@ -21,6 +21,7 @@ use std::path::Path; pub fn deb822_edit_dialog_fn( window: adw::ApplicationWindow, deb822_repo: &Deb822Repository, + reload_action: &gio::SimpleAction, ) { let repofile_path = Path::new(&deb822_repo.filepath); let repo_file_name = repofile_path @@ -340,6 +341,8 @@ pub fn deb822_edit_dialog_fn( // let deb822_repo_clone0 = deb822_repo.clone(); + let reload_action_clone0 = reload_action.clone(); + unofficial_source_add_dialog.clone() .choose(None::<&gio::Cancellable>, move |choice| { match choice.as_str() { @@ -391,6 +394,7 @@ pub fn deb822_edit_dialog_fn( apt_src_create_error_dialog.present(); } } + reload_action_clone0.activate(None); } Err(e) => { let apt_src_create_error_dialog = adw::MessageDialog::builder() @@ -402,6 +406,7 @@ pub fn deb822_edit_dialog_fn( &t!("apt_src_create_error_dialog_ok_label").to_string(), ); apt_src_create_error_dialog.present(); + reload_action_clone0.activate(None); } } } diff --git a/src/bin/gui/apt_manage_page/mod.rs b/src/bin/gui/apt_manage_page/mod.rs index ddfb325..edccb5a 100644 --- a/src/bin/gui/apt_manage_page/mod.rs +++ b/src/bin/gui/apt_manage_page/mod.rs @@ -347,7 +347,7 @@ pub fn apt_manage_page( let apt_src: Ref = item.borrow(); match apt_src.deref() { AptSourceConfig::DEB822(src) => { - deb822_edit_dialog::deb822_edit_dialog_fn(window.clone(), src); + deb822_edit_dialog::deb822_edit_dialog_fn(window.clone(), src, &reload_unofficial_action); } AptSourceConfig::Legacy(list) => {} };