[PATCH] Show the clipboard history when pressing the Paste button
Andras Mantia
amantia at kde.org
Mon Sep 22 10:28:22 BST 2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
Here is an implementation of Datschge's idea: provide a list of the
clipboard history under the Paste button (similar to the history in
Konqueror). This is a generic implementation and by applying the patch every
application will benefit of it without any change. It creates a new action
class (KPasteAction) which communicates with Klipper via dcop. Of course
there is no guarantee that Klipper is running, in that case the button works
like before, and the only item in the menu is the current clipboard content.
So the patch contains the KPasteAction class (the code could be simplified in
KDE 4.0 if we inherit from KToolBarPopupAction and make the popupMenu()
method virtual) and a change in the KStdAction, so for Paste this class will
be used.
I have only one problem with it that I couldn't solve cleanly: when a menu
item is selected, I change the clipboard with a DCOP call, but the clipboard
isn't changed immediately (see the debug output) and I have to use a
singleShot timer to send the "activated" signal. Otherwise the selected text
won't be pasted. I'm afraid a little about this issue as there may still be
cases when the timer is elapsed before the clipboard is set. Any better ideas
here? Setting the clipboard directly does not work and I get
"QClipboard::setData: Cannot set X11 selection owner for CLIPBOARD" in the
debug output.
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/bsC2TQdfac6L/08RAtqbAKCpC12OcWzWlsS0Muz5H7gdDwUEEwCdEIfW
uxM6g4ZMANw4ZHsxQU6Zf8E=
=CSCW
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kactionclasses.cpp.diff
Type: text/x-diff
Size: 4144 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20030922/82cf8c43/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kstdaction.cpp.patch
Type: text/x-diff
Size: 513 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20030922/82cf8c43/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kactionclasses.h.diff
Type: text/x-diff
Size: 1369 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20030922/82cf8c43/attachment-0001.diff>
More information about the kde-core-devel
mailing list