Browse Source

add paste button to qt payto_e. fixes #6878

patch-4
ThomasV 4 years ago
parent
commit
39fc72dad6
  1. 1
      electrum/gui/qt/main_window.py
  2. 8
      electrum/gui/qt/util.py

1
electrum/gui/qt/main_window.py

@ -1310,6 +1310,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
from .paytoedit import PayToEdit from .paytoedit import PayToEdit
self.amount_e = BTCAmountEdit(self.get_decimal_point) self.amount_e = BTCAmountEdit(self.get_decimal_point)
self.payto_e = PayToEdit(self) self.payto_e = PayToEdit(self)
self.payto_e.addPasteButton(self.app)
msg = _('Recipient of the funds.') + '\n\n'\ 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)') + _('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) payto_label = HelpLabel(_('Pay to'), msg)

8
electrum/gui/qt/util.py

@ -790,6 +790,14 @@ class ButtonsWidget(QWidget):
self.app.clipboard().setText(self.text()) self.app.clipboard().setText(self.text())
QToolTip.showText(QCursor.pos(), _("Text copied to clipboard"), self) 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): class ButtonsLineEdit(QLineEdit, ButtonsWidget):
def __init__(self, text=None): def __init__(self, text=None):
QLineEdit.__init__(self, text) QLineEdit.__init__(self, text)

Loading…
Cancel
Save