summaryrefslogtreecommitdiff
path: root/kberylsettings/beryl.py
diff options
context:
space:
mode:
authornatural <natural>2007-01-07 06:00:34 +0000
committernatural <natural>2007-01-07 06:00:34 +0000
commite89937e2cf235c1560bdb3a7add8b3701bd4bfd4 (patch)
tree5b8c46e976b0296719b6134361664791e34ed476 /kberylsettings/beryl.py
parent3348c3e49865c5e6a32073e85a6d7a1574cac244 (diff)
downloadkberylsettings-e89937e2cf235c1560bdb3a7add8b3701bd4bfd4.tar.gz
kberylsettings-e89937e2cf235c1560bdb3a7add8b3701bd4bfd4.tar.bz2
Accounted for changes to berylsettings python extension in r2434.
Diffstat (limited to 'kberylsettings/beryl.py')
-rw-r--r--kberylsettings/beryl.py43
1 files changed, 19 insertions, 24 deletions
diff --git a/kberylsettings/beryl.py b/kberylsettings/beryl.py
index 7268887..828465c 100644
--- a/kberylsettings/beryl.py
+++ b/kberylsettings/beryl.py
@@ -16,7 +16,6 @@ class Context(QObject):
This class inherits QObject so that instances can emit Qt signals.
"""
- activePluginsSettingName = 'active_plugins'
def __init__(self, context=None):
QObject.__init__(self)
@@ -38,7 +37,7 @@ class Context(QObject):
args = (self.__module__, self.__class__.__name__, hex(abs(id(self))))
return "<%s.%s instance at %s>" % args
__str__ = __repr__
-
+
def getCategories(self):
""" sorted categories sequence
@@ -76,23 +75,6 @@ class Context(QObject):
else:
return list(self.plugins)[value]
- def getActive(self):
- """ sequence of active plugin names
-
- @return sequence of active plugin names
- """
- act = self.general.Setting(self.activePluginsSettingName).Value
- return act
-
- def setActive(self, active):
- """ sets active plugins
-
- @param active sequence of plugin names to set as active
- @return None
- """
- self.general.Setting(self.activePluginsSettingName).Value = active
- active = property(getActive, setActive)
-
def getGeneral(self):
""" general plugin instance
@@ -119,7 +101,7 @@ class Context(QObject):
self.emit(Signals.statusMessage, ('Beryl settings reloaded.', ))
-class Category:
+class Category(object):
""" Category -> wraps berylsetting.Category instances with extra
methods and properties.
@@ -162,7 +144,7 @@ class Category:
def plugins(self):
""" sequence of plugin instances in this category
- @return sequence of active plugin names
+ @return sequence of Plugin instances
"""
seq = [Plugin(p) for p in self.category.Plugins]
seq.sort()
@@ -170,7 +152,7 @@ class Category:
plugins = property(plugins)
-class Plugin:
+class Plugin(object):
""" Plugin -> wraps berylsetting.Plugin instances with extra
methods and properties.
@@ -210,6 +192,19 @@ class Plugin:
hex(abs(id(self))))
return "<%s.%s instance name='%s' at %s>" % args
__str__ = __repr__
+
+ def getEnabled(self):
+ """ true if this plugin is enabled
+
+ """
+ return self.plugin.Enabled
+
+ def setEnabled(self, value):
+ """ set the enabled flag for this plugin
+
+ """
+ self.plugin.Enabled = value
+ enabled = property(getEnabled, setEnabled)
def isGeneral(self):
""" true if this plugin is a general plugin
@@ -294,7 +289,7 @@ class Plugin:
groups = property(groups)
-class Group:
+class Group(object):
""" Group -> wraps berylsetting.Group instances with extra
methods and properties.
@@ -331,7 +326,7 @@ class Group:
return [Setting(s) for s in plugin.Settings if s.Group==group]
-class Setting:
+class Setting(object):
""" Setting -> wraps berylsetting.Setting instances with extra
methods and properties.