snapshots list and properties page will update eachother when data is trashed or restored

This commit is contained in:
Heliguy
2024-09-27 22:40:26 -04:00
parent 1be2a7e7a7
commit d57f126ed0
3 changed files with 5 additions and 1 deletions

View File

@@ -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:

View File

@@ -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:

View File

@@ -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