summaryrefslogtreecommitdiff
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
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.
-rw-r--r--kberylsettings/aboutpage.py145
-rw-r--r--kberylsettings/beryl.py31
-rw-r--r--kberylsettings/contentframe.py36
-rw-r--r--kberylsettings/html/beryl-manager.pngbin59191 -> 59191 bytes
-rw-r--r--kberylsettings/html/main.html52
-rw-r--r--kberylsettings/html/plugin.html29
-rw-r--r--kberylsettings/lib.py31
-rw-r--r--kberylsettings/main.py22
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-3d.pngbin0 -> 5941 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-_.pngbin0 -> 1805 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-animation.pngbin0 -> 4393 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-annotate.pngbin0 -> 3692 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-bench.pngbin0 -> 1522 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-blur.pngbin0 -> 4185 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-blurfx.pngbin0 -> 4690 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-bs.pngbin0 -> 4902 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-capture.pngbin0 -> 2529 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-crashhandler.pngbin0 -> 2894 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-cube.pngbin0 -> 3927 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-dbus.pngbin0 -> 5195 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-decoration.pngbin0 -> 2371 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-fade.pngbin0 -> 1780 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-group.pngbin0 -> 2357 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-inputzoom.pngbin0 -> 4451 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-minimize.pngbin0 -> 1924 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-move.pngbin0 -> 2329 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-neg.pngbin0 -> 2065 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-place.pngbin0 -> 1772 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-plane.pngbin0 -> 2774 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-png.pngbin0 -> 2168 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-put.pngbin0 -> 2035 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-reflection.pngbin0 -> 2585 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-resize.pngbin0 -> 2278 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-rotate.pngbin0 -> 4531 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-scale.pngbin0 -> 2444 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-screenshot.pngbin0 -> 3466 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-showdesktop.pngbin0 -> 3306 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-snow.pngbin0 -> 9239 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-splash.pngbin0 -> 1755 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-state.pngbin0 -> 1791 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-svg.pngbin0 -> 5546 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-switcher.pngbin0 -> 2584 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-trailfocus.pngbin0 -> 2632 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-water.pngbin0 -> 3870 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-wobbly.pngbin0 -> 2214 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings-section-zoom.pngbin0 -> 5643 bytes
-rw-r--r--kberylsettings/pixmaps/beryl-settings.pngbin0 -> 1805 bytes
-rwxr-xr-xkberylsettings/pixmaps/svg2png5
-rw-r--r--kberylsettings/pluginframe.py19
49 files changed, 273 insertions, 97 deletions
diff --git a/kberylsettings/aboutpage.py b/kberylsettings/aboutpage.py
new file mode 100644
index 0000000..648700e
--- /dev/null
+++ b/kberylsettings/aboutpage.py
@@ -0,0 +1,145 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+""" kberylsettings.contentframe -> defines the right side about/setting views.
+
+"""
+from os import popen
+
+from kdecore import KIcon, i18n, locate
+from khtml import KHTMLPart
+from pykdeconfig import _pkg_config
+
+from kberylsettings.beryl import Setting
+from kberylsettings.lib import App, Signals, iconLoader
+from kberylsettings.widget import Frame
+
+
+class AboutPage(Frame):
+ """ AboutPage -> displays info about Beryl, environment, and plugins.
+
+ """
+ berylProto = 'beryl:/'
+ pluginHREF = '<a href="' + berylProto + '%s">%s</a>'
+ settingHREF = '<a href="' + berylProto + '%s@%s">%s</a>'
+ contentContainer = '<table class="kc_table">%s</table>%s'
+ contentRow = '<tr>%s</tr>'
+ contentCell = '''
+ <td class="kc_leftcol">%s</td><td "kc_rightcol"><b>%s</b></td>
+ '''
+ contentImg = '''
+ <img src="file://%s"
+ ''' + ('width="%s" height="%s" />' % (KIcon.SizeSmall, KIcon.SizeSmall, ))
+ contextExtra = '''
+ Use the "Search" field if you are unsure where to look for a
+ particular configuration option.
+ '''
+
+ def __init__(self, parent):
+ Frame.__init__(self, parent)
+ self.infoHtml = HTMLPart(self)
+ self.loader = iconLoader()
+ self.connect(self.infoHtml, Signals.partURL, self.onURL)
+
+ def pluginContent(self, plugin):
+ """ constructs html content for a berylsettings Plugin
+
+ @param plugin berylsettings Plugin instance
+ @return markup string
+ """
+ rows = []
+ keys = plugin.settings.keys()
+ keys.sort()
+ for key in keys:
+ row = (self.contentImg % Setting.iconPath(key) + '&nbsp;' + \
+ self.settingHREF % (plugin.Name, key, key),
+ i18n(plugin.settingTypeDesc(key)))
+ rows.append(row)
+ rows = [self.contentCell % row for row in rows]
+ rows = [self.contentRow % row for row in rows]
+ return self.contentContainer % (str.join('', rows), '')
+
+ def contextContent(self, context):
+ """ constructs html content for a berylsettings Context
+
+ @param context berylsettings Context instance
+ @return markup string
+ """
+ def cmd(line):
+ return popen(line).read().strip()
+ rows = [
+ ('Beryl Version', cmd('beryl --version')),
+ ('KDE Version', _pkg_config['kde_version_str']),
+ ('PyKDE Version', _pkg_config['pykde_version_str']),
+ ('User', cmd('whoami')),
+ ('Hostname', cmd('uname -n')),
+ ('System', cmd('uname -s')),
+ ('Release', cmd('uname -r')),
+ ('Machine', cmd('uname -m')),
+ ('<br />', '<br />'),
+ ('Active Plugins:', '')
+ ]
+ active = context.active
+ for plugin in [p for p in context.plugins if p.Name in active]:
+ row = (self.contentImg % plugin.iconPath() + '&nbsp;' + \
+ self.pluginHREF % (plugin.Name, plugin.ShortDesc),
+ plugin.LongDesc)
+ rows.append(row)
+ rows = [self.contentCell % (i18n(a), b) for a, b in rows]
+ rows = [self.contentRow % row for row in rows]
+ extra = '<div>%s</div>' % i18n(self.contextExtra)
+ return self.contentContainer % (str.join('', rows), extra)
+
+ def showAbout(self, context, plugin):
+ """ displays the About Plugin page with information from the plugin
+
+ @param plugin berylsettings Plugin instance
+ @return None
+ """
+ self.context = context
+ htmlsrc = open(App.basedir + '/html/main.html').read()
+ extracssurl = locate('data', 'kdeui/about/kde_infopage.css')
+ extracssurl = 'file://%s' % extracssurl
+ kcontrolcssurl = locate('data', 'kcontrol/about/kcontrol.css')
+ kcontrolcssurl = 'file://%s' % kcontrolcssurl
+ logourl = 'file://%s' % App.basedir + '/html/beryl-manager.png'
+ if plugin is None:
+ title = i18n('KDE Beryl Settings')
+ shortdesc = i18n('Configure Your Beryl Settings')
+ longdesc = i18n('Beryl Settings - Get Your Effects On!')
+ content = self.contextContent(context)
+ else:
+ title = plugin.ShortDesc
+ shortdesc = plugin.ShortDesc
+ longdesc = plugin.LongDesc
+ content = self.pluginContent(plugin)
+ self.infoHtml.begin()
+ self.infoHtml.write(htmlsrc % locals())
+ self.infoHtml.end()
+
+ def onURL(self, url):
+ """ emits a signal to show the plugin and setting on a URL click
+
+ @param url string
+ @return None
+ """
+ protocol, path = url.split(self.berylProto)
+ path = path.split('@')
+ try:
+ pluginname, settingkey = path
+ except (ValueError, ):
+ pluginname = path[0]
+ settingkey = None
+ plugin = self.context.Plugin(pluginname)
+ self.emit(Signals.selectPrevious, (plugin, settingkey, True))
+
+
+class HTMLPart(KHTMLPart):
+ """ HTMLPart -> simple subclass that emits urls as they're selected.
+
+ """
+ def urlSelected(self, url, button, state, target, args):
+ """ emit a url when selected
+
+ @return None
+ """
+ self.emit(Signals.partURL, (str(url), ))
diff --git a/kberylsettings/beryl.py b/kberylsettings/beryl.py
index 870f77d..45ccc26 100644
--- a/kberylsettings/beryl.py
+++ b/kberylsettings/beryl.py
@@ -8,7 +8,7 @@ import berylsettings
from os.path import abspath, exists
from kdecore import KIcon
-from kberylsettings.lib import App, Signals, icon
+from kberylsettings.lib import App, Signals, icon, iconLoader
from qt import QImage, QPixmap, QObject
@@ -84,7 +84,7 @@ class Context(QObject):
@return sequence of active plugin names
"""
act = self.general.Setting(self.activePluginsSettingName).Value
- return act + [Plugin.generalName, ]
+ return act # + [Plugin.generalName, ]
def setActive(self, active):
""" sets active plugins
@@ -242,6 +242,11 @@ class Plugin:
pix.convertFromImage(img.smoothScale(size, size, QImage.ScaleMin))
return pix
+ def iconPath(self):
+ name = self.plugin.Name
+ path = abspath(App.basedir + '/pixmaps/beryl-settings-section-%s.png' % name)
+ return path
+
altType = {
'Int' : 'Values',
'Float' : 'Values',
@@ -251,6 +256,22 @@ class Plugin:
'Binding' : 'Bindings',
'List of String' : 'Items',
}
+
+ altLong = {
+ 'Values' : 'Configure numeric values',
+ 'Colors' : 'Choose colors',
+ 'Choices' : 'Turn things on or off',
+ 'Bindings' : 'Connect keyboard, mouse, edges and the system bell',
+ 'Items' : 'Select items from (and into) lists of strings',
+ }
+
+ def settingTypeDesc(self, key):
+ """ lookup a long description for alternate type name
+
+ @param key alternate type name (keys of altType dict)
+ @return string description or key
+ """
+ return self.altLong.get(key, key)
def settings(self):
""" mapping of plugin settings
@@ -363,6 +384,12 @@ class Setting:
name = cls.iconNameMap.get(str(value), cls.iconNameMap['Choices'])
return icon(name, size=size)
icon = classmethod(icon)
+
+ def iconPath(cls, value):
+ name = cls.iconNameMap.get(str(value), cls.iconNameMap['Choices'])
+ ico = iconLoader().iconPath(name, KIcon.NoGroup)
+ return ico
+ iconPath = classmethod(iconPath)
def getValue(self):
""" get value of setting, explicitly silencing errors
diff --git a/kberylsettings/contentframe.py b/kberylsettings/contentframe.py
index edab4f9..208005f 100644
--- a/kberylsettings/contentframe.py
+++ b/kberylsettings/contentframe.py
@@ -9,8 +9,9 @@ from kdeui import KDialog, KMessageBox, KPassivePopup, \
from qt import Qt, QFrame, QHBoxLayout, QLabel, QScrollView, QSize, \
QSizePolicy, QStringList, QToolTip, QVBoxLayout
+from kberylsettings.aboutpage import AboutPage
from kberylsettings.beryl import Setting
-from kberylsettings.lib import App, Signals, buildPart, icon, iconLoader, iconSet
+from kberylsettings.lib import App, Signals, icon, iconLoader, iconSet
from kberylsettings.widget import Frame, SmallPushButton, WidgetStack, guiButton
from kberylsettings.settingwidget import settingWidget
@@ -51,14 +52,16 @@ class ContentFrame(WidgetStack):
connect(root, Signals.showAbout, self.showAboutPage)
connect(root, Signals.showSettings, self.showSinglePage)
connect(root, Signals.showGroups, self.showTabPage)
+ connect(aboutPage, Signals.selectPrevious,
+ root, Signals.selectPrevious)
- def showAboutPage(self, plugin):
+ def showAboutPage(self, context, plugin):
""" displays the about page
@param plugin berylsettings Plugin instance
@return None
"""
- self.aboutPage.showAbout(plugin)
+ self.aboutPage.showAbout(context, plugin)
self.raiseWidget(self.aboutPageId)
def showSinglePage(self, plugin, arg):
@@ -80,33 +83,6 @@ class ContentFrame(WidgetStack):
self.raiseWidget(self.tabPageId)
-class AboutPage(Frame):
- """ AboutPage -> frame to display a bit of info about a plugin
-
- """
- def __init__(self, parent):
- Frame.__init__(self, parent)
- self.infoHtml = buildPart(self, 'text/html', "Type == 'Service'", True)
-
- def showAbout(self, plugin):
- """ displays the About Plugin page with information from the plugin
-
- @param plugin berylsettings Plugin instance
- @return None
- """
- logofile = 'file://%s' % App.basedir + '/html/beryl-manager.png'
- htmlsrc = open(App.basedir + '/html/plugin.html').read()
- if plugin is None:
- pluginname = 'Beryl Settings'
- plugindesc = 'Beryl Settings - Get Your Effects On!'
- else:
- pluginname = plugin.ShortDesc
- plugindesc = plugin.LongDesc
- self.infoHtml.begin()
- self.infoHtml.write(htmlsrc % locals())
- self.infoHtml.end()
-
-
class SettingPage:
""" SettingPage -> mixin with methods common to both the
SinglePage and the TabPage types.
diff --git a/kberylsettings/html/beryl-manager.png b/kberylsettings/html/beryl-manager.png
index 3ef57eb..a8eb306 100644
--- a/kberylsettings/html/beryl-manager.png
+++ b/kberylsettings/html/beryl-manager.png
Binary files differ
diff --git a/kberylsettings/html/main.html b/kberylsettings/html/main.html
new file mode 100644
index 0000000..3c0fabc
--- /dev/null
+++ b/kberylsettings/html/main.html
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+ <link rel="stylesheet" href="help:/common/kde-default.css"
+ type="text/css" />
+ <link rel="stylesheet" href="%(extracssurl)s"
+ type="text/css" />
+ <link rel="stylesheet" href="%(kcontrolcssurl)s"
+ type="text/css" />
+ </head>
+ <body>
+ <div id="header">
+ <div id="headerL" style="background-image:none">
+ <img src="%(logourl)s" style="margin: 10px" alt="">
+ </div>
+ <div id="headerR">
+ <img src="help:/common/top-right-konqueror.png" alt="">
+ </div>
+ <div id="title">%(title)s</div>
+ <div id="tagline">%(shortdesc)s</div>
+ </div>
+ <div id="bar">
+ <div id="barT"><div id="barTL"></div><div id="barTR"></div><div id="barTC"></div></div>
+ <div id="barL">
+ <div id="barR">
+ <div id="barCenter" class="bar_text">
+ %(longdesc)s
+ </div>
+ </div>
+ </div>
+ <div id="barB"><div id="barBL"></div><div id="barBR"></div><div id="barBC"></div></div>
+ </div>
+
+ <div id="box">
+ <div id="boxT"><div id="boxTL"></div><div id="boxTR"></div><div id="boxTC"></div></div>
+ <div id="boxL">
+ <div id="boxR">
+ <div id="boxCenter">
+ %(content)s
+ </div>
+ </div>
+ </div>
+ <div id="boxB"><div id="boxBL"></div><div id="boxBR"></div><div id="boxBC"></div></div>
+ </div>
+
+ <div id="footer"><div id="footerL"></div><div id="footerR"></div></div>
+ </body>
+</html>
diff --git a/kberylsettings/html/plugin.html b/kberylsettings/html/plugin.html
deleted file mode 100644
index 93afbaf..0000000
--- a/kberylsettings/html/plugin.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<html>
- <head>
- <title>%(pluginname)s</title>
- <link rel="stylesheet" href="help:/common/kde-default.css" type="text/css" />
- </head>
-
- <body style="background-color:#5DACE5;">
- <div style="background-image: url(help:/common/top-middle.png); width: 100%%; height: 131px;">
- <div style="position: absolute; right: 0px;">
- <img src="help:/common/top-right-konqueror.png" style="margin: 0px" alt="">
- </div>
- <div style="position: absolute; left: 0px;">
- <img src="%(logofile)s" style="margin: 10px" alt="">
- </div>
- <div style="position: absolute;
- top: 15px;
- left: 70px;
- text-align: right;
- font-size: xx-large;
- font-weight: bold;
- text-shadow: #fff 1px 1px 2px;
- color: #444">
- %(pluginname)s
- </div>
- <div style="position:absolute;top:131px;"><!-- plugin info --></div>
- </div>
- <div id="footer"><div id="footerL"/><div id="footerR"/></div>
- </body>
-</html>
diff --git a/kberylsettings/lib.py b/kberylsettings/lib.py
index 2251e51..c6e0e09 100644
--- a/kberylsettings/lib.py
+++ b/kberylsettings/lib.py
@@ -6,13 +6,9 @@
from os import environ
from os.path import abspath, dirname
-from qt import PYSIGNAL, SIGNAL, SLOT, QPixmap, QImage
-
+from qt import PYSIGNAL, QPixmap, QImage, SIGNAL, SLOT
from kdecore import KGlobal, KIcon, KShortcut, i18n
from kdeui import KAction, KStdAction
-from kio import KTrader
-from khtml import KHTMLPart # without this, the KHTMLParts aren't created.
-from kparts import createReadOnlyPart, createReadWritePart
##
@@ -50,7 +46,8 @@ class Signals:
itemClicked = SIGNAL('clicked(QListViewItem *)')
itemSelected = SIGNAL('selectionChanged(QListViewItem *)')
okClicked = SIGNAL('okClicked()')
- quitSelected = SIGNAL("quitSelected()")
+ partURL = PYSIGNAL('partURL')
+ quitSelected = SIGNAL('quitSelected()')
searchInput = PYSIGNAL('searchInput')
selectItem = PYSIGNAL('selectItem')
selectPrevious = PYSIGNAL('selectPrevious')
@@ -157,25 +154,3 @@ def stdAction(attr, slot, collection, name, pluggable=None):
if pluggable:
action.plug(pluggable)
return action
-
-
-def buildPart(parent, servicetype, constraint, writable=False):
- """ build a KDE part
-
- @param parent parent object of created part
- @param servicetype mime type as string, or other service name
- @param constraint value to limit KTrader query
- @keyparam writable=False if True, creates read-write part
- @return KParts.ReadOnlyPart or KParts.ReadWritePart instance
- """
- offers = KTrader.self().query(servicetype, constraint)
- part = None
- for ptr in offers:
- if writable:
- builder = createReadWritePart
- else:
- builder = createReadOnlyPart
- part = builder(ptr.library(), parent, ptr.name())
- if part:
- break
- return part
diff --git a/kberylsettings/main.py b/kberylsettings/main.py
index da7a905..2c40fc8 100644
--- a/kberylsettings/main.py
+++ b/kberylsettings/main.py
@@ -129,12 +129,11 @@ class KBerylSettings(KMainWindow):
config = self.config('mainwindow')
self.restoreWindowSize(config)
self.mainSplitter.setSizes([self.width()*0.25, self.width()*0.75])
+ self.onIntro()
config = self.config('mainview')
emit = self.emit
- emit(Signals.showAbout, (None, ))
emit(Signals.iconSizeChanged,
(config.readNumEntry('iconsize', self.iconSize), ))
-
viewMode = config.readNumEntry('viewmode', self.viewMode)
emit(Signals.viewModeChanged, (viewMode, ))
## done after initial emit to prevent spurious context update
@@ -171,6 +170,19 @@ class KBerylSettings(KMainWindow):
self.quitAction = stdAction('quit', self.close, actions, '', pop)
return pop
+ def helpMenu(self):
+ """ creates a new Help menu
+
+ @return KPopupMenu instance
+ """
+ pop = KMainWindow.helpMenu(self)
+ self.introAction = action('KDE Beryl Settings Introduction',
+ 'intro', 'Ctrl+I', self.onIntro,
+ self.actionCollection(), 'intro_action',
+ 'Show the introduction.', None)
+ self.introAction.plug(pop, 3)
+ return pop
+
def profileMenu(self):
""" creates a new Named Profiles menu
@@ -294,6 +306,12 @@ class KBerylSettings(KMainWindow):
self.emit(Signals.searchInput, (value, ))
self.emit(Signals.viewModeChanged, (2, ))
+ def onIntro(self):
+ """ emits signal to show the introduction
+
+ """
+ self.emit(Signals.showAbout, (self.context, None))
+
def onPluginDialogOk(self):
""" sets current context active plugins
diff --git a/kberylsettings/pixmaps/beryl-settings-section-3d.png b/kberylsettings/pixmaps/beryl-settings-section-3d.png
new file mode 100644
index 0000000..0cfb1fb
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-3d.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-_.png b/kberylsettings/pixmaps/beryl-settings-section-_.png
new file mode 100644
index 0000000..94c6272
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-_.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-animation.png b/kberylsettings/pixmaps/beryl-settings-section-animation.png
new file mode 100644
index 0000000..3ece59e
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-animation.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-annotate.png b/kberylsettings/pixmaps/beryl-settings-section-annotate.png
new file mode 100644
index 0000000..eae42b9
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-annotate.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-bench.png b/kberylsettings/pixmaps/beryl-settings-section-bench.png
new file mode 100644
index 0000000..3fa01a8
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-bench.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-blur.png b/kberylsettings/pixmaps/beryl-settings-section-blur.png
new file mode 100644
index 0000000..48ef1bc
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-blur.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-blurfx.png b/kberylsettings/pixmaps/beryl-settings-section-blurfx.png
new file mode 100644
index 0000000..0a38736
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-blurfx.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-bs.png b/kberylsettings/pixmaps/beryl-settings-section-bs.png
new file mode 100644
index 0000000..103e37a
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-bs.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-capture.png b/kberylsettings/pixmaps/beryl-settings-section-capture.png
new file mode 100644
index 0000000..e7abdca
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-capture.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-crashhandler.png b/kberylsettings/pixmaps/beryl-settings-section-crashhandler.png
new file mode 100644
index 0000000..ddef653
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-crashhandler.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-cube.png b/kberylsettings/pixmaps/beryl-settings-section-cube.png
new file mode 100644
index 0000000..d6b3a77
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-cube.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-dbus.png b/kberylsettings/pixmaps/beryl-settings-section-dbus.png
new file mode 100644
index 0000000..808844f
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-dbus.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-decoration.png b/kberylsettings/pixmaps/beryl-settings-section-decoration.png
new file mode 100644
index 0000000..656e3c0
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-decoration.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-fade.png b/kberylsettings/pixmaps/beryl-settings-section-fade.png
new file mode 100644
index 0000000..6a657ad
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-fade.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-group.png b/kberylsettings/pixmaps/beryl-settings-section-group.png
new file mode 100644
index 0000000..18625ee
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-group.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-inputzoom.png b/kberylsettings/pixmaps/beryl-settings-section-inputzoom.png
new file mode 100644
index 0000000..5b8240e
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-inputzoom.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-minimize.png b/kberylsettings/pixmaps/beryl-settings-section-minimize.png
new file mode 100644
index 0000000..b66c078
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-minimize.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-move.png b/kberylsettings/pixmaps/beryl-settings-section-move.png
new file mode 100644
index 0000000..60fc23e
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-move.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-neg.png b/kberylsettings/pixmaps/beryl-settings-section-neg.png
new file mode 100644
index 0000000..e172797
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-neg.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-place.png b/kberylsettings/pixmaps/beryl-settings-section-place.png
new file mode 100644
index 0000000..c577db6
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-place.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-plane.png b/kberylsettings/pixmaps/beryl-settings-section-plane.png
new file mode 100644
index 0000000..b800801
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-plane.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-png.png b/kberylsettings/pixmaps/beryl-settings-section-png.png
new file mode 100644
index 0000000..4e8d08e
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-png.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-put.png b/kberylsettings/pixmaps/beryl-settings-section-put.png
new file mode 100644
index 0000000..cbb6ee9
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-put.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-reflection.png b/kberylsettings/pixmaps/beryl-settings-section-reflection.png
new file mode 100644
index 0000000..32a195b
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-reflection.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-resize.png b/kberylsettings/pixmaps/beryl-settings-section-resize.png
new file mode 100644
index 0000000..b72f713
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-resize.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-rotate.png b/kberylsettings/pixmaps/beryl-settings-section-rotate.png
new file mode 100644
index 0000000..f1800f0
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-rotate.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-scale.png b/kberylsettings/pixmaps/beryl-settings-section-scale.png
new file mode 100644
index 0000000..b21cb14
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-scale.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-screenshot.png b/kberylsettings/pixmaps/beryl-settings-section-screenshot.png
new file mode 100644
index 0000000..25b5e53
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-screenshot.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-showdesktop.png b/kberylsettings/pixmaps/beryl-settings-section-showdesktop.png
new file mode 100644
index 0000000..21ace9c
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-showdesktop.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-snow.png b/kberylsettings/pixmaps/beryl-settings-section-snow.png
new file mode 100644
index 0000000..a6306de
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-snow.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-splash.png b/kberylsettings/pixmaps/beryl-settings-section-splash.png
new file mode 100644
index 0000000..9ace403
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-splash.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-state.png b/kberylsettings/pixmaps/beryl-settings-section-state.png
new file mode 100644
index 0000000..f1fead8
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-state.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-svg.png b/kberylsettings/pixmaps/beryl-settings-section-svg.png
new file mode 100644
index 0000000..d46ca47
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-svg.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-switcher.png b/kberylsettings/pixmaps/beryl-settings-section-switcher.png
new file mode 100644
index 0000000..a7cbbfa
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-switcher.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-trailfocus.png b/kberylsettings/pixmaps/beryl-settings-section-trailfocus.png
new file mode 100644
index 0000000..69cb5fa
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-trailfocus.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-water.png b/kberylsettings/pixmaps/beryl-settings-section-water.png
new file mode 100644
index 0000000..41649b9
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-water.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-wobbly.png b/kberylsettings/pixmaps/beryl-settings-section-wobbly.png
new file mode 100644
index 0000000..7da7245
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-wobbly.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings-section-zoom.png b/kberylsettings/pixmaps/beryl-settings-section-zoom.png
new file mode 100644
index 0000000..32de2a4
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings-section-zoom.png
Binary files differ
diff --git a/kberylsettings/pixmaps/beryl-settings.png b/kberylsettings/pixmaps/beryl-settings.png
new file mode 100644
index 0000000..94c6272
--- /dev/null
+++ b/kberylsettings/pixmaps/beryl-settings.png
Binary files differ
diff --git a/kberylsettings/pixmaps/svg2png b/kberylsettings/pixmaps/svg2png
new file mode 100755
index 0000000..339249a
--- /dev/null
+++ b/kberylsettings/pixmaps/svg2png
@@ -0,0 +1,5 @@
+for name in `ls *svg`
+do
+ echo `basename $name .svg`
+ convert -background transparent $name `basename $name .svg`.png
+done
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):