From f0da503a96946b61134c9e8f6a5e39203392f81a Mon Sep 17 00:00:00 2001 From: chrys Date: Mon, 4 Feb 2019 22:49:56 +0100 Subject: [PATCH] fix up more bits --- src/fenrirscreenreader/core/vmenuManager.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/fenrirscreenreader/core/vmenuManager.py b/src/fenrirscreenreader/core/vmenuManager.py index d6abdfb2..036a8f3f 100755 --- a/src/fenrirscreenreader/core/vmenuManager.py +++ b/src/fenrirscreenreader/core/vmenuManager.py @@ -20,6 +20,8 @@ class vmenuManager(): def initialize(self, environment): self.env = environment self.defaultVMenuPath = fenrirPath+ "/commands/vmenu-profiles/" + self.env['runtime']['inputManager'].getShortcutType() + self.createMenuTree() + def shutdown(self): pass def setCurrMenu(self, currMenu = ''): @@ -45,10 +47,15 @@ class vmenuManager(): def setActive(self, active): self.active = active if self.active: - #try: - self.createMenuTree() - #except Exception as e: - # print(e) + try: + self.createMenuTree() + except Exception as e: + print(e) + try: + if self.currMenu != '': + self.setCurrMenu(self.currMenu) + except Exception as e: + print(e) try: self.env['bindings'][str([1, ['KEY_ESC']])] = 'TOGGLE_VMENU_MODE' self.env['bindings'][str([1, ['KEY_UP']])] = 'PREV_VMENU_ENTRY' @@ -61,9 +68,7 @@ class vmenuManager(): print(e) else: try: - self.menuDict = {} self.currIndex = None - self.currMenu = '' del(self.env['bindings'][str([1, ['KEY_ESC']])]) del(self.env['bindings'][str([1, ['KEY_UP']])]) del(self.env['bindings'][str([1, ['KEY_DOWN']])])