Kross
Kross::ScriptingPlugin Class Reference
The ScriptingPlugin class loads additional actions stored in rc files with the KrossScripting format, e.g. More...
#include <plugin.h>

Public Member Functions | |
void | addObject (QObject *object, const QString &name=QString()) |
ScriptingPlugin (QObject *parent=0) | |
virtual void | setDOMDocument (const QDomDocument &document, bool merge=false) |
virtual | ~ScriptingPlugin () |
Protected Slots | |
virtual void | slotEditScriptActions () |
virtual void | slotResetScriptActions () |
Detailed Description
The ScriptingPlugin class loads additional actions stored in rc files with the KrossScripting format, e.g.:
<KrossScripting> <collection name="file" text="File"> <script name="dummy_script" text="Dummy Script" comment="Dummy Script example" interpreter="python" file="dummy_script.py" /> </collection> </KrossScripting>
The 'name' attribute in collection element will be used to match the menu object name. If no menu already exists with this name, a new one is created. In this example, the user will see a menu item with the text "Dummy Script" in "File" menu, which will execute the dummy_script.py script.
By default it tries to find kross rc files in appdata "scripts" subdirectory. Clients of this class can use slotEditScriptActions() as a way to override and/or extend the default script actions (if they exist at all).
Definition at line 61 of file ui/plugin.h.
Constructor & Destructor Documentation
ScriptingPlugin::ScriptingPlugin | ( | QObject * | parent = 0 |
) | [explicit] |
ScriptingPlugin::~ScriptingPlugin | ( | ) | [virtual] |
Member Function Documentation
Add a QObject to the list of children.
The object will be published to the scripting code.
- Parameters:
-
object The QObject instance that should be added to the list of children. name The name the QObject should be known under. If not defined, the QObject's objectName is used.
Definition at line 73 of file ui/plugin.cpp.
void ScriptingPlugin::setDOMDocument | ( | const QDomDocument & | document, | |
bool | merge = false | |||
) | [virtual] |
Re-implement in order to load additional kross scripting rc files.
Definition at line 67 of file ui/plugin.cpp.
void ScriptingPlugin::slotEditScriptActions | ( | ) | [protected, virtual, slot] |
This slot will open/create a scriptactions.rc file at $KDEHOME/share/apps/application/scripts/ which will overide other kross rc files.
This allows a user to extend existing menus with new actions.
Definition at line 156 of file ui/plugin.cpp.
void ScriptingPlugin::slotResetScriptActions | ( | ) | [protected, virtual, slot] |
Deletes the user rc file, which has the effect of falling back to the default script actions (if any).
Definition at line 207 of file ui/plugin.cpp.
The documentation for this class was generated from the following files: