finish quick menu

This commit is contained in:
chrys 2019-02-14 00:12:29 +01:00
parent 4178c37b72
commit 93b5498e04
3 changed files with 11 additions and 16 deletions

View File

@ -21,5 +21,3 @@ class command():
self.env['runtime']['outputManager'].presentText(value, interrupt=True)
def setCallback(self, callback):
pass
def setCallback(self, callback):
pass

View File

@ -16,11 +16,8 @@ class command():
def getDescription(self):
return _('get next quick menu value')
def run(self):
try:
if self.env['runtime']['quickMenuManager'].nextValue():
value = self.env['runtime']['quickMenuManager'].getCurrentValue()
self.env['runtime']['outputManager'].presentText(value, interrupt=True)
except Exception as e:
print(e)
if self.env['runtime']['quickMenuManager'].nextValue():
value = self.env['runtime']['quickMenuManager'].getCurrentValue()
self.env['runtime']['outputManager'].presentText(value, interrupt=True)
def setCallback(self, callback):
pass

View File

@ -67,18 +67,18 @@ class quickMenuManager():
if not valueString in ['True','False']:
return False
value = not value
self.env['runtime']['settingsManager'].setSettingAsBool(section, setting, value)
self.env['runtime']['settingsManager'].setSetting(section, setting, str(value))
elif isinstance(self.settings[section][setting], int):
value = int(valueString)
value += 1
self.env['runtime']['settingsManager'].setSettingAsInt(section, setting, value)
self.env['runtime']['settingsManager'].setSetting(section, setting, str(value))
elif isinstance(self.settings[section][setting], float):
value = float(valueString)
value += 0.05
if value > 1.0:
value = 1.0
self.env['runtime']['settingsManager'].setSettingAsFloat(section, setting, value)
except:
self.env['runtime']['settingsManager'].setSetting(section, setting, str(value))
except Exception as e:
return False
return True
def prevValue(self):
@ -99,20 +99,20 @@ class quickMenuManager():
if not valueString in ['True','False']:
return False
value = not value
self.env['runtime']['settingsManager'].setSettingAsBool(section, setting, value)
self.env['runtime']['settingsManager'].setSetting(section, setting, str(value))
elif isinstance(self.settings[section][setting], int):
value = int(valueString)
value -= 1
if value < 0:
value = 0
self.env['runtime']['settingsManager'].setSettingAsInt(section, setting, value)
self.env['runtime']['settingsManager'].setSetting(section, setting, str(value))
elif isinstance(self.settings[section][setting], float):
value = float(valueString)
value -= 0.05
if value < 0.0:
value = 0.0
self.env['runtime']['settingsManager'].setSettingAsFloat(section, setting, value)
except:
self.env['runtime']['settingsManager'].setSetting(section, setting, str(value))
except Exception as e:
return False
return True
def getCurrentEntry(self):