summaryrefslogtreecommitdiff
path: root/kberylsettings/plugindialog.py
diff options
context:
space:
mode:
authornatural <natural>2006-12-28 13:30:24 +0000
committernatural <natural>2006-12-28 13:30:24 +0000
commit6353813802ba776b05241f07cb8fee9c90310c40 (patch)
treebbdb3641c28de20c9c6164748436d7411be468ff /kberylsettings/plugindialog.py
parentc8ad4394c474f9f6854904f377ab28a38172b867 (diff)
downloadkberylsettings-6353813802ba776b05241f07cb8fee9c90310c40.tar.gz
kberylsettings-6353813802ba776b05241f07cb8fee9c90310c40.tar.bz2
Support for plugin categories.
Fixed scroll view layouts. Many other bug fixes and enhancements.
Diffstat (limited to 'kberylsettings/plugindialog.py')
-rw-r--r--kberylsettings/plugindialog.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/kberylsettings/plugindialog.py b/kberylsettings/plugindialog.py
index 578d2d8..9a35164 100644
--- a/kberylsettings/plugindialog.py
+++ b/kberylsettings/plugindialog.py
@@ -10,31 +10,31 @@ from kdeui import KDialogBase, KListView, KMessageBox
from qt import QCheckListItem, QLabel
from kberylsettings.lib import Signals, iconLoader
+from kberylsettings.widget import ListView
-
-class PluginList(KListView):
+class PluginList(ListView):
""" PluginList -> list view for the select plugins dialog
"""
def __init__(self, parent):
- KListView.__init__(self, parent)
+ ListView.__init__(self, parent)
self.addColumn(i18n('Plugin'))
self.addColumn(i18n('Categories'))
self.addColumn(i18n('Description'))
-
- def addPlugins(self, context):
+ self.setSorting(self.columns()+1)
+
+ def addPlugins(self, context, stateMap):
""" creates list view items from plugins in context
@param context berylsetting Context instance
@return mapping of plugin names and their enabled state
"""
- stateMap = {}
active = context.active
count = textlen = 0
loader = iconLoader()
cats = context.categories
- for p in context.plugins:
+ for p in context.plugins[::-1]:
item = QCheckListItem(self, p.ShortDesc, QCheckListItem.CheckBox)
item.setEnabled(not p.isGeneral)
cnames = str.join(',', [c.ShortDesc for c in cats if p in c.Plugins])
@@ -69,7 +69,7 @@ class PluginDialog(KDialogBase):
""" PluginDialog -> a dialog for enabling and disabling plugins
"""
- def __init__(self, parent, context):
+ def __init__(self, parent, context, mapping):
KDialogBase.__init__(self, parent, '', True, i18n('Select Plugins'),
KDialogBase.Ok|KDialogBase.Cancel)
self.context = context
@@ -77,7 +77,7 @@ class PluginDialog(KDialogBase):
self.label = QLabel('Enable or disable plugins below.', main)
self.listView = PluginList(main)
self.connect(self.listView, Signals.itemClicked, self.changePlugin)
- self.pluginMap = self.listView.addPlugins(context)
+ self.pluginMap = self.listView.addPlugins(context, mapping)
def changePlugin(self, item):
""" handle a possible change to the plugins checkbox