summaryrefslogtreecommitdiff
path: root/kberylsettings/lib.py
diff options
context:
space:
mode:
authornatural <natural>2006-12-20 02:56:15 +0000
committernatural <natural>2006-12-20 02:56:15 +0000
commit9a71cc9d01fc4eb398aea5efdd1b9b7f85824898 (patch)
tree243e119796327d2cb2c6c33c3b3d291a7e3f24a9 /kberylsettings/lib.py
parente87833f32ea631dab7391484f0f89bedf669b80c (diff)
downloadkberylsettings-9a71cc9d01fc4eb398aea5efdd1b9b7f85824898.tar.gz
kberylsettings-9a71cc9d01fc4eb398aea5efdd1b9b7f85824898.tar.bz2
Added systray icon support, and blue version of beryl settings svg icon for it.
Fixed actions and action highlighting. Removed pixmap/Makefile/*. Need to make symlinks sometime soon. Other fixes as well.
Diffstat (limited to 'kberylsettings/lib.py')
-rw-r--r--kberylsettings/lib.py61
1 files changed, 35 insertions, 26 deletions
diff --git a/kberylsettings/lib.py b/kberylsettings/lib.py
index 33c0ca0..17b14d7 100644
--- a/kberylsettings/lib.py
+++ b/kberylsettings/lib.py
@@ -46,6 +46,9 @@ class Signals:
okClicked = SIGNAL('okClicked()')
activated = SIGNAL('activated()')
textChanged = SIGNAL('textChanged(const QString&)')
+ quitSelected = SIGNAL("quitSelected()")
+ actionStatusText = SIGNAL('actionStatusText(const QString &)')
+ clearStatusText = SIGNAL('clearStatusText()')
contextMenuRequest = \
SIGNAL('contextMenuRequested(QListViewItem*,const QPoint&,int)')
@@ -54,7 +57,9 @@ class Slots:
""" class with SLOT attributes
"""
+ clear = SLOT('clear()')
close = SLOT('close()')
+ messageText = SLOT('message( const QString & )')
def iconLoader():
@@ -98,44 +103,48 @@ def iconSet(name, group=KIcon.NoGroup, size=KIcon.SizeSmall):
return iconLoader().loadIconSet(name, group, size)
-def action(text, label, icon, accel, tip, collection, pluggable):
+def action(text, iconset, cut, slot, collection, name,
+ tooltip='', pluggable=None):
""" creates and configures a KAction instance
@param text display value for action
- @param label value associated with action
- @param icon pixmap for action
- @param accel constructor parameter for KAccel
- @param tip tooltip text for actin
+ @param iconset name of icon set for action
+ @param cut
+ @param slot
@param collection KActionCollection instance
- @param pluggable any object with plug method
+ @param name internal action name
+ @keyparam tooltip='' value for tooltip
+ @keyparam pluggable=None any pluggable object
@return KAction instance
"""
- obj = KAction(text)
- obj.setShortcut(KShortcut(accel))
- obj.setIconSet(iconSet(icon))
- obj.setIcon(icon)
- obj.setText(i18n(label))
- obj.setToolTip(i18n(tip))
- collection.insert(obj)
- collection.connectHighlight(pluggable, obj)
- obj.plug(pluggable)
- return obj
-
-
-def stdAction(parent, name, slot, collection, pluggable):
+ if not cut:
+ cut = KShortcut()
+ else:
+ cut = KShortcut(cut)
+ iconset = iconSet(iconset)
+ action = KAction(text, iconset, cut, slot, collection, name)
+ if tooltip:
+ action.setToolTip(tooltip)
+ if pluggable:
+ action.plug(pluggable)
+ return action
+
+
+def stdAction(attr, slot, collection, name, pluggable=None):
""" creates a named KStdAction instance
- @param parent receiver of action
- @param name attribute of KStdAction class
+ @param attr attribute of KStdAction class
@param slot slot for KStdAction instance
@param collection KActionCollection instance
- @param pluggable any object with plug method
+ @param name internal action name
+ @keyparam pluggable=None any pluggable object
@return KStdAction instance
"""
- typ = getattr(KStdAction, name)
- obj = typ(parent, slot, collection)
- obj.plug(pluggable)
- return obj
+ typ = getattr(KStdAction, attr)
+ action = typ(slot, collection, name)
+ if pluggable:
+ action.plug(pluggable)
+ return action
def buildPart(parent, servicetype, constraint, writable=False):