Multiple main window support, and action-collections

Andreas Pakulat apaku at gmx.de
Sun Jul 26 23:55:59 UTC 2009


On 27.07.09 02:29:17, Alexander Dymo wrote:
> > > Another possible but not very nice option would be creating multiple
> > > instances of a plugin and binding them to the mainwindow....
> >
> > I though of that as well. But that could really be quite messy.
> >
> > So now I'm about to commit something like the function above. It allows
> > creating a set of actions and setting an xml file.
> >
> > If required, a different function can be overloaded, which allows creating
> > a custom per-window KXMLGuiClient.
> 
> I'd say we need two functions in a plugin:
> 	//this would return action collection without a parent, and then will be
> 	//reparented to a mainwindow by mainwindow itself
> 	KActionCollection &IPlugin::guiActions()
> 	QString IPlugin::xmlGuiFile()
> and a function in MainWindowPrivate to create KXMLGUIClient instance based on 
> this information.

We now have this in one function instead.

> Another problem would be the simultaneous editing of xmlfiles from several 
> mainwindows. Say, if you have a plugin with action "foo" and assign a shortcut 
> from mainwindow 1. Will mainwindow 2 see this shortcut? Will it reset the 
> shortcut after editing them with configuration dialog?

Hmm, interesting question, I'd guess the latter as both instances will
open the xml file. So whoever closes last will gets its shortcuts
stored. Another reason for dropping xmlgui and doing the menu/toolbar
setup ourselves.

> /me wonders whether there're more problems possible...

I'm pretty sure there are, but I'm not sure any of that is fixable
within kdevelop. I really wonder wether its worth the trouble or we just
decide to either drop xmlgui or multi-mainwindow support.

Andreas
 
-- 
You have a strong appeal for members of the opposite sex.




More information about the KDevelop-devel mailing list