SàT: multi-profile: DBus signals and frontend adaptation (first draft)

- Quick App: new single_profile parameter in __init__ (default: yes), used to tell if the application use only one profile at the time or not
- Quick App: new __check_profile method, tell if the profile is used by the current frontend
- Quick App: new methods plug_profile, unplug_profile and clear_profile, must be called by the frontend to tell which profiles to use
- DBus Bridge: new methods getProfileName, getProfilesList and createProfile
This commit is contained in:
Goffi 2010-02-03 23:35:57 +11:00
commit ca242c7aee

View file

@ -117,7 +117,7 @@ class Param():
def getProfilesList(self):
return self.params.keys()
def createProfile(self, name, default=False):
def createProfile(self, name):
"""Create a new profile
@param name: Name of the profile
@param default: True if default value"""
@ -135,12 +135,12 @@ class Param():
@return: requested profile name or None if it doesn't exist"""
if profile_key=='@DEFAULT@':
if not self.params:
return None
return ""
info('No default profile, returning first one') #TODO: manage real default profile
return self.params.keys()[0] #FIXME: gof: temporary, must use real default value, and fallback to first one if it doesn't exists
if not self.params.has_key(profile_key):
error ('Trying to access an unknown profile')
return None
return ""
return profile_key
def __get_unique_node(self, parent, tag, name):
@ -354,7 +354,7 @@ class Param():
print "clique",node.toxml()
else:
self.params[profile][(category, name)] = value
self.host.bridge.paramUpdate(name, value, category) #TODO: add profile in signal
self.host.bridge.paramUpdate(name, value, category, profile) #TODO: add profile in signal
class Memory:
"""This class manage all persistent informations"""
@ -605,8 +605,8 @@ class Memory:
def getParams(self):
return self.params.getParams()
def getParamsForCategory(self, category):
return self.params.getParamsForCategory(category)
def getParamsForCategory(self, category, profile_key='@DEFAULT@'):
return self.params.getParamsForCategory(category, profile_key)
def getParamsCategories(self):
return self.params.getParamsCategories()