commit 39fc72dad63b217ae040f82ffc0da2c5cfce2c92
parent 112ad72ceec6decfa2a5afa84fd411f5b8852a64
Author: ThomasV <thomasv@electrum.org>
Date: Sun, 27 Dec 2020 12:01:43 +0100
add paste button to qt payto_e. fixes #6878
Diffstat:
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py
@@ -1310,6 +1310,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
from .paytoedit import PayToEdit
self.amount_e = BTCAmountEdit(self.get_decimal_point)
self.payto_e = PayToEdit(self)
+ self.payto_e.addPasteButton(self.app)
msg = _('Recipient of the funds.') + '\n\n'\
+ _('You may enter a Bitcoin address, a label from your list of contacts (a list of completions will be proposed), or an alias (email-like address that forwards to a Bitcoin address)')
payto_label = HelpLabel(_('Pay to'), msg)
diff --git a/electrum/gui/qt/util.py b/electrum/gui/qt/util.py
@@ -790,6 +790,14 @@ class ButtonsWidget(QWidget):
self.app.clipboard().setText(self.text())
QToolTip.showText(QCursor.pos(), _("Text copied to clipboard"), self)
+ def addPasteButton(self, app):
+ self.app = app
+ self.addButton("copy.png", self.on_paste, _("Paste from clipboard"))
+
+ def on_paste(self):
+ self.setText(self.app.clipboard().text())
+
+
class ButtonsLineEdit(QLineEdit, ButtonsWidget):
def __init__(self, text=None):
QLineEdit.__init__(self, text)