AppletScript Class Reference
from PyKDE4.plasma import *
Inherits: Plasma.ScriptEngine → QObject
Namespace: Plasma.AppletScript
Detailed Description
AppletScript plasma/scripting/appletscript.h <Plasma/Scripting/AppletScript>
Provides a restricted interface for scripted applets.
Signals |
| saveState (KConfigGroup group) |
Methods |
| __init__ (self, QObject parent=0) |
| addStandardConfigurationPages (self, KConfigDialog dialog) |
Plasma.Applet | applet (self) |
| configChanged (self) |
| configNeedsSaving (self) |
| constraintsEvent (self, Plasma.Constraints constraints) |
[QActio] | contextualActions (self) |
Plasma.DataEngine | dataEngine (self, QString engine) |
KPluginInfo | description (self) |
Plasma.Extender | extender (self) |
bool | isRegisteredAsDragHandle (self, QGraphicsItem item) |
QString | mainScript (self) |
Plasma.Package | package (self) |
| paintInterface (self, QPainter painter, QStyleOptionGraphicsItem option, QRect contentsRect) |
| registerAsDragHandle (self, QGraphicsItem item) |
| saveState (self, KConfigGroup group) |
| setApplet (self, Plasma.Applet applet) |
| setConfigurationRequired (self, bool req, QString reason=QString()) |
| setFailedToLaunch (self, bool failed, QString reason=QString()) |
| setHasConfigurationInterface (self, bool hasInterface) |
QPainterPath | shape (self) |
| showConfigurationInterface (self) |
| showMessage (self, QIcon icon, QString message, Plasma.MessageButtons buttons) |
QSizeF | size (self) |
KConfigDialog | standardConfigurationDialog (self) |
| unregisterAsDragHandle (self, QGraphicsItem item) |
Method Documentation
__init__ |
( |
self, |
|
|
|
QObject |
parent=0 |
|
) |
|
|
|
This method should be called after a scripting applet has added
its own pages to a configuration dialog
- Since:
- 4.3.1
Returns the Plasma.Applet associated with this script component
configNeedsSaving |
( |
|
self ) |
|
Called when any of the geometry constraints have been updated.
This is always called prior to painting and should be used as an
opportunity to layout the widget, calculate sizings, etc.
Do not call update() from this method; an update() will be triggered
at the appropriate time for the applet.
- Parameters:
-
| constraints | the type of constraints that were updated
|
[QActio] contextualActions |
( |
|
self ) |
|
Returns a list of context-related QAction instances.
- Returns:
- A list of actions. The default implementation returns an
empty list.
@arg engine name of the engine
- Returns:
- a data engine associated with this plasmoid
- Returns:
- the KPluginInfo associated with this plasmoid
- Returns:
- absolute path to the main script file for this plasmoid
- Returns:
- the Package associated with this plasmoid which can
be used to request resources, such as images and
interface files.
Called when the script should paint the applet
- Parameters:
-
| painter | the QPainter to use
|
| option | the style option containing such flags as selection, level of detail, etc
|
| contentsRect | the rect to paint within; automatically adjusted for
the background, if any
|
- See also:
- Applet
- Signal syntax:
QObject.connect(source, SIGNAL("saveState(KConfigGroup&)"), target_slot)
Sets the applet associated with this AppletScript
setConfigurationRequired |
( |
self, |
|
|
|
bool |
req, |
|
|
QString |
reason=QString() |
|
) |
|
|
|
setFailedToLaunch |
( |
self, |
|
|
|
bool |
failed, |
|
|
QString |
reason=QString() |
|
) |
|
|
|
setHasConfigurationInterface |
( |
self, |
|
|
|
bool |
hasInterface |
|
) |
|
|
|
Sets whether or not this script has a configuration interface or not
@arg hasInterface true if the applet is user configurable
Returns the shape of the widget, defaults to the bounding rect
showConfigurationInterface |
( |
|
self ) |
|
Show a configuration dialog.
Returns the area within which contents can be painted.
- Returns:
- a standard Plasma applet configuration dialog, ready
to have pages added to it.
Note that the dialog returned is set to delete on close.