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,))