mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-14 00:04:08 +09:00
Fix snapshots page not updating upon snapshot trashing
This commit is contained in:
@@ -122,14 +122,14 @@ class SnapshotPage(Adw.BreakpointBin):
|
||||
else:
|
||||
self.leftover_box.set_visible(False)
|
||||
|
||||
def active_select_handler(self, listbox, row, should_show_content=True):
|
||||
def active_select_handler(self, listbox, row, should_show_content=True, refresh=False):
|
||||
self.leftover_listbox.select_row(None)
|
||||
self.list_page.set_snapshots(row.package.info["id"], row.package.info["name"])
|
||||
self.list_page.set_snapshots(row.package.info["id"], row.package.info["name"], refresh)
|
||||
self.split_view.set_show_content(should_show_content)
|
||||
|
||||
def leftover_select_handler(self, listbox, row, should_show_content=True):
|
||||
def leftover_select_handler(self, listbox, row, should_show_content=True, refresh=False):
|
||||
self.active_listbox.select_row(None)
|
||||
self.list_page.set_snapshots(row.folder, row.name)
|
||||
self.list_page.set_snapshots(row.folder, row.name, refresh)
|
||||
self.split_view.set_show_content(should_show_content)
|
||||
|
||||
def start_loading(self):
|
||||
@@ -142,10 +142,10 @@ class SnapshotPage(Adw.BreakpointBin):
|
||||
def select_first_row(self):
|
||||
if row := self.active_listbox.get_row_at_index(0):
|
||||
self.active_listbox.select_row(row)
|
||||
self.active_select_handler(None, row, False)
|
||||
self.active_select_handler(None, row, False, True)
|
||||
elif row := self.leftover_listbox.get_row_at_index(0):
|
||||
self.leftover_listbox.select_row(row)
|
||||
self.leftover_select_handler(None, row, False)
|
||||
self.leftover_select_handler(None, row, False, True)
|
||||
|
||||
def end_loading(self):
|
||||
def callback(*args):
|
||||
|
||||
@@ -5,7 +5,6 @@ from .snapshot_box import SnapshotBox
|
||||
from .loading_status import LoadingStatus
|
||||
import os
|
||||
|
||||
|
||||
@Gtk.Template(resource_path="/io/github/flattool/Warehouse/snapshot_page/snapshots_list_page.ui")
|
||||
class SnapshotsListPage(Adw.NavigationPage):
|
||||
__gtype_name__ = "SnapshotsListPage"
|
||||
@@ -29,8 +28,8 @@ class SnapshotsListPage(Adw.NavigationPage):
|
||||
self.listbox.append(row)
|
||||
self.listbox.get_row_at_index(i).set_activatable(False)
|
||||
|
||||
def set_snapshots(self, folder, title):
|
||||
if self.current_folder == folder:
|
||||
def set_snapshots(self, folder, title, refresh=False):
|
||||
if self.current_folder == folder and not refresh:
|
||||
return
|
||||
|
||||
self.current_folder = folder
|
||||
|
||||
Reference in New Issue
Block a user