From 0d8edc91cac469ff498ac02d1dc2ddf60e0a2d42 Mon Sep 17 00:00:00 2001 From: einarr Date: Wed, 30 Aug 2006 13:56:54 +0000 Subject: [PATCH] Identifier lists are now sorted, and there is no active list when a row is selected. --- system/selections.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/system/selections.py b/system/selections.py index 90d4ead..7dabf17 100644 --- a/system/selections.py +++ b/system/selections.py @@ -105,9 +105,9 @@ class SelectionTree(gtk.TreeView): i = self.store.insert_after(d, None, (selection.title, selection)) def _update_current_dim(self): - if not self._current_dim or not self._current_selection: - return - id_list = self._current_selection[self._current_dim] + id_list = [] + if self._current_dim and self._current_selection: + id_list = self._current_selection[self._current_dim] self._identifier_list.set_identifiers(id_list) # Callbacks @@ -120,7 +120,7 @@ class SelectionTree(gtk.TreeView): i = self.store.get_iter(cursor) p = self.store.iter_parent(i) if p == None: - self._current_selection = None + self._current_dim = None else: self._current_dim = self.store.get_value(p, 0) self._current_selection = self.store.get_value(i, 1) @@ -154,6 +154,8 @@ class IdentifierList(gtk.TreeView): def set_identifiers(self, identifiers): "Show the list of identifier strings." self.store.clear() - for e in identifiers: + id_list = list(identifiers) + id_list.sort() + for e in id_list: self.store.append((e,))