KeyBindings & Friends in KDE 4.0

Benjamin Meyer ben at meyerhome.net
Sun May 23 05:32:34 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());
>
> 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
>
> > 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

I have created a small patch which adds two functions to configure the 
toolbars.

1) How do you verify the parent is a KMainWindow?

2) How do you make it so when you right click on a toolbar it calls this?

3) How do you have #2 and this setup automaticly if there is a toolbar and the 
application hasn't added a KStdAction::configureToolbars on its own?  Would 
this be done in createGUI() ?

- -Benjamin Meyer


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

iD8DBQFAsCli1rZ3LTw38vIRAroWAJ9mxOf2P30kPCWhHlqu41ZEzpyabQCgvtFF
AAOqJjzsbUh1emN4Nnm9rQg=
=7gZF
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff
Type: text/x-diff
Size: 2427 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040523/ef900a0d/attachment.diff>


More information about the kde-core-devel mailing list