tshow message when copy button is pressed - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 252cb491c889fb84df965f9aff87165e11c9b08e DIR parent 01108d8b47b24b05a54e5c45383d3f9e1dd4a232 HTML Author: ThomasV <thomasv@electrum.org> Date: Fri, 6 Oct 2017 16:50:05 +0200 show message when copy button is pressed Diffstat: M gui/qt/util.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- DIR diff --git a/gui/qt/util.py b/gui/qt/util.py t@@ -531,8 +531,11 @@ class ButtonsWidget(QWidget): def addCopyButton(self, app): self.app = app - f = lambda: self.app.clipboard().setText(str(self.text())) - self.addButton(":icons/copy.png", f, _("Copy to clipboard")) + self.addButton(":icons/copy.png", self.on_copy, _("Copy to clipboard")) + + def on_copy(self): + self.app.clipboard().setText(self.text()) + QToolTip.showText(QCursor.pos(), _("Text copied to clipboard"), self) class ButtonsLineEdit(QLineEdit, ButtonsWidget): def __init__(self, text=None):