KXMLGUI - User definable toolbars and actions
Milian Wolff
mail at milianw.de
Mon Jun 14 16:29:12 BST 2010
On Monday, 14. June 2010 16:55:24 Andreas Pakulat wrote:
> On 14.06.10 16:15:54, Milian Wolff wrote:
> > I intend to port the Quanta3 feature for user definable toolbars properly
> > to KDE4 and thought that this should actually be a KDELibs core feature.
> >
> > Would there be anything against adding a "new toolbar" feature to the
> > 'ConfigureToolbars' dialog? There _all_ available actions of the
> > KActionCollection should be listed, contrary to the toolbars defined by
> > the application's UI.rc files.
> >
> > Is there anything from the KXMLGUI standpoint that would speak against
> > it? David Faure, I get that you are the one who knows the most about it?
> >
> > We want such a feature to make it possible for users to have custom
> > actions (e.g. to insert snippets, execute scripts, ...) in toolbars.
> >
> > Actually the latter is also a part that I don't quite understand on how
> > to implement properly using KXMLGUI. To my current understanding, I need
> > to register all available actions to KXMLGUI with the ui.rc file
> > beforehand, i.e. I cannot do that at runtime. Is that correct? Could
> > that be changed?
> >
> > In KDevelop we already have at least one point where we don't use KXMLGUI
> > but plain KShortcutWidget & KConfig to assign shortcuts to toolviews
> > (there can be an arbitrary amount of those).
>
> How did Quanta do this in KDE3? I mean xmlgui isn't a KDE4 feature, its
> been in there in KDE3 times as well and there's not been that many changes
> either.
>
> IMHO xmlgui is simply not the right tool for this job (but maybe I'm
> underestimating it?), its been designed to setup a static menu/toolbar
> layout and eventually let the user add/remove actions and configure
> shortcuts for them. Creating new actions on-the-fly or toolbars and
> managing this wasn't planned I think.
It did use XMLGUI as far as I understood Andras but it did quite a lot of
custom hackish things. Also the dialog to add toolbars was completely custom
written, but I can't belive that this is only required by Quanta. Quite the
contrary, I think many other apps, e.g. Kate for scripts, would benefit from a
good generic solution in kdelibs.
You can take a look at the half-way ported to KDE4 solution (it was not
working properly, so I don't isntall it anymore, but the code should be
enough):
http://gitorious.org/kdevelop/quanta/blobs/master/UNPORTED/quanta.cpp#line2577
Also interesting is probably:
http://gitorious.org/kdevelop/quanta/trees/master/UNPORTED/toolbar
Anyways, if there is no "clean" solution, I'll just take what was there and
make it work somehow. But still, I think this should be easier to do in
KDELibs since Quanta/KDevelop is probably not the only one that needs this...
--
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100614/fd5fbd60/attachment.sig>
More information about the kde-core-devel
mailing list