From e566c43e553760724ccb23e9a4ce868c69c63a57 Mon Sep 17 00:00:00 2001 From: DrFrasierCrane Date: Mon, 24 Dec 2007 11:37:02 +0100 Subject: [PATCH] Fixed displaying popup menu in the treeview. --- straw/FeedListView.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/straw/FeedListView.py b/straw/FeedListView.py index d68d0e9..79e0df4 100644 --- a/straw/FeedListView.py +++ b/straw/FeedListView.py @@ -117,7 +117,6 @@ class TreeViewNode(object): if path == None: return None else: - ble = self.store.get_iter_from_string(path) return self.store.get_iter_from_string(path) @property @@ -371,15 +370,23 @@ class FeedsView(MVP.WidgetView): path = path[0] self.node_at_popup = self.model.store[path][Column.object] - #selection = treeview.get_selection() - #selection.unselect_all() - #selection.select_path(path) treeview.grab_focus() + + if self.selected_count() < 2: + selection = treeview.get_selection() + selection.unselect_all() + selection.select_path(path) + self.popup.popup(None, None, None, event.button, time) retval = 1 return retval + def selected_count(self): + selection = self._widget.get_selection() + pathlist = selection.get_selected_rows()[1] + return len(pathlist) + def selected(self): selection = self._widget.get_selection() (model, pathlist) = selection.get_selected_rows() -- 2.11.4.GIT