xmlgui, DefineGroup vs. MergeLocal

Raphael Kubo da Costa kubito at gmail.com
Fri Aug 7 14:56:53 BST 2009


2009/8/7 Andreas Pakulat <apaku at gmx.de>:
> Hi,
>
> I need some input from the xmlgui experts (if there are any :).
>
> I've had a discussion with the maintainer of okteta about KDevelop's use
> of xmlgui's groups. Basically, KDevelop defines its File and other menus
> by creating various groups in it (like save_merge, new_merge etc.) and
> then using these groups in its plugins to properly order the menus.
>
> The problem is that apparently the groups are not used by any other
> xmlgui-using app/kpart except kate (which probably does so only because
> we're integrating it all the time). All other apps/kparts are using the
> append-attribute for <Action> which appends to one of the MergeLocal
> define things from ui_standards.xml in kdeui.
>
> Unfortunately it seems that xmlgui is incapable of merging the two
> (we're using append on the DefineGroup but thats not supported as far as
> I can see), which means all kpart actions of kparts that KDevelop embeds
> end up at the end of the menu.
>
> However the xsd file explicitly says that <Action append=''/> should not
> be used by kparts, but instead group should be used for merging kparts.
>
> Now I'm a bit confused as to wether the .xsd is just the theory and in
> practice everythings the other way around, or wether there's a bug in
> xmlgui somewhere or wether I should start and change all xmlgui files in
> apps/kparts to use groups?

I'm not sure I understood what your problem is. Some time ago I also
had some problems with menu items being shown at the end in Ark as
well.

I think the .xsd (as well as the .dtd in the same directory) are
correct: using <Action append="..." /> in a plugin or part isn't
supposed to work; instead, you use DefineGroup in your mainwindow's rc
file with the append attribute set to where you want to put it
according to ui_standards.rc and then use <Action group="..." /> in
your plugin/part rc. I recently added some information about this in
[1] after I got Ark working, everyone's very welcome to correct and
add any information, as the article still lacks some points.

In the KDevelop thread, someone mentions Konqueror working without
using groups; my guess is that since konqueror.rc (which is loaded by
a mainwindow) uses noMerge="1", the default ui_standards.rc entries
won't be loaded at all. Other actions not defined there are merged
because of the <Merge /> tag.

[1] http://techbase.kde.org/Development/Architecture/KDE4/XMLGUI_Technology#MergeLocal_.2F_Merge




More information about the kde-core-devel mailing list