From 8e6ed208b87492e0de70500f9e0b24993cd6a821 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Mon, 9 Jul 2012 13:16:21 +0100 Subject: [PATCH] Fixed popup menu problem with Python 3 --- zeroinstall/0launch-gui/preferences.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zeroinstall/0launch-gui/preferences.py b/zeroinstall/0launch-gui/preferences.py index 218d6c1..50314ef 100644 --- a/zeroinstall/0launch-gui/preferences.py +++ b/zeroinstall/0launch-gui/preferences.py @@ -94,7 +94,7 @@ class KeyList: # Remember which ones are open expanded_elements = set() def add_row(tv, path, unused = None): - if len(path) == 1: + if gtk.path_depth(path) == 1: domain = self.trusted_keys[path][0] expanded_elements.add(domain) tv.map_expanded_rows(add_row, None) @@ -141,6 +141,7 @@ class KeyList: key = self.trusted_keys[path][1] domain = self.trusted_keys[gtk.path_parent(path)][0] + global menu # Needed to stop Python 3 GCing the menu and closing it instantly menu = gtk.Menu() item = gtk.MenuItem(_('Remove key for "%s"') % key.get_short_name()) -- 2.11.4.GIT