[PATCH] Recent file action on toolbars

Andras Mantia amantia at kde.org
Sun Sep 21 13:19:56 BST 2003


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

Hi,

 Datschge had an idea about improving the usability of the KDE applications by 
providing a list of the recently opened files on the toolbar in a similar way 
of how the history is presented in Konqueror: click on the icon brings up the 
open dialog and if you keep the mouse button pressed on the icon it shows you 
the recently opened files. I've implemented this in Quanta using the current 
kdelibs, but the goal would be to have it in every KDE application without 
much trouble. 
 Unfortunately the KRecentFilesAction plugged into the toolbar looks very ugly 
as it appears as (a large) combobox. My patch makes the KRecentFilesAction to 
show as the KToggleToolBarAction when it's plugged into a toolbar. The code 
itself is a simplified version of the KToggleToolBarAction code (eg. the 
popupmenu always appeares delayed). The current way of doing has two 
drawbacks:

- - the activate signal (which in the above case would bring up the open file 
dialog) must be connected after the action is created, as the ctor would be 
too crowded with two receivers and two slots, as right now the slot passes to 
the ctor is called when a recent file item is selected
- - if you use KStdAction::openRecent to get a pointer to a KRecentFilesAction 
action, you have to manually call setIcon(), otherwise the button will not 
have an icon.

The first item can be solved by adding more new ctors, but I don't think we 
really need it, the second can't be solved in a clean way, only by providing 
a new openRecent method which has an extra "icon" parameter.

Please review and comment. I hope you will like it.;-) 
My main concern is the reimplemented "virtual void plug()" method. Is it BC? 
If not, can this be done somehow with the virtual_hook? I never did something 
like that before.

Andras

- -- 
Quanta Plus developer - http://quanta.sourceforge.net
K Desktop Environment - http://www.kde.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQE/bZdtTQdfac6L/08RAvshAJwKHvL/Wozw/Y7dNt4L9dlMj40CpQCg2Rsq
nzhMRw1W6o57xMtL6t8gPFY=
=4GzL
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list