From d0a310a31ae894c32c3b672da9ca137ab79a9006 Mon Sep 17 00:00:00 2001 From: chrys Date: Mon, 4 Feb 2019 22:32:48 +0100 Subject: [PATCH] more fix --- src/fenrirscreenreader/core/vmenuManager.py | 23 ++++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/fenrirscreenreader/core/vmenuManager.py b/src/fenrirscreenreader/core/vmenuManager.py index e088a0cd..63699032 100755 --- a/src/fenrirscreenreader/core/vmenuManager.py +++ b/src/fenrirscreenreader/core/vmenuManager.py @@ -23,14 +23,18 @@ class vmenuManager(): def shutdown(self): pass def setCurrMenu(self, currMenu = ''): - try: - t = self.menuDict[currMenu] - l = list(menuDict.keys()) - self.currIndex = [l.index(currMenu)] - self.currMenu = currMenu - except: + if currMenu == '': self.currIndex = None self.currMenu = '' + else: + try: + t = self.menuDict[currMenu] + l = list(menuDict.keys()) + except: + return + + self.currIndex = [l.index(currMenu)] + self.currMenu = currMenu def getCurrMenu(self): return self.currMenu def getActive(self): @@ -100,8 +104,11 @@ class vmenuManager(): def decLevel(self): if self.currIndex == None: return - if len(self.currIndex) == 1: - return + if self.currMenu != '': + if len(self.currIndex) == 2: + return + elif len(self.currIndex) == 1: + return self.currIndex = self.currIndex[:len(self.currIndex) - 1] print(self.currIndex) def nextIndex(self):