summaryrefslogtreecommitdiff
path: root/kberylsettings/beryl.py
diff options
context:
space:
mode:
Diffstat (limited to 'kberylsettings/beryl.py')
-rw-r--r--kberylsettings/beryl.py31
1 files changed, 29 insertions, 2 deletions
diff --git a/kberylsettings/beryl.py b/kberylsettings/beryl.py
index 870f77d..45ccc26 100644
--- a/kberylsettings/beryl.py
+++ b/kberylsettings/beryl.py
@@ -8,7 +8,7 @@ import berylsettings
from os.path import abspath, exists
from kdecore import KIcon
-from kberylsettings.lib import App, Signals, icon
+from kberylsettings.lib import App, Signals, icon, iconLoader
from qt import QImage, QPixmap, QObject
@@ -84,7 +84,7 @@ class Context(QObject):
@return sequence of active plugin names
"""
act = self.general.Setting(self.activePluginsSettingName).Value
- return act + [Plugin.generalName, ]
+ return act # + [Plugin.generalName, ]
def setActive(self, active):
""" sets active plugins
@@ -242,6 +242,11 @@ class Plugin:
pix.convertFromImage(img.smoothScale(size, size, QImage.ScaleMin))
return pix
+ def iconPath(self):
+ name = self.plugin.Name
+ path = abspath(App.basedir + '/pixmaps/beryl-settings-section-%s.png' % name)
+ return path
+
altType = {
'Int' : 'Values',
'Float' : 'Values',
@@ -251,6 +256,22 @@ class Plugin:
'Binding' : 'Bindings',
'List of String' : 'Items',
}
+
+ altLong = {
+ 'Values' : 'Configure numeric values',
+ 'Colors' : 'Choose colors',
+ 'Choices' : 'Turn things on or off',
+ 'Bindings' : 'Connect keyboard, mouse, edges and the system bell',
+ 'Items' : 'Select items from (and into) lists of strings',
+ }
+
+ def settingTypeDesc(self, key):
+ """ lookup a long description for alternate type name
+
+ @param key alternate type name (keys of altType dict)
+ @return string description or key
+ """
+ return self.altLong.get(key, key)
def settings(self):
""" mapping of plugin settings
@@ -363,6 +384,12 @@ class Setting:
name = cls.iconNameMap.get(str(value), cls.iconNameMap['Choices'])
return icon(name, size=size)
icon = classmethod(icon)
+
+ def iconPath(cls, value):
+ name = cls.iconNameMap.get(str(value), cls.iconNameMap['Choices'])
+ ico = iconLoader().iconPath(name, KIcon.NoGroup)
+ return ico
+ iconPath = classmethod(iconPath)
def getValue(self):
""" get value of setting, explicitly silencing errors