diff --git a/system/selections.py b/system/selections.py index b52b930..5127112 100644 --- a/system/selections.py +++ b/system/selections.py @@ -28,6 +28,7 @@ class SelectionTree(gtk.TreeView): self._selections = {} self.set_headers_visible(True) + self._current_dim = None def set_identifier_list(self, identifier_list): self._identifier_list = identifier_list @@ -40,6 +41,7 @@ class SelectionTree(gtk.TreeView): def selection_changed(self, selection): self.update_dims(selection.keys()) + self._update_current_dim() def dataset_changed(self): self.selection_changed(self.project.get_selection()) @@ -54,10 +56,14 @@ class SelectionTree(gtk.TreeView): def on_row_activated(self, treeview, path, column): i = self.store.get_iter(path) p = self.store.iter_parent(i) - dim = self.store.get_value(p, 0) - id_list = self.project.get_selection()[dim] - self._identifier_list.set_identifiers(id_list) + self._current_dim = self.store.get_value(p, 0) + self._update_current_dim() + def _update_current_dim(self): + if not self._current_dim: + return + id_list = self.project.get_selection()[self._current_dim] + self._identifier_list.set_identifiers(id_list) class IdentifierList(gtk.TreeView):