Multiple main window support, and action-collections

Andreas Pakulat apaku at gmx.de
Sun Jul 26 13:17:38 UTC 2009


On 26.07.09 13:39:55, David Nolden wrote:
> I've tried fixing the multiple main window support. The problem is that 
> additional mainwindows contain none of the plugin actions, and thus are nearly 
> useless.
> 
> The plugins manage their actions through KXMLGuiClient, and when adding the 
> actions using that interface to additional main windows, all the actions are 
> removed from the standard main window. One KXMLGuiClient can only contribute 
> to one main-window as it seems.
> 
> So it seems like the current design is incompatible with multiple-main-window 
> support.
> 
> Now I'm thinking about adding something like
> "virtual KXMLGUIClient* 
> IPlugin::createActionsForMainWindow(Sublime::MainWindow* window)"
> 
> Where each plugin has to create a new KXMLGUIClient, fill it with actions, and 
> return it. Essentially the same thing that plugins do in their constructor 
> now.
> 
> Ideally then, IPlugin would not be based on KXMLGUIClient at all, since that 
> is not compatible with multiple-main-window support.
> 
> What do you think?

I don't like this, the plugin implementation shouldn't need to worry about
the mainwindows and the xmlgui stuff (except putting the actions into an
action collection and setting an xml file). 

So, how about having:

class IPlugin : public QObject
{
        QList<KAction*> actions();
        QString xmlFile();
}

And then simply do the xmlguiclient-stuff inside sublime and/or shell?

Andreas

-- 
You've been leading a dog's life.  Stay off the furniture.




More information about the KDevelop-devel mailing list