summaryrefslogtreecommitdiff
path: root/kberylsettings/pluginframe.py
diff options
context:
space:
mode:
authornatural <natural>2006-12-31 06:16:43 +0000
committernatural <natural>2006-12-31 06:16:43 +0000
commit0aa170e67595b83e49e72d78f41c27a48d3059ad (patch)
treec53db324e8a6b068846d55bdc163afbb634bd1df /kberylsettings/pluginframe.py
parentb3bd6e4163a79f03edf2c2c6935b530d2af21e14 (diff)
downloadkberylsettings-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/pluginframe.py')
-rw-r--r--kberylsettings/pluginframe.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/kberylsettings/pluginframe.py b/kberylsettings/pluginframe.py
index 5a0095d..bc48399 100644
--- a/kberylsettings/pluginframe.py
+++ b/kberylsettings/pluginframe.py
@@ -168,7 +168,7 @@ class SearchView(Frame):
"""
plugin, setting = item.value
if setting is None:
- self.emit(Signals.showAbout, (plugin, ))
+ self.emit(Signals.showAbout, (self.context, plugin, ))
else:
self.emit(Signals.showSettings, (plugin, Setting(setting), ))
@@ -182,17 +182,24 @@ class BasicPluginView(BasicListView):
self.loader = iconLoader()
self.connect(self, Signals.itemClicked, self.onItemClick)
- def selectPluginItem(self, plugin, setting):
+ def selectPluginItem(self, plugin, setting, activate=False):
""" locate and set current item given plugin and setting
@param plugin beryl settings Plugin object
@param setting any object
@return None
"""
- match = (plugin, setting)
+ def match(a, b):
+ try:
+ return a.value[0].Name == b[0].Name and a.value[1] == b[1]
+ except:
+ pass
+ other = (plugin, setting)
for item in self:
- if item.value == match:
+ if match(item, other):
self.setCurrentEnsureVisible(item)
+ if activate:
+ self.onItemClick(item)
break
def addItems(self):
@@ -290,7 +297,7 @@ class IconView(BasicPluginView):
plugin, setting = item.value
if plugin and not setting:
self.showSettingItems(plugin)
- self.emit(Signals.showAbout, (plugin, ))
+ self.emit(Signals.showAbout, (self.context, plugin, ))
elif item == self.firstChild():
self.showPlugins()
else:
@@ -418,7 +425,7 @@ class TreeView(BasicPluginView):
if plugin and setting:
self.emit(Signals.showSettings, (plugin, setting))
else:
- self.emit(Signals.showAbout, (plugin, ))
+ self.emit(Signals.showAbout, (self.context, plugin, ))
self.emit(Signals.selectItem, (item, ))
def otherSelected(self, other):