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
874 | 874 | self._selectExistingPath(self._path_to_expand) |
875 | 875 | self._path_to_expand = None |
876 | 876 | |
877 | def _selectExistingPath(self, path): | |
877 | def _selectExistingPath(self, model_path): | |
878 | 878 | ''' |
879 | 879 | Select a path that already exists. Expand, scroll, and select. |
880 | 880 | |
881 | @param path: Path to select. | |
881 | @param model_path: Path to select, referring to the unfiltered model. | |
882 | 882 | @type path: tuple |
883 | 883 | ''' |
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: | |
886 | 891 | self.expand_to_path(tree_path) |
887 | self.scroll_to_cell(path) | |
892 | self.scroll_to_cell(filter_path) | |
888 | 893 | selection = self.get_selection() |
889 | selection.select_path(path) | |
894 | selection.select_path(filter_path) | |
890 | 895 | |
891 | 896 | |
892 | 897 | def _onStartPop(self, model): |