xmlgui, DefineGroup vs. MergeLocal
Andreas Pakulat
apaku at gmx.de
Sat Sep 12 20:45:16 BST 2009
On 09.08.09 01:14:24, Andreas Pakulat wrote:
> On 08.08.09 18:56:52, David Faure wrote:
> > On Friday 07 August 2009, Raphael Kubo da Costa wrote:
> > > 2009/8/7 Andreas Pakulat <apaku at gmx.de>:
> > > > 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.
> >
> > I see much confusion in this thread ;)
> >
> > Please do not confuse the two merging features:
> > * the merging of the application's xmlgui file with ui_standards.rc,
> > which uses MergeLocal (in ui_standards.rc) and the append and noMerge attributes
> > (in the application's xmlgui file)
> > and
> > * the merging of xmlguiclients (like parts) into the application
> > (the xmlguifactory, more precisely),
> > which uses Merge and DefineGroup (in the host), and the group attribute (in the part).
> >
> > The reasons for this mess of two-different-kinds-of-merging are historical
> > -- Kurt was young ;).
> > I wanted to merge them (hehe) for kde-4, but this didn't happen.
> >
> > Please note that ui_standards.rc merging is not available for kparts
> > (this was also on the todo list for kde4, now for kde5; cf the "More long term"
> > section in the old kdeui/TODO.xmlgui).
>
> Ok, so if I understand this correctly an app having:
>
> <Menu name="File">
> <DefineGroup append="new_merge" group="new_merge"/>
> <Action name="app_new_file" append="new_merge" />
> </Menu>
>
> should be able to load properly written xmlgui clients that use
>
> <Menu name="File">
> <Action name="client_new_file" group="new_merge" />
> </Menu>
>
> If thats correct, then:
>
> a) Konquerors application xmlgui-rc file is broken as it doesn't define
> groups (well it defines some, but clearly not as many as it should given
> that its supposed to be able to embed any kpart)
> b) most xmlgui clients in svn currently use append instead of group for
> their actions
>
> The latter unfortunately means that embedding such a kpart into a "properly
> written" host application adds all those actions onto the end of the menu
> instead of at the proper MergeLocal positions defined by ui_standards.rc.
>
> My main question is: How to fix this, I'm up for trying to find all kparts
> in at least trunk+extragear and fix them to use group instead. However I
> have no idea what happens then when the host doesn't provide a group with
> that name.
Ping? David can you give me an answer to the above questions?
Andreas
--
Caution: breathing may be hazardous to your health.
More information about the kde-core-devel
mailing list