[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: Patch: window menu keyboard shortcuts
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-11-14 12:37:24
[Download RAW message or body]

On Tuesday 14 November 2000 03:00, Keunwoo Lee wrote:
> [snip]

I like this idea very much.

There's a little bug in the code though: if the smart thing didn't manage
to put a '&' (it can happen, in a very crowded menu, "found" will still be false),
then activating the item won't work (if it can't find '&', it returns at once).

In fact, if we populate the menu using an iterator over the QMap, we don't
have to use the menu text to find the item when we know that item 5 has
been activated. All we need to do is to iterate again the QMap, to find
the 5th item. This way, slotProfileActivated can be rewritten much more cleanly.

> BTW "smart automatic hotkey generation" seems like it would be useful for
> other apps' dynamically generated menus, or for lazy programmers who don't
> want to manually set hotkeys in static menus.  It may be worthwhile at
> some point to factor this code into something reusable.

Yes, and in fact that's why I wouldn't want all this code to go into konq_viewmgr.
Somehow, what we want is a method (function) that takes a QStringList and
find a smart way to populate shortcuts into it.
We would then use the result to create the items. And maybe we don't even
need a QMap at that point, and we just have two qstringlists of the same
size, one with the texts (not even stored permanently in the class) and one
with the profile names (for slotProfileActivated).

What do you think ?

I know, it's always easy to give work to others :-}

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://www.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today
See http://www.kde.org/kde1-and-kde2.html for how to set up KDE 2

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic