XMLGUI: preventing merges into a specific toolbar

Andras Mantia amantia at kde.org
Thu May 1 21:59:16 BST 2008


On Thursday 01 May 2008 12:15:29 Vladimir Prus wrote:
> Andras Mantia wrote:
> > On Tuesday 29 April 2008 16:42:07 David Faure wrote:
> >> It's an idea, but is it doable, given that KXmlGuiWindow is the
> >> KXmlGuiBuilder of its factory() already?
> >
> > I don't know. :) What I did is to change how things are plugged in a
> > KPart plugin (to a KXmlGuiClient). That works. :)
>
> Can you clarify, or maybe show the code? I don't see any methods in
> KXmlGUIBuilder that are remotely useful for filtering things. And the
> following bit of docs make be double-suspicious:

I didn't post the code as it needs some cleanup (there are some trials 
commented out, etc.).
But here it is:
http://websvn.kde.org/trunk/KDE/kdewebdev/quanta/plugins/usertoolbars/toolbarguibuilder.cpp?revision=797345&view=markup

This codes add the toolbars inside a custom widget instead of adding them as 
regular toolbars.

The idea is that createContainer is called for each UI element, eg. for each 
toolbar. You can  get the name there and simply not call 
KXMLGUIBuilder::createContainer to not insert a specific toolbar.

In your case you probably need to store a pointer to the old guibuilder object 
and call that one instead of the parent, because you already have a factory.


Andras
-- 
 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org




More information about the kde-core-devel mailing list