From d57f126ed073737767c15daf580cc3b54edaa51b Mon Sep 17 00:00:00 2001 From: Heliguy Date: Fri, 27 Sep 2024 22:40:26 -0400 Subject: [PATCH] snapshots list and properties page will update eachother when data is trashed or restored --- src/host_info.py | 2 ++ src/properties_page/properties_page.py | 2 +- src/snapshot_page/snapshot_box.py | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/host_info.py b/src/host_info.py index ab4d915..72c66d8 100644 --- a/src/host_info.py +++ b/src/host_info.py @@ -44,6 +44,8 @@ class Flatpak: def trash_data(self, callback=None): try: subprocess.run(['gio', 'trash', self.data_path], capture_output=True, text=True, check=True) + snapshot_list_page = HostInfo.main_window.pages[HostInfo.main_window.snapshots_row].list_page + snapshot_list_page.set_snapshots(snapshot_list_page.package_or_folder, True) except subprocess.CalledProcessError as cpe: raise cpe except Exception as e: diff --git a/src/properties_page/properties_page.py b/src/properties_page/properties_page.py index a1e72df..f608f62 100644 --- a/src/properties_page/properties_page.py +++ b/src/properties_page/properties_page.py @@ -159,7 +159,7 @@ class PropertiesPage(Adw.NavigationPage): self.toast_overlay.add_toast(ErrorToast(_("Could not open data"), str(error)).toast) def trash_data_handler(self, *args): - def on_choice(_, response): + def on_choice(dialog, response): if response != 'continue': return try: diff --git a/src/snapshot_page/snapshot_box.py b/src/snapshot_page/snapshot_box.py index ac5bef8..1b980b8 100644 --- a/src/snapshot_page/snapshot_box.py +++ b/src/snapshot_page/snapshot_box.py @@ -117,6 +117,8 @@ class SnapshotBox(Gtk.Box): if self.worker.stop: self.snapshot_page.status_stack.set_visible_child(self.snapshot_page.split_view) self.parent_page.set_snapshots(self.parent_page.package_or_folder, True) + properties_page = HostInfo.main_window.pages[HostInfo.main_window.packages_row].properties_page + properties_page.set_properties(properties_page.package, True) return False # Stop the timeout else: return True # Continue the timeout