add paste button to qt payto_e. fixes #6878
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user