Codebase list accerciser / 832680a
Merge branch 'michaelweghorn/treeview_use_correct_path' into 'master' treeview: Use filtered path to select correct entry when navigating to bookmark and "Show applications without children" is inactive. See merge request GNOME/accerciser!17 Samuel Thibault 1 year, 10 months ago
1 changed file(s) with 11 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
874874 self._selectExistingPath(self._path_to_expand)
875875 self._path_to_expand = None
876876
877 def _selectExistingPath(self, path):
877 def _selectExistingPath(self, model_path):
878878 '''
879879 Select a path that already exists. Expand, scroll, and select.
880880
881 @param path: Path to select.
881 @param model_path: Path to select, referring to the unfiltered model.
882882 @type path: tuple
883883 '''
884 tree_path = gtk.TreePath(path[:-1])
885 if len(path) > 1:
884 iter = self.model.get_iter(model_path)
885 (res, filter_iter) = self.filter.convert_child_iter_to_iter(iter)
886 if not res:
887 return
888 filter_path = self.filter.get_path(filter_iter)
889 tree_path = gtk.TreePath(filter_path[:-1])
890 if len(filter_path) > 1:
886891 self.expand_to_path(tree_path)
887 self.scroll_to_cell(path)
892 self.scroll_to_cell(filter_path)
888893 selection = self.get_selection()
889 selection.select_path(path)
894 selection.select_path(filter_path)
890895
891896
892897 def _onStartPop(self, model):