[Uml-devel] u2 gui design

Sebastian Stein seb_stein at gmx.de
Wed Apr 23 15:32:05 UTC 2003


Carsten Pfeiffer <carpdjih at mailbox.tu-berlin.de> [030424 00:19]:
> > i'm still not quite sure how to manage the dynamicness of the gui - things
> > getting added, removed. but then i haven't done a whole lot of gui
> > programming with qt. oh well. i guess i'll learn as i go :) it's not going
> > to be pretty though!
> 
> Do you know about XMLGUI and KAction? They provide useful abstractions for 
> dynamic GUIs. Look at Konqueror's views or KOffice's -- e.g. menubars and 
> toolbars adjust to the current view's capabilities (i.e. their provided 
> actions).

I'm pretty sure that KAction and XMLGUI is the way to go. Here are the basic
steps:

- define a KAction object for every action in the program like "add class"
- define the basic menu structure in an XML file
- let the XMLGUIBuilder build the whole menu for you

It is very easy, but, and now I hope someone can step in, I don't know how
to handle dynamic menus.

I mean we have a central XML file for the menu structure. And yes, if the
user likes he can edit this file to customize the menu structure. But that
is not what we want. We want a plugin to change the menu structure, add an
entry when the plugin gets loaded, remove an entry when the plugin gets
removed.
The question is hoow do I update the XML file? I think it would be not the
right solution to parse the XML file, insert the plugin specific stuff, save
it back (maybe to /tmp) and call the gui builder function again.
So, the problem are plugins which we don't know during Umbrello's
compilation. The plugin should decide where to plug into the menu, toolbar.
It is not Umbrellos task.

I haven't seen any examples about this specific problem. Only some lines say
it is useful for dynamic plugin loading, but that's all.

Steinchen
-- 
Umbrello UML Modeller
Description     : UML diagram drawing tool for KDE with code generation
Homepage        : http://www.umbrello.org/




More information about the umbrello-devel mailing list