# HG changeset patch # User Goffi # Date 1317302034 -7200 # Node ID 20f11097d99be4e1e49a984db527fc59ed6c51bf # Parent c34fd9d6242edfd33f7ddb597b3ea68a73606e7a memory: general param default value fix diff -r c34fd9d6242e -r 20f11097d99b src/tools/memory.py --- a/src/tools/memory.py Thu Sep 29 14:59:14 2011 +0200 +++ b/src/tools/memory.py Thu Sep 29 15:13:54 2011 +0200 @@ -361,12 +361,13 @@ categories.append(cat.getAttribute("name")) 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""" - profile = self.getProfileName(profile_key) - if not profile: - error(_('Trying to set parameter for an unknown profile')) - return #TODO: throw an error + if profile_key!="@NONE@": + profile = self.getProfileName(profile_key) + if not profile: + error(_('Trying to set parameter for an unknown profile')) + return #TODO: throw an error node = self.__getParamNode(name, category, '@ALL@') if not node: @@ -375,10 +376,13 @@ if node[0] == 'general': 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 assert (node[0] == 'individual') + assert (profile_key != "@NONE@") type = node[1].getAttribute("type") if type=="button":