handle binding backup more clean
This commit is contained in:
parent
721bc4a3b7
commit
633b90f1e8
@ -11,7 +11,6 @@ class helpManager():
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.helpDict = {}
|
self.helpDict = {}
|
||||||
self.tutorialListIndex = None
|
self.tutorialListIndex = None
|
||||||
self.bindingsBackup = None
|
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
@ -23,7 +22,6 @@ class helpManager():
|
|||||||
return
|
return
|
||||||
self.env['general']['tutorialMode'] = newTutorialMode
|
self.env['general']['tutorialMode'] = newTutorialMode
|
||||||
if newTutorialMode:
|
if newTutorialMode:
|
||||||
self.bindingsBackup = self.env['bindings'].copy()
|
|
||||||
self.createHelpDict()
|
self.createHelpDict()
|
||||||
self.env['bindings'][str([1, ['KEY_ESC']])] = 'TOGGLE_TUTORIAL_MODE'
|
self.env['bindings'][str([1, ['KEY_ESC']])] = 'TOGGLE_TUTORIAL_MODE'
|
||||||
self.env['bindings'][str([1, ['KEY_UP']])] = 'PREV_HELP'
|
self.env['bindings'][str([1, ['KEY_UP']])] = 'PREV_HELP'
|
||||||
@ -31,8 +29,7 @@ class helpManager():
|
|||||||
self.env['bindings'][str([1, ['KEY_SPACE']])] = 'CURR_HELP'
|
self.env['bindings'][str([1, ['KEY_SPACE']])] = 'CURR_HELP'
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
self.env['bindings'] = self.bindingsBackup.copy()
|
self.env['bindings'] = self.env['runtime']['settingsManager'].getBindingBackup()
|
||||||
self.bindingsBackup = None
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
def isTutorialMode(self):
|
def isTutorialMode(self):
|
||||||
|
@ -39,11 +39,13 @@ class settingsManager():
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.settings = settingsData
|
self.settings = settingsData
|
||||||
self.settingArgDict = {}
|
self.settingArgDict = {}
|
||||||
|
self.bindingsBackup = None
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
|
def getBindingBackup(self):
|
||||||
|
return self.bindingsBackup.copy()
|
||||||
def loadSoundIcons(self, soundIconPath):
|
def loadSoundIcons(self, soundIconPath):
|
||||||
siConfig = open(soundIconPath + '/soundicons.conf',"r")
|
siConfig = open(soundIconPath + '/soundicons.conf',"r")
|
||||||
while(True):
|
while(True):
|
||||||
@ -392,4 +394,6 @@ class settingsManager():
|
|||||||
environment['runtime']['debug'].writeDebugOut(str(environment['settings']._sections) , debug.debugLevel.INFO, onAnyLevel=True)
|
environment['runtime']['debug'].writeDebugOut(str(environment['settings']._sections) , debug.debugLevel.INFO, onAnyLevel=True)
|
||||||
environment['runtime']['debug'].writeDebugOut('\/-------self.settingArgDict-------\/',debug.debugLevel.INFO, onAnyLevel=True)
|
environment['runtime']['debug'].writeDebugOut('\/-------self.settingArgDict-------\/',debug.debugLevel.INFO, onAnyLevel=True)
|
||||||
environment['runtime']['debug'].writeDebugOut(str( self.settingArgDict) ,debug.debugLevel.INFO, onAnyLevel=True)
|
environment['runtime']['debug'].writeDebugOut(str( self.settingArgDict) ,debug.debugLevel.INFO, onAnyLevel=True)
|
||||||
|
self.bindingsBackup = environment['bindings'].copy()
|
||||||
|
|
||||||
return environment
|
return environment
|
||||||
|
@ -21,7 +21,6 @@ class vmenuManager():
|
|||||||
self.useTimeout = True
|
self.useTimeout = True
|
||||||
self.searchText = ''
|
self.searchText = ''
|
||||||
self.lastSearchTime = time.time()
|
self.lastSearchTime = time.time()
|
||||||
self.bindingsBackup = None
|
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
# use default path
|
# use default path
|
||||||
@ -104,7 +103,6 @@ class vmenuManager():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
try:
|
try:
|
||||||
self.bindingsBackup = self.env['bindings'].copy()
|
|
||||||
# navigation
|
# navigation
|
||||||
self.env['bindings'][str([1, ['KEY_ESC']])] = 'TOGGLE_VMENU_MODE'
|
self.env['bindings'][str([1, ['KEY_ESC']])] = 'TOGGLE_VMENU_MODE'
|
||||||
self.env['bindings'][str([1, ['KEY_UP']])] = 'PREV_VMENU_ENTRY'
|
self.env['bindings'][str([1, ['KEY_UP']])] = 'PREV_VMENU_ENTRY'
|
||||||
@ -145,8 +143,7 @@ class vmenuManager():
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
self.currIndex = None
|
self.currIndex = None
|
||||||
self.env['bindings'] = self.bindingsBackup.copy()
|
self.env['bindings'] = self.env['runtime']['settingsManager'].getBindingBackup()
|
||||||
self.bindingsBackup = None
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
def createMenuTree(self):
|
def createMenuTree(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user