Editable script actions
Paulo Moura Guedes
moura at kdewebdev.org
Wed Feb 27 15:43:33 GMT 2008
Hi,
Currently, scriptable applications can be extended using Kross but there is no
easy way to easily extend the menus with new actions which will execute the
user scripts. The attached patch tries to simplify that task in KXMLGUI
applications. It allows to place new actions in existing top menus (and
submenus) or to create new ones. It uses the Kross XML file format.
All an application has to do is to derive from KParts::ScriptableMainWindow
instead of KParts:MainWindow. Optionally one can use the two new
KStandardActions "edit_script_actions" and "reset_script_actions" and connect
with the slots provided by KParts::ScriptableMainWindow:
KStandardAction::editScriptActions(this, SLOT(slotEditScriptActions()),
actionCollection());
KStandardAction::resetScriptActions(this, SLOT(slotResetScriptActions()),
actionCollection());
The implementation of slotEditScriptActions() is just a proof of concept.
Comments?
Paulo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: editable_script_actions.diff.bz2
Type: application/x-bzip2
Size: 3040 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080227/9897ed65/attachment.bin>
More information about the kde-core-devel
mailing list