memory: general param default value fix
This commit is contained in:
parent
c64b06921b
commit
19fac3cd7a
1 changed files with 10 additions and 6 deletions
|
|
@ -361,12 +361,13 @@ class Param():
|
||||||
categories.append(cat.getAttribute("name"))
|
categories.append(cat.getAttribute("name"))
|
||||||
return categories
|
return categories
|
||||||
|
|
||||||
def setParam(self, name, value, category, profile_key):
|
def setParam(self, name, value, category, profile_key='@NONE@'):
|
||||||
"""Set a parameter, return None if the parameter is not in param xml"""
|
"""Set a parameter, return None if the parameter is not in param xml"""
|
||||||
profile = self.getProfileName(profile_key)
|
if profile_key!="@NONE@":
|
||||||
if not profile:
|
profile = self.getProfileName(profile_key)
|
||||||
error(_('Trying to set parameter for an unknown profile'))
|
if not profile:
|
||||||
return #TODO: throw an error
|
error(_('Trying to set parameter for an unknown profile'))
|
||||||
|
return #TODO: throw an error
|
||||||
|
|
||||||
node = self.__getParamNode(name, category, '@ALL@')
|
node = self.__getParamNode(name, category, '@ALL@')
|
||||||
if not node:
|
if not node:
|
||||||
|
|
@ -375,10 +376,13 @@ class Param():
|
||||||
|
|
||||||
if node[0] == 'general':
|
if node[0] == 'general':
|
||||||
self.params_gen[(category, name)] = value
|
self.params_gen[(category, name)] = value
|
||||||
self.host.bridge.paramUpdate(name, value, category, profile) #TODO: add profile in signal
|
for profile in self.getProfilesList():
|
||||||
|
if self.host.isConnected(profile):
|
||||||
|
self.host.bridge.paramUpdate(name, value, category, profile)
|
||||||
return
|
return
|
||||||
|
|
||||||
assert (node[0] == 'individual')
|
assert (node[0] == 'individual')
|
||||||
|
assert (profile_key != "@NONE@")
|
||||||
|
|
||||||
type = node[1].getAttribute("type")
|
type = node[1].getAttribute("type")
|
||||||
if type=="button":
|
if type=="button":
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue