Fix bug in Browse tab

This commit is contained in:
Sumner Evans
2020-01-14 21:57:25 -07:00
parent 48a2d17773
commit f13fa708bb

View File

@@ -61,10 +61,11 @@ class DirectoryListAndDrilldown(Gtk.Paned):
self.pack2(self.listing_drilldown_panel, True, False) self.pack2(self.listing_drilldown_panel, True, False)
def update(self, state: ApplicationState, force=False): def update(self, state: ApplicationState, force=False):
if self.is_root: self.directory_listing.update(
self.directory_listing.update_root(state=state, force=force) state=state,
else: force=force,
self.directory_listing.update_not_root(state=state, force=force) is_root=self.is_root,
)
class DirectoryList(Gtk.Box): class DirectoryList(Gtk.Box):
@@ -117,6 +118,18 @@ class DirectoryList(Gtk.Box):
self.pack_start(list_scroll_window, True, True, 0) self.pack_start(list_scroll_window, True, True, 0)
def update(
self,
state: ApplicationState = None,
force=False,
is_root=False,
):
self.is_root = is_root
if self.is_root:
self.update_root(state=state, force=force)
else:
self.update_not_root(state=state, force=force)
def update_store(self, elements): def update_store(self, elements):
new_store = [] new_store = []
selected_idx = None selected_idx = None
@@ -124,8 +137,7 @@ class DirectoryList(Gtk.Box):
# if state and state.selected_artist_id == el.id: # if state and state.selected_artist_id == el.id:
# selected_idx = i # selected_idx = i
new_store.append( new_store.append(DirectoryList.SubelementModel(el.id, el.name))
DirectoryList.SubelementModel(el.id, el.name))
util.diff_model_store(self.directory_list_store, new_store) util.diff_model_store(self.directory_list_store, new_store)