[kde-doc-english]Re: Tool to check the menu items and the GUI labels

Stephan Kulow coolo at kde.org
Sun Feb 17 18:41:59 CET 2002


On Sonntag, 17. Februar 2002 19:36, Matthias Hölzer-Klüpfel wrote:
> On Tuesday 12 February 2002 11:05, Thomas Diehl wrote:
> > Looking forward to Matthias Hoelzer's tool Stephan was talking about.
> > Don't know any details but maybe it could be committed shortly after 3.0
> > and be used for 3.0.1 translations already (presuming there will be a 0.1
> > as usual).
>
> Hi Thomas et al.,
>
> I think I should provide some more details, so your expectations don't get
> too high.
>
> What I have implemented isn't a tool, but a mechanism to automatically
> assign accelerators to widgets. It is used like this:
>
> KAcceleratorManager::manage(yourDialogOrMenu);
>
> What it does is this:
>
> 1) It will check all the child widgets, finding those who will accept an
> accelerator
> 2) It will determine, for each character in each label, a weight that tells
> how good this character would be as accelarator. It takes into account:
>  o word beginnings
>  o already assigned accelerators
>  o the position inside the text
>  o the widget-type
> 3) After the weights are determined, reassigns the accelerators according
> to these weights
>
> This algorithm has some advantages:
>  o there are never accelerator conflicts
>  o the 'important' widgets 'usually' get 'nice' accelerators
>
> It also has some disadvantages:
>  o the assignment of the accelerators can change when strings are added to
> the dialog
>  o the current form of the algorithm will not look for the optimal
> solution, trading in quality for speed
>  o it has to be called manually. Ideally, this mechnism would go into Qt
> instead.
>  o it will not work nicely with e.g. asian languages (although coolo
> suggested a possible solution to this problem)
>
> And of course, this is highly experimental. The weights used will need
> tweaking, the algorithm finding the accelerators based on the weight could
> be improved a lot. People simply might be annoyed by changing accelerators
> etc. etc. But it definitely improves the situation wrt accelerator
> conflicts.
>
> Locally, I use KAcceleratorManager on the K menu inside kicker, and it is
> very usefull there. I guess what I will do after 3.0 is to commit the class
> to kdeui, enabling it only inside the KPanelMenu and ask you to give it a
> try in ordinary dialogs. Does this sound ok?
We could at least enable it with a hot key, so that you could run it and the 
class suggests changes instead of drklash just giving a list :)

Greetings, Stephan




More information about the kde-doc-english mailing list