From 252cb491c889fb84df965f9aff87165e11c9b08e Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 6 Oct 2017 16:50:05 +0200 Subject: [PATCH] show message when copy button is pressed --- gui/qt/util.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gui/qt/util.py b/gui/qt/util.py index 109f97d6..445cefce 100644 --- a/gui/qt/util.py +++ b/gui/qt/util.py @@ -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):