KSelectAction

Thomas Zander zander at kde.org
Thu Jul 27 08:47:31 BST 2006


On Thursday 27 July 2006 05:53, Hamish Rodda wrote:
> > ahum;
> > stupid question time;  Why does the alteration of the text in the
> > menu due to the accel manager adding accels have any effect on the
> > text in the action?
>
> The menu gets its text from the actions, period.

Well, if you mean that any change made to the text is to be made to the 
action, then I think you are missing out on an easier solution. One that 
is just as correct from a design viewpoint.

To have that close a coupling there is just not working; that leaves no 
space for added accels without changing that should never be changed; the 
action.

I propose to add a KMenuItem class which has a action for a constructor 
and has a void setAccellerator(QChar char) and / or setAccellerator(int 
charPosition);
This class is the one that is added to the KMenu instead of the direct 
actions.

I've seen this work for many years in other toolkits and I think this is a 
better idea.

> > I think the design bug is when altering a widget that is controlled
> > by the action actually alters the action at the same time.  The
> > design pattern we saw everywhere until now was that there was a one
> > way direction. Alter the action and all widgets follow, not the other
> > way around.
>
> Right; this is another argument against accelerator managers; 

I get some negative vibes from you about that manager :)
Removing the accelerator manager is just not an option. GUIs are build 
more often without any accells assuming the manager will add them.  And 
thats a good thing.

Cheers!
-- 
Thomas Zander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060727/f62d5661/attachment.sig>


More information about the kde-core-devel mailing list