How to get a pointer for mainwindow?

Andras Mantia amantia at kde.org
Tue Mar 27 10:30:33 UTC 2007


On Tuesday 27 March 2007, Andreas Pakulat wrote:
> The question is: Why do you need that? I mean add an action to the
> mainwindow's ac? Plugins are XMLGuiClients and thus have their own
> actioncollection which gets merged using xmlgui description into the
> mainwindow.

This is about the user action's plugin, which means that inside the 
plugin you can define your own actions (so they are created from code, 
not from xmlgui), but those actions can be accessed from any other 
plugin. It is somewhat complicated and when I ported the code from 
Quanta to KDevelop, the sane solution was to add the actions to the 
mainwindow's collection.
The second issue was to display dialog boxes that have mainwindow as the 
parent. For example when such an action executes a command line 
application and the execution fails and a message box needs to be 
displayed there is no widget that we can use to have the parent, but 
the mainwindow. This is important for multiple screens and for focus 
steeling prevention, as if we pass 0L as parent, the dialog might 
appear in wrong place, while if mainwindow is the parent, it is sure 
that it will appear on top of KDevelop and on the same screen where the 
KDevelop window is.

I just talked with Alexander on IRC and I will add an 
IUiController::activeMainWindow call. The only problem is that the 
implementation of UiController::activeMainWindow has to be slightly 
changed so we can be sure that it never returns NULL.

Andras

-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20070327/26f63ba8/attachment.sig>


More information about the KDevelop-devel mailing list