xmlgui, DefineGroup vs. MergeLocal

Andreas Pakulat apaku at gmx.de
Sun Oct 18 17:20:16 BST 2009


On 15.10.09 10:49:13, David Faure wrote:
> On Tuesday 13 October 2009, Andreas Pakulat wrote:
> > > > Why only there? Looking at the ui.rc of KDevelop almost all
> > > > DefineGroups which use an append have the same name for the group as
> > > > the name of the append location.
> > > >
> > > > Now, having to create the same standard groups in all hosts ui.rc
> > > > files, is that what you propose, Andreas? Or should this be rather be
> > > > done as kind of default by the XMLGUI code?
> > >
> > > Hmm. I see the benefit, this is a way to actually make (some of the)
> > > ui_standards.rc merging available to parts (and other guiclients), since
> > > it defines merging groups that happen to be exactly where the MergeLocals
> > > in ui_standards.rc are ;-)
> > > Clever; this way we don't really break existing parts, since they have to
> > > use group="...." explicitely.
> > >
> > > Doing this automatically is an option; I think it's as simple as adding
> > > <DefineGroup>s in ui_standards.rc, under each MergeLocal. Want to try
> > > that?
> > 
> > I'll try that over the weekend. Just to make sure I'm testing the right
> > thing: I'll add a <DefineGroup name="new_group" append="new_merge"/> to
> > ui_standards.rc 
> 
> Well if you add it to ui_standards.rc itself, you don't need the append 
> attribute. This was only a way to add groups "from the outside". But if you're 
> inside, it's simpler, just put the group where you want it ;)
> 
> > and then use that group for an action in kpart and see
> > wether it shows up in Konqueror along the "New" actions, right?
> 
> Yes.

Ok, I've done a similar test, simply moved a DefineGroup from my host
app (kdevelop) into ui_standards.rc and both the kate actions using that
group as well as the action from my own plugin still show up as
expected.

So should I go around and add a group for each MergeLocal using *_group?

One thing I did notice though: Katepartui.rc has this:

<Action name="edit_find" group="edit_find_merge" />

Isn't this superflous as edit_find is already defined in
ui_standards.rc?

Andreas

-- 
"Life, loathe it or ignore it, you can't like it."
		-- Marvin, "Hitchhiker's Guide to the Galaxy"




More information about the kde-core-devel mailing list