From 1747bd98940ee02095fed58176709b41c4108839 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 24 Aug 2008 05:53:56 +0000 Subject: [PATCH] Prevent selecting filter view category labels --- deluge/ui/gtkui/filtertreeview.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/deluge/ui/gtkui/filtertreeview.py b/deluge/ui/gtkui/filtertreeview.py index 89b48a849..657198c0c 100644 --- a/deluge/ui/gtkui/filtertreeview.py +++ b/deluge/ui/gtkui/filtertreeview.py @@ -202,7 +202,25 @@ class FilterTreeView(component.Component): """This is a callback for showing the right-click context menu. NOT YET! """ + x, y = event.get_coords() + path = self.label_view.get_path_at_pos(int(x), int(y)) + if not path: + return + path = path[0] + cat = self.model_filter[path][0] + + if event.button == 1: + # Prevent selecting a category label + if cat == "cat": + return True + + elif event.button == 3: + if cat == "cat": + # XXX: Show the pop-up menu + # Do not select the row + return True """ + # We only care about right-clicks if event.button == 3: x, y = event.get_coords()