From 06905934dbf3ed667699c687a4d4218bd8f45cb6 Mon Sep 17 00:00:00 2001 From: einarr Date: Wed, 9 Aug 2006 14:35:42 +0000 Subject: [PATCH] Fixed update bug. The list of currently selected elements is now automatically updated from selection_changed(). --- system/selections.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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):