From c7e2e09b42b798b878aa6df1f6ebebccb879bb63 Mon Sep 17 00:00:00 2001 From: Paul Culley Date: Tue, 24 Sep 2019 20:39:58 -0500 Subject: [PATCH] Fix 'Go' menu direct object selection, goes to wrong place (#907) Fixes #11341 Fixes up the scrambled 'Go' menu, got messed up in the UIManager upgrade. --- gramps/gui/views/navigationview.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/gramps/gui/views/navigationview.py b/gramps/gui/views/navigationview.py index c04e73104..6560302aa 100644 --- a/gramps/gui/views/navigationview.py +++ b/gramps/gui/views/navigationview.py @@ -434,19 +434,15 @@ class NavigationView(PageView): hobj = self.get_history() menu_len = min(len(items) - 1, MRU_SIZE) - for index in range(0, menu_len): - name, obj = navigation_label(self.dbstate.db, nav_type, - items[index]) - menus += menuitem % (nav_type, index, html.escape(name)) - self.mru_ui = [MRU_TOP + menus + MRU_BTM] - - mitems = items[-MRU_SIZE - 1:-1] # Ignore current handle - mitems.reverse() data = [] - for index, handle in enumerate(mitems): - data.append(('%s%02d'%(nav_type, index), - make_callback(hobj.push, handle), - "%s%d" % (mod_key(), index))) + for index in range(menu_len - 1, -1, -1): + name, _obj = navigation_label(self.dbstate.db, nav_type, + items[index]) + menus += menuitem % (nav_type, index, html.escape(name)) + data.append(('%s%02d' % (nav_type, index), + make_callback(hobj.push, items[index]), + "%s%d" % (mod_key(), menu_len - 1 - index))) + self.mru_ui = [MRU_TOP + menus + MRU_BTM] self.mru_action = ActionGroup(name=self.title + '/MRU') self.mru_action.add_actions(data)