close menu after action
This commit is contained in:
parent
f0ce975d36
commit
52fc63d9a2
@ -21,7 +21,7 @@ class vmenuManager():
|
|||||||
self.env = environment
|
self.env = environment
|
||||||
self.defaultVMenuPath = fenrirPath+ "/commands/vmenu-profiles/" + self.env['runtime']['inputManager'].getShortcutType()
|
self.defaultVMenuPath = fenrirPath+ "/commands/vmenu-profiles/" + self.env['runtime']['inputManager'].getShortcutType()
|
||||||
self.createMenuTree()
|
self.createMenuTree()
|
||||||
|
self.closeAfterAction = False
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def setCurrMenu(self, currMenu = ''):
|
def setCurrMenu(self, currMenu = ''):
|
||||||
@ -47,11 +47,12 @@ class vmenuManager():
|
|||||||
return self.currMenu
|
return self.currMenu
|
||||||
def getActive(self):
|
def getActive(self):
|
||||||
return self.active
|
return self.active
|
||||||
def togglelVMenuMode(self):
|
def togglelVMenuMode(self, closeAfterAction = True):
|
||||||
self.setActive(not self.getActive())
|
self.setActive(not self.getActive(), closeAfterAction)
|
||||||
def setActive(self, active):
|
def setActive(self, active, closeAfterAction = True):
|
||||||
self.active = active
|
self.active = active
|
||||||
if self.active:
|
if self.active:
|
||||||
|
self.closeAfterAction = closeAfterAction
|
||||||
try:
|
try:
|
||||||
self.createMenuTree()
|
self.createMenuTree()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -98,6 +99,8 @@ class vmenuManager():
|
|||||||
command = self.getValueByPath(self.menuDict, self.currIndex)
|
command = self.getValueByPath(self.menuDict, self.currIndex)
|
||||||
if not command == None:
|
if not command == None:
|
||||||
command.run()
|
command.run()
|
||||||
|
if self.closeAfterAction:
|
||||||
|
self.setActive(False)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
try:
|
try:
|
||||||
self.incLevel()
|
self.incLevel()
|
||||||
|
Loading…
Reference in New Issue
Block a user