mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-14 00:04:08 +09:00
snapshots list and properties page will update eachother when data is trashed or restored
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user