Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

Fixed update bug. The list of currently selected elements is now automatically updated from selection_changed().

This commit is contained in:
Einar Ryeng 2006-08-09 14:35:42 +00:00
parent 2e2fa85727
commit 06905934db
1 changed files with 9 additions and 3 deletions

View File

@ -28,6 +28,7 @@ class SelectionTree(gtk.TreeView):
self._selections = {} self._selections = {}
self.set_headers_visible(True) self.set_headers_visible(True)
self._current_dim = None
def set_identifier_list(self, identifier_list): def set_identifier_list(self, identifier_list):
self._identifier_list = identifier_list self._identifier_list = identifier_list
@ -40,6 +41,7 @@ class SelectionTree(gtk.TreeView):
def selection_changed(self, selection): def selection_changed(self, selection):
self.update_dims(selection.keys()) self.update_dims(selection.keys())
self._update_current_dim()
def dataset_changed(self): def dataset_changed(self):
self.selection_changed(self.project.get_selection()) self.selection_changed(self.project.get_selection())
@ -54,10 +56,14 @@ class SelectionTree(gtk.TreeView):
def on_row_activated(self, treeview, path, column): def on_row_activated(self, treeview, path, column):
i = self.store.get_iter(path) i = self.store.get_iter(path)
p = self.store.iter_parent(i) p = self.store.iter_parent(i)
dim = self.store.get_value(p, 0) self._current_dim = self.store.get_value(p, 0)
id_list = self.project.get_selection()[dim] self._update_current_dim()
self._identifier_list.set_identifiers(id_list)
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): class IdentifierList(gtk.TreeView):