Revision 782676

Go back to digest for 9th March 2008

Features in KDE Base

Paulo Moura Guedes committed changes in /trunk/KDE/kdelibs/kross/ui:

Introduce a new class Kross::ScriptingPlugin wich extends KParts::Plugin with aditional logic to load Kross actions in the GUI.

One can create .rc files describing scripting actions that Kross can understand, e.g.:

<KrossScripting>
<collection name="file" text="File">
<script name="dummy_script" text="Dummy Script" comment="Dummy Script" interpreter="python" file="dummy_script.py" />
</collection>
</KrossScripting>

This plugin class will append this information to its XMLGUI, i.e., will create a new action named "Dummy Script" in the "File" menu.

There are to additional slots in this class:

virtual void slotEditScriptActions();
virtual void slotResetScriptActions();

The first one edit or create an user actions file, which will override/extends the default script actions.

The second one deletes the user actions file, which has the effect of falling back to the default script actions (if any)

Later, slotEditScriptActions() function can be improved to offer some kind of visual editor similar to Qt Designer.

Besides the possibility of extending applications by exposing a scripting interface, this will allow to extend the GUI with scripting actions which, IMHO, is a very powerful concept.

File Changes

Added 2 files
  • /trunk/KDE/kdelibs/kross/ui
  •   /plugin.cpp
  •   /plugin.h
Modified 1 files
  • /trunk/KDE/kdelibs/kross/ui/CMakeLists.txt
3 files changed in total