summaryrefslogtreecommitdiff
path: root/kberylsettings/pluginframe.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/pluginframe.py
parent3348c3e49865c5e6a32073e85a6d7a1574cac244 (diff)
downloadkberylsettings-e89937e2cf235c1560bdb3a7add8b3701bd4bfd4.tar.gz
kberylsettings-e89937e2cf235c1560bdb3a7add8b3701bd4bfd4.tar.bz2
Accounted for changes to berylsettings python extension in r2434.
Diffstat (limited to 'kberylsettings/pluginframe.py')
-rw-r--r--kberylsettings/pluginframe.py28
1 files changed, 11 insertions, 17 deletions
diff --git a/kberylsettings/pluginframe.py b/kberylsettings/pluginframe.py
index eb64c54..a93fc4f 100644
--- a/kberylsettings/pluginframe.py
+++ b/kberylsettings/pluginframe.py
@@ -130,11 +130,10 @@ class SearchView(Frame):
index = self.index
parent = self.keywordsList
parent.clear()
- active = self.context.active
for keyword in self.index:
if searchtext in keyword.lower():
plugin, setting = index[keyword][0]
- if plugin.Name in active:
+ if plugin.Enabled:
item = ValueListViewItem(parent, keyword, index[keyword])
def showResults(self, item):
@@ -205,15 +204,13 @@ class BasicPluginView(BasicListView):
@return None
"""
- active = self.context.active
for plugin in self.context.plugins[::-1]:
- self.listItem(plugin, active)
+ self.listItem(plugin)
- def listItem(self, plugin, active):
+ def listItem(self, plugin):
""" create a list view item for a plugin
@param plugin beryl settings Plugin object
- @param active sequence of active plugin names
@return QListViewItem instance
"""
item = None
@@ -224,7 +221,7 @@ class BasicPluginView(BasicListView):
if not item:
item = ViewItem(self, plugin.ShortDesc)
item.plugin = plugin
- item.setVisible(plugin.Name in active)
+ item.setVisible(plugin.Enabled)
item.setPixmap(0, plugin.icon(self.iconSize, self.loader))
return item
@@ -300,13 +297,12 @@ class IconView(BasicPluginView):
self.emit(Signals.selectItem, (item, ))
def showPlugins(self):
- """ sets all active plugin items visible
+ """ sets all enabled plugin items visible
@return None
"""
- active = self.context.active
for item in self:
- if item.plugin and item.plugin.Name in active and not item.setting:
+ if item.plugin and item.plugin.Enabled and not item.setting:
item.setVisible(True)
else:
item.setVisible(False)
@@ -382,15 +378,14 @@ class TreeView(BasicPluginView):
BasicPluginView.__init__(self, parent)
self.setRootIsDecorated(True)
- def listItem(self, plugin, active):
+ def listItem(self, plugin):
""" create an item for the plugin and sub items for its settings
@param plugin beryl settings Plugin object
- @param active sequence of active plugin names
@param size icon size
@return QListViewItem instance with children
"""
- item = BasicPluginView.listItem(self, plugin, active)
+ item = BasicPluginView.listItem(self, plugin)
groups = plugin.settings
keys = groups.keys()
keys.sort()
@@ -484,14 +479,13 @@ class CategoryView(BasicPluginView):
@return None
"""
- active = self.context.active
seen = []
for category in self.context.categories[::-1]:
- plugins = [p for p in category.plugins[::-1] if p.Name in active]
+ plugins = [p for p in category.plugins[::-1] if p.Enabled]
if not category.Name:
## general plugin(s)
for plugin in category.plugins:
- if plugin.Name in active:
+ if plugin.Enabled:
item = self.pluginItem(plugin, self)
seen.append(item)
else:
@@ -499,7 +493,7 @@ class CategoryView(BasicPluginView):
catitem.setVisible(bool(plugins))
seen.append(catitem)
for plugin in plugins:
- if plugin.Name in active:
+ if plugin.Enabled:
item = self.pluginItem(plugin, catitem)
seen.append(item)
for item in self: