KeyBindings & Friends in KDE 4.0

Benjamin Meyer ben at meyerhome.net
Sun May 23 00:15:07 BST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 22 May 2004 6:11 am, Olivier Goffart wrote:
> Le Samedi 22 Mai 2004 03:14, Benjamin Meyer a écrit :
> > Most applications have a one line function in them as follows:
> >
> > /**
> >  * Bring up the key configuration dialog.
> >  */
> > void KTron::configureKeys(){
> >   KKeyDialog::configure(actionCollection(), this);
> > }
> >
> > What if we made this a virtual function in KMainWindow?  Then for the
> > majority of applications they would only have to do:
> >
> > KStdAction::keyBindings(this, SLOT(configureKeys()), actionCollection());
>
> I've done a  KXMLGUIFactory::configureShortcuts()  slot.  so it's already
> possible to do
>
> KStdAction::keyBindings(factory(), SLOT(configureShortcuts()),
> actionCollection());

KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), 
actionCollection());

I presume is what you meant right?

> KXMLGUIFactory::configureShortcuts()  does not let to configure only the
> set of actions from the action collection, but every action of kparts or
> plugins.
>
> But AFAIK, only few applicaiton use that function.
> Maybe i should add a @see also  in the KKeyDialog::configure API doc

I have added a snippit, but please elaborate in the docs.

Anyone up for converting all of KDE?  If so join #kde-convert on irc :)  
Should take a little bit of work.  A very easy task.

> > Same with configuring the toolbars...
> >
> > KStdAction::configureToolbars(this, SLOT(configuretoolbars() ),
> > actionCollection(), "configuretoolbars");
> >
> > Or even go one step further when createGUI is called if a toolbar is
> > created the configure and show actions are automaticly added and handled
> > same with shortcuts.
> >
> > Also what about turning  setAutoSaveSettings() on by default rather then
> > having every single application have to call it (and some forgetting to)?
>
> Yes, i think the same
> cf http://lists.kde.org/?l=kde-core-devel&m=108316630008423&w=2

Did anything come of this thread?  Would it be easy to have it automaticly add 
the configure toolbar actions when createGUI is called if there are toolbars?

> > I am just thinking about things that almost every application
> > re-implements on their own even though it could be handled in one place
> > giving the user a more common experience across KDE.
> >
> > If this sounds like a good idea I'll add it to the kdelibs TODO list for
> > KDE4.
>
> Is it too late for KDE 3.3 ?

The last part about having KMainWindow save by default isn't too late (my 
virtual function idea would be).  Any objections to adding it?

- -Benjamin Meyer

- -- 
Public Key: http://www.csh.rit.edu/~benjamin/public_key.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAr98F1rZ3LTw38vIRAmz5AKCW4TQe6h0ckz7ma2JnZ2fXOVZmwACgmlCV
h2Aq/n2z9mkFUXlduf959Ms=
=dMeN
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list