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

List:       kde-core-devel
Subject:    RE: KAction and KAccel
From:       "David Faure" <faure () kde ! org>
Date:       1999-11-30 9:26:46
[Download RAW message or body]

> Okay, thanks to Simon and David's help, I was able to figure out how
> to make KAction and KAccel work together.
>
> For the records (the list archives), here's the core stuff:
>
>     m_accelKeys->insertStdItem(KAccel::Open);
>     m_accelKeys->insertItem(i18n("Preferences"), "prefs",
>                             Qt::ALT + Qt::Key_P);
>
> 	m_openAct  = new KAction(i18n("&Open..."), QIconSet(BarIcon("fileopen")),
> 	                         KStdAccel::open(), this, SLOT(fileOpen()),
this);
> 	m_preferencesAct = new KAction(i18n("P&references..."),
> 	                               m_accelKeys->currentKey("prefs"),
>                                    this, SLOT(optionsPreferences()),
this);

Excellent.
I was wondering about this - all apps using KAction are NOT using KAccel
at the moment (ok, except yours now :) ) and they should be converted.

Although... Simon and Torben : didn't you say something about a key
configuration dialog based on KAction alone ? Hmmm... this wouldn't
allow restoring a previously saved configuration. Ok, it's probably better
to use KAccel then.

I strongly encourage everybody to do the same in his app - I'll do it in
konqueror.
IIRC the style guide suggest "Options/Configure Keys..." for the menu item
calling
the config dialog.

--
David Faure
faure@kde.org - KDE developer
david@mandrakesoft.com - Mandrake
david.faure@cramersystems.com - Cramer Systems

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

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