diff options
author | natural <natural> | 2006-12-31 06:16:43 +0000 |
---|---|---|
committer | natural <natural> | 2006-12-31 06:16:43 +0000 |
commit | 0aa170e67595b83e49e72d78f41c27a48d3059ad (patch) | |
tree | c53db324e8a6b068846d55bdc163afbb634bd1df /kberylsettings/beryl.py | |
parent | b3bd6e4163a79f03edf2c2c6935b530d2af21e14 (diff) | |
download | kberylsettings-0aa170e67595b83e49e72d78f41c27a48d3059ad.tar.gz kberylsettings-0aa170e67595b83e49e72d78f41c27a48d3059ad.tar.bz2 |
Support for a nifty "about beryl" and "about plugin" page. Again,
kcontrol is the example.
Adding png versions of each svg; KHTML won't display svg icons. Also
including a script to convert from svg to png.
Diffstat (limited to 'kberylsettings/beryl.py')
-rw-r--r-- | kberylsettings/beryl.py | 31 |
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 |