summaryrefslogtreecommitdiff
path: root/kberylsettings/beryl.py
diff options
context:
space:
mode:
authornatural <natural>2007-01-01 05:36:07 +0000
committernatural <natural>2007-01-01 05:36:07 +0000
commit8100c625e1a8d63b3fc434d08dbffb5652a59e69 (patch)
tree2a35cfbd1051fb10b0d05aba4ed88421701d2cfb /kberylsettings/beryl.py
parentdd5381035a8a341b87d3836ea3e454eb999e9223 (diff)
downloadkberylsettings-8100c625e1a8d63b3fc434d08dbffb5652a59e69.tar.gz
kberylsettings-8100c625e1a8d63b3fc434d08dbffb5652a59e69.tar.bz2
Added tip of the day dialog, application key configuration dialog.
Removed basedir references in preference to KStandardDirs configuration. Moved about.py to aboutapp.py. Other small fixes and enhancements.
Diffstat (limited to 'kberylsettings/beryl.py')
-rw-r--r--kberylsettings/beryl.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/kberylsettings/beryl.py b/kberylsettings/beryl.py
index 45ccc26..7268887 100644
--- a/kberylsettings/beryl.py
+++ b/kberylsettings/beryl.py
@@ -5,10 +5,8 @@
"""
import berylsettings
-from os.path import abspath, exists
-
-from kdecore import KIcon
-from kberylsettings.lib import App, Signals, icon, iconLoader
+from kdecore import KIcon, locate
+from kberylsettings.lib import Signals, icon, iconLoader
from qt import QImage, QPixmap, QObject
@@ -84,7 +82,7 @@ class Context(QObject):
@return sequence of active plugin names
"""
act = self.general.Setting(self.activePluginsSettingName).Value
- return act # + [Plugin.generalName, ]
+ return act
def setActive(self, active):
""" sets active plugins
@@ -227,14 +225,12 @@ class Plugin:
@param loader KIconLoader instance
@return icon instance
"""
- if App.debug:
- return loader.loadIcon('empty', KIcon.NoGroup, size)
name = self.plugin.Name
try:
pix = self.iconCache[(name, size)]
except (KeyError, ):
- path = abspath(App.basedir + '/pixmaps/beryl-settings-section-%s.svg' % name)
- if not exists(path):
+ path = locate('icon', 'beryl-settings-section-%s.svg' % name)
+ if not path:
path = 'unknown'
ico = loader.loadIcon(path, KIcon.NoGroup)
img = ico.convertToImage()
@@ -243,9 +239,12 @@ class Plugin:
return pix
def iconPath(self):
+ """ path to icon for this plugin
+
+ @return icon path
+ """
name = self.plugin.Name
- path = abspath(App.basedir + '/pixmaps/beryl-settings-section-%s.png' % name)
- return path
+ return locate('icon', 'beryl-settings-section-%s.png' % name)
altType = {
'Int' : 'Values',
@@ -375,7 +374,7 @@ class Setting:
self.setting.Value = value
def icon(cls, value, size):
- """ icon for this plugin
+ """ icon for setting type
@param value setting type name
@param size KIcon size
@@ -386,6 +385,11 @@ class Setting:
icon = classmethod(icon)
def iconPath(cls, value):
+ """ path to icon for setting type
+
+ @param value setting type name
+ @return icon path
+ """
name = cls.iconNameMap.get(str(value), cls.iconNameMap['Choices'])
ico = iconLoader().iconPath(name, KIcon.NoGroup)
return ico