summaryrefslogtreecommitdiff
path: root/kberylsettings
diff options
context:
space:
mode:
authornatural <natural>2006-12-25 01:45:59 +0000
committernatural <natural>2006-12-25 01:45:59 +0000
commitc8ad4394c474f9f6854904f377ab28a38172b867 (patch)
treea21e740fc8025ba86b9a0006317c58ef316cea46 /kberylsettings
parentefa1df0939d879cf18e0cf9fa342aaf86d3e9ea1 (diff)
downloadkberylsettings-c8ad4394c474f9f6854904f377ab28a38172b867.tar.gz
kberylsettings-c8ad4394c474f9f6854904f377ab28a38172b867.tar.bz2
Added (copies of) missing beryl-settings icon svgs.
Added catetories column to plugin dialog. Added bell binding to setting widgets. Finally enabled binding setting value() functions -- now saves!
Diffstat (limited to 'kberylsettings')
-rw-r--r--kberylsettings/beryl.py13
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-png.svg426
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-snow.svg73
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-svg.svg162
-rw-r--r--kberylsettings/plugindialog.py7
-rw-r--r--kberylsettings/pluginframe.py6
-rw-r--r--kberylsettings/settingwidget.py116
7 files changed, 769 insertions, 34 deletions
diff --git a/kberylsettings/beryl.py b/kberylsettings/beryl.py
index f26c32f..2594361 100644
--- a/kberylsettings/beryl.py
+++ b/kberylsettings/beryl.py
@@ -27,6 +27,11 @@ class Context(QObject):
context.Read()
self.context = context
+ def getCategories(self):
+ return self.context.Categories
+ categories = property(getCategories)
+
+
def getPlugins(self):
""" sorted plugin sequence
@@ -35,7 +40,6 @@ class Context(QObject):
seq = [Plugin(p) for p in self.context.Plugins]
seq.sort(reverse=True)
return iter(seq)
-
plugins = property(getPlugins)
def plugin(self, value):
@@ -70,7 +74,6 @@ class Context(QObject):
@return None
"""
self.general.Setting(self.activePluginsSettingName).Value = active
-
active = property(getActive, setActive)
def getGeneral(self):
@@ -79,7 +82,6 @@ class Context(QObject):
@return Plugin wrapper instance
"""
return Plugin(self.context.Plugin(Plugin.generalName))
-
general = property(getGeneral)
def write(self):
@@ -113,8 +115,9 @@ class Plugin:
def __cmp__(self, other):
if self.isGeneral:
return -1
- return cmp(self.plugin.ShortDesc,
- getattr(other.plugin, 'ShortDesc', None))
+ if not isinstance(other, Plugin):
+ other = Plugin(other)
+ return cmp(self.plugin.ShortDesc, other.plugin.ShortDesc)
def isGeneral(self):
return self.plugin.Name == self.generalName
diff --git a/kberylsettings/pixmaps/beryl-settings-section-png.svg b/kberylsettings/pixmaps/beryl-settings-section-png.svg
new file mode 100644
index 0000000..69d0944
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-png.svg
@@ -0,0 +1,426 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="64px"
+ height="64px"
+ id="svg20565"
+ sodipodi:version="0.32"
+ inkscape:version="0.44"
+ sodipodi:docbase="/home/andrew/Desktop"
+ sodipodi:docname="png.svg">
+ <defs
+ id="defs20567" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="3.8890873"
+ inkscape:cx="23.928812"
+ inkscape:cy="27.987079"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:document-units="px"
+ inkscape:grid-bbox="true"
+ inkscape:window-width="872"
+ inkscape:window-height="621"
+ inkscape:window-x="1285"
+ inkscape:window-y="55" />
+ <metadata
+ id="metadata20570">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <rect
+ style="fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21513"
+ width="8.485281"
+ height="8.9995413"
+ x="22.370287"
+ y="3.5745106" />
+ <rect
+ style="fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21516"
+ width="8.485281"
+ height="8.9995413"
+ x="12.727921"
+ y="12.959746" />
+ <rect
+ style="fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21518"
+ width="8.485281"
+ height="8.9995413"
+ x="2.9569921"
+ y="22.987806" />
+ <rect
+ style="fill:#c00;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21520"
+ width="8.485281"
+ height="8.9995413"
+ x="2.9569921"
+ y="32.758736" />
+ <rect
+ style="fill:#c00;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21522"
+ width="8.485281"
+ height="8.9995413"
+ x="12.985052"
+ y="23.244934" />
+ <rect
+ style="fill:#c00;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21524"
+ width="8.485281"
+ height="8.9995413"
+ x="22.755981"
+ y="13.216876" />
+ <rect
+ style="fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21526"
+ width="8.485281"
+ height="8.9995413"
+ x="32.784042"
+ y="4" />
+ <rect
+ style="fill:#a40000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21536"
+ width="8.485281"
+ height="8.9995413"
+ x="43.326363"
+ y="3.4459465" />
+ <rect
+ style="fill:#a40000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21538"
+ width="8.485281"
+ height="8.9995413"
+ x="32.784042"
+ y="13.474007" />
+ <rect
+ style="fill:#a40000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21540"
+ width="8.485281"
+ height="8.9995413"
+ x="22.755983"
+ y="22.987806" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#a40000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22472"
+ width="8.485281"
+ height="8.9995413"
+ x="-41.140755"
+ y="-61.384323" />
+ <rect
+ style="fill:#a40000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21542"
+ width="8.485281"
+ height="8.9995413"
+ x="12.727922"
+ y="32.758736" />
+ <rect
+ style="fill:#a40000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21544"
+ width="8.485281"
+ height="8.9995413"
+ x="2.6998625"
+ y="43.558186" />
+ <rect
+ style="fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21546"
+ width="8.485281"
+ height="8.9995413"
+ x="2.9569921"
+ y="13.216875" />
+ <rect
+ style="fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21548"
+ width="8.485281"
+ height="8.9995413"
+ x="12.727922"
+ y="3.1888165" />
+ <rect
+ style="fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21550"
+ width="8.485281"
+ height="8.9995413"
+ x="2.9569919"
+ y="2.9316869" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#a40000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22474"
+ width="8.485281"
+ height="8.9995413"
+ x="-51.297379"
+ y="-51.999084" />
+ <rect
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21552"
+ width="8.485281"
+ height="8.9995413"
+ x="43.326363"
+ y="13.216876" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#a40000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22476"
+ width="8.485281"
+ height="8.9995413"
+ x="-61.06831"
+ y="-41.971027" />
+ <rect
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21554"
+ width="8.485281"
+ height="8.9995413"
+ x="32.784042"
+ y="23.244936" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22478"
+ width="8.485281"
+ height="8.9995413"
+ x="-61.06831"
+ y="-32.200096" />
+ <rect
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21556"
+ width="8.485281"
+ height="8.9995413"
+ x="22.755983"
+ y="32.758736" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22480"
+ width="8.485281"
+ height="8.9995413"
+ x="-51.040249"
+ y="-41.713898" />
+ <rect
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21558"
+ width="8.485281"
+ height="8.9995413"
+ x="12.727921"
+ y="42.786797" />
+ <rect
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21560"
+ width="8.485281"
+ height="8.9995413"
+ x="2.699862"
+ y="53.329117" />
+ <rect
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect21562"
+ width="8.485281"
+ height="8.9995413"
+ x="53.09729"
+ y="3.1888163" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22482"
+ width="8.485281"
+ height="8.9995413"
+ x="-41.269318"
+ y="-51.741951" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22484"
+ width="8.485281"
+ height="8.9995413"
+ x="-31.241261"
+ y="-60.958832" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22486"
+ width="8.485281"
+ height="8.9995413"
+ x="-20.69894"
+ y="-61.512886" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22488"
+ width="8.485281"
+ height="8.9995413"
+ x="-31.241261"
+ y="-51.999084" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22490"
+ width="8.485281"
+ height="8.9995413"
+ x="-41.269318"
+ y="-41.971027" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22492"
+ width="8.485281"
+ height="8.9995413"
+ x="-51.297379"
+ y="-32.200096" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#7d0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22494"
+ width="8.485281"
+ height="8.9995413"
+ x="-61.325443"
+ y="-21.400644" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#ef2929;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22496"
+ width="8.485281"
+ height="8.9995413"
+ x="-61.06831"
+ y="-51.741959" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#ef2929;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22498"
+ width="8.485281"
+ height="8.9995413"
+ x="-51.297379"
+ y="-61.770012" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#ef2929;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect22500"
+ width="8.485281"
+ height="8.9995413"
+ x="-61.06831"
+ y="-62.027145" />
+ <rect
+ style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.02040052;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect20573"
+ width="2.3432357"
+ height="59.388691"
+ x="1.0358247"
+ y="1.646565" />
+ <rect
+ style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.02230811;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect20575"
+ width="2.3413281"
+ height="59.659512"
+ x="11.036778"
+ y="1.6475186" />
+ <rect
+ style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.02040052;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect20577"
+ width="2.3432357"
+ height="59.388691"
+ x="20.717642"
+ y="1.646565" />
+ <rect
+ style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.02230811;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect20579"
+ width="2.3413281"
+ height="59.659512"
+ x="30.718596"
+ y="1.6475186" />
+ <rect
+ style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.02040052;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect20581"
+ width="2.3432357"
+ height="59.388691"
+ x="41.035824"
+ y="1.5783824" />
+ <rect
+ style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.02230811;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect20583"
+ width="2.3413281"
+ height="59.659512"
+ x="51.036777"
+ y="1.579336" />
+ <rect
+ style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.02040052;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect20585"
+ width="2.3432357"
+ height="60.411354"
+ x="1.6465684"
+ y="-61.713226"
+ transform="matrix(0,1,-1,0,0,0)" />
+ <rect
+ style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.02230811;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect20587"
+ width="2.3413281"
+ height="60.68684"
+ x="11.647522"
+ y="-61.712257"
+ transform="matrix(0,1,-1,0,0,0)" />
+ <rect
+ style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.02040052;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect20589"
+ width="2.3432357"
+ height="60.411354"
+ x="21.328384"
+ y="-61.713226"
+ transform="matrix(0,1,-1,0,0,0)" />
+ <rect
+ style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.02230811;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect20591"
+ width="2.3413281"
+ height="60.68684"
+ x="31.329338"
+ y="-61.712257"
+ transform="matrix(0,1,-1,0,0,0)" />
+ <rect
+ style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.02040052;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect20593"
+ width="2.3432357"
+ height="60.411354"
+ x="41.646568"
+ y="-61.782585"
+ transform="matrix(0,1,-1,0,0,0)" />
+ <rect
+ style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.02230811;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect20595"
+ width="2.3413281"
+ height="60.68684"
+ x="51.647522"
+ y="-61.781616"
+ transform="matrix(0,1,-1,0,0,0)" />
+ <rect
+ style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.02341807;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect20618"
+ width="2.3402183"
+ height="59.81749"
+ x="61.037331"
+ y="1.6480737" />
+ <rect
+ style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.041062;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect20620"
+ width="2.3225741"
+ height="62.368031"
+ x="60.385506"
+ y="-63.67131"
+ transform="matrix(0,1,-1,0,0,0)" />
+ </g>
+</svg>
diff --git a/kberylsettings/pixmaps/beryl-settings-section-snow.svg b/kberylsettings/pixmaps/beryl-settings-section-snow.svg
new file mode 100644
index 0000000..1ad1320
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-snow.svg
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="48"
+ height="48"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.44"
+ sodipodi:docbase="/home/andrew/Desktop"
+ sodipodi:docname="snow_flake.svg"
+ version="1.0"
+ inkscape:export-filename="/home/andrew/Desktop/logo_lights_mod.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="7.9195959"
+ inkscape:cx="21.648591"
+ inkscape:cy="25.600968"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:window-width="1272"
+ inkscape:window-height="941"
+ inkscape:window-x="1280"
+ inkscape:window-y="55"
+ width="48px"
+ height="48px"
+ showguides="true"
+ inkscape:guide-bbox="true">
+ <sodipodi:guide
+ orientation="horizontal"
+ position="28.75"
+ id="guide2648" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-9.618716,-150.6052)">
+ <path
+ style="fill:#eeeeec;fill-opacity:1;stroke:#3465a4;stroke-opacity:1"
+ d="M 32.587872,196.70955 C 33.261443,195.23498 31.789771,193.43991 30.978972,195.58109 C 29.226336,197.13412 28.281762,193.71705 30.507309,193.56368 C 31.972623,192.9631 33.831105,189.48838 31.836287,189.29723 C 29.977266,190.33594 28.204223,193.91447 26.203423,193.24844 C 26.458945,190.64764 29.90835,189.87714 31.307071,187.84312 C 32.984528,187.17676 33.453993,182.35385 31.090934,184.39655 C 30.45524,185.58774 27.430502,187.8878 27.344592,185.60755 C 28.732137,183.50519 31.729177,182.73948 32.545251,180.25454 C 32.808504,178.82915 33.020102,175.41891 30.81357,177.11496 C 27.956043,177.84992 27.218716,180.8385 26.775188,183.3606 C 27.117821,185.36354 23.767581,186.30068 24.50956,183.80865 C 25.152636,182.65281 26.647278,178.46478 23.971815,180.27722 C 21.759424,182.08814 21.644158,185.20678 20.869041,187.76143 C 21.267745,189.19768 18.634982,191.02248 19.018717,188.76231 C 19.175491,186.87984 20.849539,184.50178 20.103347,182.9497 C 17.19345,182.9306 17.346431,186.7645 16.098549,188.45349 C 13.648113,188.72439 16.54283,184.20738 14.01666,185.98411 C 12.185173,187.26258 12.112677,184.18156 13.933893,184.21723 C 15.806119,182.92193 10.256841,183.90208 11.992732,181.60064 C 14.122702,181.68919 16.63559,183.54152 18.709542,181.92447 C 20.106979,179.90508 16.04034,180.43363 14.815702,179.78146 C 13.277487,180.04836 10.588211,178.05628 13.569875,177.92626 C 16.287072,178.832 19.177184,179.38281 21.986179,180.07762 C 23.742823,179.75508 25.665439,177.42324 22.600443,177.53814 C 21.391911,177.61035 18.049578,176.775 19.915717,175.42147 C 22.971356,175.75841 26.116427,177.79213 29.158428,176.29381 C 30.82274,175.96893 32.144133,174.0348 29.711312,173.61338 C 27.371341,171.91276 24.511915,173.00981 22.089747,173.8429 C 20.882429,174.88971 17.851515,173.91896 19.991685,172.52824 C 21.163073,171.91472 24.888216,172.41468 24.158889,170.59867 C 21.719,168.63602 18.676371,170.48682 16.052483,170.88227 C 14.884218,171.28806 12.348693,172.52315 12.197259,170.40428 C 14.540511,169.56285 17.305803,169.86568 19.387804,168.37332 C 17.434148,166.14042 14.491712,167.89603 12.192578,168.14247 C 10.011221,166.3088 16.291403,166.48201 13.233223,164.94836 C 11.188073,164.36036 14.200358,162.1882 14.840634,164.08891 C 15.930179,163.5713 14.178024,159.76178 16.448669,161.41923 C 17.161001,163.50624 17.498011,166.38114 20.00898,167.04271 C 21.356489,165.4911 18.699421,162.67227 19.045322,160.52083 C 19.803637,158.34575 21.411088,162.21162 21.247016,163.33874 C 21.821619,165.62681 22.132991,168.81869 24.813362,169.60846 C 27.388707,169.07929 22.25582,164.64148 25.720061,164.08937 C 27.602851,166.52188 26.633639,170.57588 29.684534,172.19054 C 30.662818,173.2029 33.419038,173.76978 32.601826,171.49925 C 33.463948,168.64778 30.593191,166.87764 28.73008,165.34857 C 27.145217,164.90661 26.402055,162.1844 28.760192,163.1581 C 29.972079,163.68631 31.860419,167.2974 32.680852,165.36937 C 33.190873,162.72182 30.669223,161.28549 29.038636,159.75964 C 28.147403,158.59271 25.77474,157.43771 25.8521,156.24182 C 27.953042,155.51948 29.175354,158.53186 30.786199,159.49954 C 32.837534,161.7867 33.313242,158.05674 31.70967,157.042 C 30.610993,156.3773 27.343028,153.51373 30.431598,153.88089 C 31.620883,154.18041 32.849102,156.13875 32.42433,153.98306 C 32.904562,152.33461 34.558447,153.03837 34.100582,154.60243 C 35.093064,155.88624 36.981895,151.73877 37.612857,154.45493 C 36.435845,156.18077 32.485806,158.02222 34.490662,160.37961 C 36.477336,159.48829 37.475811,157.13727 39.558768,156.28891 C 42.141606,156.15957 38.213814,159.0667 37.473507,159.79376 C 35.994824,161.40824 33.323398,162.64902 34.000453,165.29427 C 35.402578,167.82677 36.981504,161.6181 39.202605,163.20993 C 38.958516,166.04501 35.356652,166.43597 34.156103,168.6964 C 34.006454,170.14668 33.253712,174.29914 35.883574,172.52897 C 38.988663,171.70917 39.596513,168.70964 39.988057,166.00031 C 39.827495,164.31666 42.626531,163.54203 42.067745,165.60498 C 41.323725,166.84673 40.166276,170.57964 42.958667,169.01262 C 45.375182,167.46922 45.186477,164.22973 46.019495,161.78342 C 45.881125,160.59168 47.879566,158.52041 47.909534,160.67945 C 47.589928,162.61869 45.764972,165.11718 46.43644,166.71265 C 49.111414,166.86024 49.844809,163.72588 50.00309,161.71833 C 51.314374,160.29738 52.760346,162.30953 51.260424,163.35631 C 51.416733,165.50325 53.957721,161.86362 54.003266,164.33193 C 53.925567,165.47308 51.346181,165.74792 53.529797,166.26199 C 55.214502,165.96487 56.010338,168.12237 53.905351,168.01637 C 51.820884,167.57838 48.330688,166.19301 47.300291,168.76464 C 49.495829,169.73951 52.292587,169.334 54.391832,170.69705 C 53.865091,172.84401 50.457693,170.40267 48.778803,170.35437 C 46.921492,169.50116 42.316388,169.10689 42.43529,171.66017 C 43.894477,172.37184 47.770084,171.57136 47.001933,174.20212 C 43.995175,173.99358 41.019084,171.77353 38.006058,173.17849 C 36.70145,173.3611 34.570752,175.33843 36.974579,175.77231 C 39.227661,177.8014 42.500726,176.67109 44.901111,175.59966 C 46.805798,174.87962 48.093493,177.30464 45.503854,177.28021 C 44.248313,177.20411 41.078672,178.29695 43.523872,179.41483 C 45.580956,180.69608 47.884709,179.09677 50.01779,178.85979 C 51.39328,178.933 54.774177,176.71107 54.470457,178.93533 C 52.534671,180.26694 49.804046,179.73163 47.647485,180.74726 C 46.563588,181.93074 50.293061,182.85764 51.256999,182.15522 C 52.316327,181.18752 56.681507,181.57612 54.493068,183.20007 C 53.497638,183.15767 51.310035,183.82668 53.386535,184.45654 C 55.329541,185.41205 52.168252,186.94617 51.660981,185.293 C 51.047175,186.20435 52.726449,189.41216 50.397247,188.23652 C 49.561859,186.15304 49.244357,182.6371 46.260323,182.75296 C 45.999242,185.25872 48.094866,187.39016 47.940504,189.83161 C 45.16997,189.88461 46.101074,185.97881 45.151022,184.18664 C 45.068342,182.38114 42.408341,178.54636 40.937054,180.53861 C 41.157645,182.0752 43.674968,185.15655 40.896434,185.50434 C 39.15729,183.13249 40.122966,179.28328 37.307572,177.61816 C 36.423232,176.58807 33.651684,175.67979 34.360639,178.02751 C 33.547538,180.82309 36.202925,182.75661 38.110258,184.25034 C 39.745546,184.81122 39.649331,187.77679 37.725775,186.42237 C 36.768626,185.01126 33.637621,182.29758 34.320036,185.8121 C 35.13099,188.08124 37.454507,189.2594 38.963285,191.02016 C 39.918927,191.73826 41.964673,193.80725 39.528004,193.43337 C 37.625154,192.29431 36.496898,189.54026 34.184378,189.40945 C 33.025036,191.34987 35.415197,193.01819 36.751473,194.10681 C 39.042379,195.43932 35.965025,196.82267 35.232021,194.94835 C 32.81808,192.86709 35.246846,198.14776 32.587872,196.70955 z "
+ id="path30942" />
+ </g>
+</svg>
diff --git a/kberylsettings/pixmaps/beryl-settings-section-svg.svg b/kberylsettings/pixmaps/beryl-settings-section-svg.svg
new file mode 100644
index 0000000..f9701b1
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-svg.svg
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="64px"
+ height="64px"
+ id="svg20565"
+ sodipodi:version="0.32"
+ inkscape:version="0.44"
+ sodipodi:docbase="/home/andrew/Desktop"
+ sodipodi:docname="Svg.svg">
+ <defs
+ id="defs20567">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient27019">
+ <stop
+ style="stop-color:#ef2929;stop-opacity:1;"
+ offset="0"
+ id="stop27021" />
+ <stop
+ style="stop-color:#a40000;stop-opacity:1"
+ offset="1"
+ id="stop27023" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient27019"
+ id="linearGradient27027"
+ x1="-8.727273"
+ y1="60.727272"
+ x2="28.181818"
+ y2="27.636364"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(12.18182,-1.636364)" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="5.5"
+ inkscape:cx="55.67964"
+ inkscape:cy="38.10955"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:document-units="px"
+ inkscape:grid-bbox="true"
+ inkscape:window-width="872"
+ inkscape:window-height="621"
+ inkscape:window-x="1285"
+ inkscape:window-y="55" />
+ <metadata
+ id="metadata20570">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <path
+ style="fill:url(#linearGradient27027);fill-opacity:1;stroke:#a40000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ d="M 0.5,25.567318 L 0.5,64.150622 L 42.66658,64.150622 C 45.795337,59.634288 47.612509,54.215332 47.61251,48.37916 C 47.61251,32.677202 34.413827,19.914827 18.138803,19.914827 C 11.527074,19.914827 5.4195878,22.017004 0.5,25.567318 z "
+ id="rect22540"
+ sodipodi:nodetypes="cccssc" />
+ <path
+ style="opacity:0.57291667;fill:#eeeeec;fill-opacity:0;stroke:#eeeeec;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ d="M 1.535806,26.072866 L 1.535806,62.854818 L 42.073017,62.854818 C 45.080876,58.336519 46.553131,55.096274 46.646011,49.258295 C 46.897266,33.465736 34.138703,20.418061 17.402115,20.781545 C 11.04737,20.919557 6.265295,22.521003 1.535806,26.072866 z "
+ id="path22557"
+ sodipodi:nodetypes="cccssc" />
+ <g
+ id="g26988"
+ transform="translate(54,-4.363636)">
+ <rect
+ style="opacity:1;fill:#729fcf;fill-opacity:1;stroke:#204a87;stroke-width:0.73888499;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ id="rect26992"
+ width="58.349464"
+ height="1.6721194"
+ x="-20.722322"
+ y="33.932304"
+ transform="matrix(0.697735,0.716356,-0.647552,0.762021,0,0)" />
+ <rect
+ y="26.933386"
+ x="-21.279161"
+ height="9.0768919"
+ width="8.6876478"
+ id="rect25214"
+ style="opacity:1;fill:#729fcf;fill-opacity:1;stroke:#204a87;stroke-width:1.14077795;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1" />
+ <rect
+ y="27.884054"
+ x="-20.182619"
+ height="7.3686829"
+ width="6.6791282"
+ id="rect26101"
+ style="opacity:0.52999998;fill:#729fcf;fill-opacity:1;stroke:#eeeeec;stroke-width:1.14077795;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1" />
+ <g
+ id="g26998"
+ transform="matrix(1.070423,0,0,1.070423,30.60116,-5.603713)">
+ <path
+ transform="translate(-54,4.363636)"
+ d="M -5.9999995 10.818182 A 4.2727275 4.818182 0 1 1 -14.545455,10.818182 A 4.2727275 4.818182 0 1 1 -5.9999995 10.818182 z"
+ sodipodi:ry="4.818182"
+ sodipodi:rx="4.2727275"
+ sodipodi:cy="10.818182"
+ sodipodi:cx="-10.272727"
+ id="path26994"
+ style="opacity:1;fill:#729fcf;fill-opacity:1;stroke:#204a87;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0.847619,0,0,0.847619,-55.47446,6.004325)"
+ d="M -5.9999995 10.818182 A 4.2727275 4.818182 0 1 1 -14.545455,10.818182 A 4.2727275 4.818182 0 1 1 -5.9999995 10.818182 z"
+ sodipodi:ry="4.818182"
+ sodipodi:rx="4.2727275"
+ sodipodi:cy="10.818182"
+ sodipodi:cx="-10.272727"
+ id="path26996"
+ style="opacity:0.72000002;fill:#729fcf;fill-opacity:1;stroke:#eeeeec;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ sodipodi:type="arc" />
+ </g>
+ <g
+ id="g27002"
+ transform="matrix(1.070423,0,0,1.070423,74.09923,38.28361)">
+ <path
+ transform="translate(-54,4.363636)"
+ d="M -5.9999995 10.818182 A 4.2727275 4.818182 0 1 1 -14.545455,10.818182 A 4.2727275 4.818182 0 1 1 -5.9999995 10.818182 z"
+ sodipodi:ry="4.818182"
+ sodipodi:rx="4.2727275"
+ sodipodi:cy="10.818182"
+ sodipodi:cx="-10.272727"
+ id="path27004"
+ style="opacity:1;fill:#729fcf;fill-opacity:1;stroke:#204a87;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0.847619,0,0,0.847619,-55.47446,6.004325)"
+ d="M -5.9999995 10.818182 A 4.2727275 4.818182 0 1 1 -14.545455,10.818182 A 4.2727275 4.818182 0 1 1 -5.9999995 10.818182 z"
+ sodipodi:ry="4.818182"
+ sodipodi:rx="4.2727275"
+ sodipodi:cy="10.818182"
+ sodipodi:cx="-10.272727"
+ id="path27006"
+ style="opacity:0.72000002;fill:#729fcf;fill-opacity:1;stroke:#eeeeec;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.2;stroke-opacity:1"
+ sodipodi:type="arc" />
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/kberylsettings/plugindialog.py b/kberylsettings/plugindialog.py
index eec70c0..578d2d8 100644
--- a/kberylsettings/plugindialog.py
+++ b/kberylsettings/plugindialog.py
@@ -19,6 +19,7 @@ class PluginList(KListView):
def __init__(self, parent):
KListView.__init__(self, parent)
self.addColumn(i18n('Plugin'))
+ self.addColumn(i18n('Categories'))
self.addColumn(i18n('Description'))
def addPlugins(self, context):
@@ -31,10 +32,14 @@ class PluginList(KListView):
active = context.active
count = textlen = 0
loader = iconLoader()
+ cats = context.categories
+
for p in context.plugins:
item = QCheckListItem(self, p.ShortDesc, QCheckListItem.CheckBox)
item.setEnabled(not p.isGeneral)
- item.setText(1, p.LongDesc)
+ cnames = str.join(',', [c.ShortDesc for c in cats if p in c.Plugins])
+ item.setText(1, cnames)
+ item.setText(2, p.LongDesc)
item.setPixmap(0, p.icon(KIcon.SizeSmall, loader))
if p.Name in active:
stateMap[p.Name] = 1
diff --git a/kberylsettings/pluginframe.py b/kberylsettings/pluginframe.py
index be043dd..a867fee 100644
--- a/kberylsettings/pluginframe.py
+++ b/kberylsettings/pluginframe.py
@@ -309,6 +309,12 @@ class PluginTreeView(PluginView):
groups = plugin.settings
keys = groups.keys()
keys.sort()
+
+ child = item.firstChild()
+ while child:
+ item.takeItem(child)
+ child = item.firstChild()
+
for key in keys:
sub = QListViewItem(item, key)
sub.setPixmap(0, Setting.icon(key, self.iconSize))
diff --git a/kberylsettings/settingwidget.py b/kberylsettings/settingwidget.py
index 1aaf54c..81297a0 100644
--- a/kberylsettings/settingwidget.py
+++ b/kberylsettings/settingwidget.py
@@ -31,8 +31,9 @@ def settingWidget(parent, plugin, setting):
@return new widget suitable for display and edit of setting
"""
for typ in SettingWidgetDetector.types:
- if typ.query(plugin, setting):
- return typ(parent, plugin, setting)
+ call = typ.query(plugin, setting)
+ if call:
+ return call(parent, plugin, setting)
class SettingWidgetDetector(wrappertype):
@@ -115,7 +116,7 @@ class SettingWidget(QFrame):
@return truth value if this type can build a widget for
specified plugin and setting, false value otherwise.
"""
- return setting.Type in cls.queryTypes
+ return (setting.Type in cls.queryTypes) and cls
query = classmethod(query)
## MARKER
@@ -215,8 +216,13 @@ class SpecificNames(SettingWidget):
@param setting berylsettings Setting instance
@return four-item tuple of (widget, signal, valuemethod, resetmethod)
"""
- return self.query(plugin, setting)(self, parent, plugin, setting)
+ return self.lookup(plugin, setting)(self, parent, plugin, setting)
+ def lookup(cls, plugin, setting):
+ name = '%s_%s' % (plugin.Name, setting.Name, )
+ return getattr(cls, name, None)
+ lookup = classmethod(lookup)
+
def query(cls, plugin, setting):
""" matches plugin and setting names to local method names
@@ -225,8 +231,7 @@ class SpecificNames(SettingWidget):
@param setting berylsettings Setting instance
@return unbound method if found on class, None otherwise
"""
- name = '%s_%s' % (plugin.Name, setting.Name, )
- return getattr(cls, name, None)
+ return cls.lookup(plugin, setting) and cls
query = classmethod(query)
def switcher_icon_corner(self, parent, plugin, setting):
@@ -268,9 +273,15 @@ class MatchNames(SettingWidget):
@param setting berylsettings Setting instance
@return four-item tuple of (widget, signal, valuemethod, resetmethod)
"""
- meth = self.query(plugin, setting)
+ meth = self.lookup(plugin, setting)
return meth(self, parent, plugin, setting)
-
+
+ def lookup(cls, plugin, setting):
+ for (plugpat, setpat), callname in cls.lookups:
+ if match(plugpat, plugin.Name) and match(setpat, setting.Name):
+ return getattr(cls, callname, None)
+ lookup = classmethod(lookup)
+
def query(cls, plugin, setting):
""" matches plugin and setting names to local method names
@@ -279,9 +290,7 @@ class MatchNames(SettingWidget):
@param setting berylsettings Setting instance
@return unbound method if found on class, None otherwise
"""
- for (plugpat, setpat), callname in cls.lookups:
- if match(plugpat, plugin.Name) and match(setpat, setting.Name):
- return getattr(cls, callname, None)
+ return cls.lookup(plugin, setting) and cls
query = classmethod(query)
def fileSelector(self, parent, plugin, setting):
@@ -308,7 +317,6 @@ class MatchNames(SettingWidget):
self, Signals.someChange)
layout = QVBoxLayout(self)
layout.addWidget(self.group, 2)
- ## return signal None because we've already connected the checkboxes
return (self.group, None, self.checkBoxesValue, self.checkBoxesReset)
@@ -434,7 +442,7 @@ class FewChoices(SettingWidget):
def query(cls, plugin, setting):
if setting.Type in cls.queryTypes and setting.Restrictions:
- return len(setting.Restrictions) < 5
+ return (len(setting.Restrictions) < 5) and cls
query = classmethod(query)
def build(self, parent, plugin, setting):
@@ -542,7 +550,7 @@ class Binding(SettingWidget):
'9 (if available)',
)
- idxKey, idxPointer, idxBell, idxEdge = range(4)
+ idxKey, idxPointer, idxBell, idxEdge = idxs = range(4)
def build(self, parent, plugin, setting):
""" create widget(s) for setting display and edit
@@ -554,36 +562,73 @@ class Binding(SettingWidget):
"""
self.controls = [None, None, None, None]
self.label = QLabel(setting.ShortDesc, self)
- layout = QGridLayout(self, 4, 3, 0, 10)
+ layout = QGridLayout(self, 4, 4, 0, 10)
layout.addMultiCellWidget(self.label, 0, 0, 0, 3, Qt.AlignTop|Qt.AlignLeft)
restrictions = setting.Restrictions
-
+
+ if restrictions[self.idxBell]:
+ self.controls[self.idxBell] = control = \
+ self.bellWidget('Bell')
+ layout.addMultiCellWidget(control.bellFrame, 1, 1, 0, 3)
+
if restrictions[self.idxKey]:
self.controls[self.idxKey] = control = \
self.bindingWidget('Key', self.idxKey)
- layout.addLayout(control.headerLayout, 1, 0)
- layout.addWidget(control.modifierList, 2, 0)
+ layout.addLayout(control.headerLayout, 2, 1)
+ layout.addWidget(control.modifierList, 3, 1)
if restrictions[self.idxPointer]:
self.controls[self.idxPointer] = control = \
self.bindingWidget('Pointer Button', self.idxPointer)
- layout.addLayout(control.headerLayout, 1, 1)
- layout.addWidget(control.modifierList, 2, 1)
+ layout.addLayout(control.headerLayout, 2, 2)
+ layout.addWidget(control.modifierList, 3, 2)
if restrictions[self.idxEdge]:
self.controls[self.idxEdge] = control = \
self.edgeBindingWidget('Edge')
- layout.addWidget(control.typeLabel, 1, 2)
- layout.addWidget(control.edgeList, 2, 2)
+ layout.addWidget(control.typeLabel, 2, 3)
+ layout.addWidget(control.edgeList, 3, 3)
else:
- layout.addItem(self.spacer(), 1, 2)
- layout.addItem(self.spacer(), 2, 2)
+ layout.addItem(self.spacer(), 2, 3)
+ layout.addItem(self.spacer(), 3, 3)
return (None, None, self.bindingValue, self.bindingReset)
def bindingValue(self):
- raise RuntimeError('Cannot fetch binding value')
+ """
+
+ """
+ val = ['Disabled', 'Disabled', False, []]
+ res = self.setting.Restrictions
+ idxKey, idxPointer, idxBell, idxEdge = self.idxs
+
+ if res[idxKey]:
+ if self.controls[idxKey].enableCheck.isChecked():
+ key = self.controls[idxKey].keyLine.text()
+ mods = [i.text(0) for i in self.controls[idxKey].modifierList
+ if i.state()==i.On]
+ mods = str.join('', ['<%s>' % m for m in mods])
+ val[idxKey] = '%s%s' % (mods, key)
+
+ if res[idxPointer]:
+ if self.controls[idxPointer].enableCheck.isChecked():
+ button = self.controls[idxPointer].buttonList.currentItem()
+ mods = [i.text(0) for i in self.controls[idxPointer].modifierList
+ if i.state()==i.On]
+ mods = str.join('', ['<%s>' % m for m in mods])
+ val[idxPointer] = '%sButton%s' % (mods, button+1)
+
+ if res[idxBell]:
+ val[idxBell] = self.controls[idxBell].bellCheck.isChecked()
+
+ if res[idxEdge]:
+ ctl = self.controls[idxEdge].edgeList
+ edges = val[idxEdge]
+ edges.extend([str(i.text(0)) for i in ctl if i.state()==i.On])
+
+ return tuple(val)
+
def bindingReset(self):
@@ -626,10 +671,15 @@ class Binding(SettingWidget):
checkBox.setChecked(enabled)
checkBox.emit(Signals.toggled, (enabled,))
except (AttributeError, ): pass
+ try:
+ checkBox = control.bellCheck
+ checkBox.setChecked(value[index])
+ checkBox.emit(Signals.toggled, (value[index], ))
+ except (AttributeError, ): pass
## use the closure
restrictions = self.setting.Restrictions
- for key in (self.idxKey, self.idxPointer, self.idxEdge):
+ for key in self.idxs:
if restrictions[key]:
reset(key)
@@ -640,7 +690,7 @@ class Binding(SettingWidget):
someChange = Signals.someChange
ctl.headerLayout = headerLayout = QVBoxLayout()
- ctl.enableCheck = enableCheck = QCheckBox(i18n('Enable'), self)
+ ctl.enableCheck = enableCheck = QCheckBox('', self)
headerLayout.addWidget(enableCheck)
ctl.lineLayout = lineLayout = QHBoxLayout(headerLayout)
@@ -650,6 +700,7 @@ class Binding(SettingWidget):
connect(enableCheck, toggled, typeLabel.setEnabled)
if which == self.idxKey:
+ enableCheck.setText(i18n('Enable Key'))
ctl.keyLine = keyLine = KLineEdit(self)
lineLayout.addWidget(keyLine)
ctl.keyButton = keyButton = KPushButton(i18n('Grab'), self)
@@ -658,6 +709,7 @@ class Binding(SettingWidget):
connect(enableCheck, toggled, keyLine.setEnabled)
connect(enableCheck, toggled, keyButton.setEnabled)
elif which == self.idxPointer:
+ enableCheck.setText(i18n('Enable Button'))
ctl.buttonList = buttonList = KComboBox(self)
lineLayout.addWidget(buttonList)
connect(buttonList, Signals.activatedIndex, self, someChange)
@@ -676,6 +728,14 @@ class Binding(SettingWidget):
connect(edgeList, Signals.itemSelected, self, Signals.someChange)
return ctl
+ def bellWidget(self, text):
+ ctl = self.control()
+ ctl.bellFrame = QFrame(self)
+ layout = QHBoxLayout(ctl.bellFrame)
+ ctl.bellCheck = QCheckBox(i18n('Enable Bell'), ctl.bellFrame)
+ layout.addWidget(ctl.bellCheck)
+ return ctl
+
class control(object):
""" add attributes to instances of this handy-and-empty class
@@ -719,5 +779,5 @@ class Unknown(SettingWidget):
@param setting berylsettings Setting instance
@return True
"""
- return True
+ return cls
query = classmethod(query)