User actions/toolbars plugin

Andras Mantia amantia at kde.org
Tue May 17 23:28:02 UTC 2005


Hi,

 I have started to play with the KDevelop platform by starting to port 
one of the key functionalities of Quanta to an independent plugin, 
namely the user toolbars/actions functionality. This is about being 
able to create user actions (which can be of different type, like 
simple text, XML tags - this is Quanta specific or scripts) which can 
be organized in toolbars and those toolbars are 
loadable/saveable/shareable. Aside of the fact that currently the code 
is very messed up in a way (everything is linked together, it's not 
easy to separate the toolbar/action code from the rest of Quanta) I 
already faced a big problem: how to create the toolbars from inside a 
plugin?
 Those user toolbars are basicly KXMLGuiClient objects saved to disc as 
XML format. They are loaded from the disc, for each action a KAction 
derivate object is created and the KXMLGuiClient  is added to the main 
window's gui clients (guiFactory()->addClient()). The problem with this 
is that this will add a new toolbar, but I want more. I want to 
organize the toolbars in a tabwidget. So the plugin will add only one 
toolbar which is toggleable from the Settings/Toolbars menu and this 
one toolbar holds a tabwidget with the toolbars loaded by the user.
 In Quanta we achieve this by overriding KMainWindow::createContainer, 
which detects if the currently built object is a user toolbar or not, 
and if it is, it created in a different way than the normal toolbars. 
My problem is that I have no idea how can I do this from outside of 
KMainWindow (from a plugin).
 Any ideas are welcome.

Andras


-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20050517/ac4f2e34/attachment.sig>


More information about the KDevelop-devel mailing list