Browse Source

add copy button to tx dialog

283
ThomasV 10 years ago
parent
commit
2f729c2505
  1. 4
      gui/qt/transaction_dialog.py
  2. 4
      gui/qt/util.py

4
gui/qt/transaction_dialog.py

@ -95,7 +95,9 @@ class TxDialog(QDialog):
b.setIcon(QIcon(":icons/qrcode.png"))
b.clicked.connect(self.show_qr)
self.buttons = [self.qr_button, self.sign_button, self.broadcast_button, self.save_button, self.cancel_button]
self.copy_button = CopyButton(lambda: str(self.tx), self.parent.app)
self.buttons = [self.copy_button, self.qr_button, self.sign_button, self.broadcast_button, self.save_button, self.cancel_button]
run_hook('transaction_dialog', self)
vbox.addLayout(Buttons(*self.buttons))

4
gui/qt/util.py

@ -138,9 +138,9 @@ class CloseButton(QPushButton):
self.setDefault(True)
class CopyButton(QPushButton):
def __init__(self, text, app):
def __init__(self, text_getter, app):
QPushButton.__init__(self, _("Copy"))
self.clicked.connect(lambda: app.clipboard().setText(str(text.toPlainText())))
self.clicked.connect(lambda: app.clipboard().setText(text_getter()))
class OkButton(QPushButton):
def __init__(self, dialog, label=None):

Loading…
Cancel
Save