Add optional resetIndex parameter
This commit is contained in:
parent
fe7152c0d9
commit
6ab98189ff
@ -146,11 +146,20 @@ class vmenuManager():
|
|||||||
self.env['bindings'] = self.env['runtime']['settingsManager'].getBindingBackup()
|
self.env['bindings'] = self.env['runtime']['settingsManager'].getBindingBackup()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
def createMenuTree(self):
|
def createMenuTree(self, resetIndex = True):
|
||||||
self.currIndex = None
|
if resetIndex:
|
||||||
|
self.currIndex = None
|
||||||
menu = self.fs_tree_to_dict( self.defaultVMenuPath)
|
menu = self.fs_tree_to_dict( self.defaultVMenuPath)
|
||||||
if menu:
|
if menu:
|
||||||
self.menuDict = menu
|
self.menuDict = menu
|
||||||
|
# index still valid?
|
||||||
|
if self.currIndex != None:
|
||||||
|
try:
|
||||||
|
r = self.getValueByPath(self.menuDict, self.currIndex)
|
||||||
|
if r == {}:
|
||||||
|
self.currIndex = None
|
||||||
|
except:
|
||||||
|
self.currIndex = None
|
||||||
def executeMenu(self):
|
def executeMenu(self):
|
||||||
if self.currIndex == None:
|
if self.currIndex == None:
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user