Browse Source

fix tx dialog buttons using new widgets

283
ThomasV 10 years ago
parent
commit
66de592343
  1. 2
      gui/qt/seed_dialog.py
  2. 25
      gui/qt/transaction_dialog.py
  3. 2
      plugins/cosigner_pool.py

2
gui/qt/seed_dialog.py

@ -21,6 +21,8 @@ from PyQt4.QtCore import *
import PyQt4.QtCore as QtCore
from electrum.i18n import _
from electrum import mnemonic
from util import *
from qrcodewidget import QRCodeWidget, QRDialog
from qrtextedit import ShowQRTextEdit, ScanQRTextEdit

25
gui/qt/transaction_dialog.py

@ -37,8 +37,8 @@ from electrum import transaction
from electrum.bitcoin import base_encode
from electrum.plugins import run_hook
from util import MyTreeWidget
from util import MONOSPACE_FONT
from util import *
class TxDialog(QDialog):
@ -74,37 +74,28 @@ class TxDialog(QDialog):
vbox.addStretch(1)
self.buttons = buttons = QHBoxLayout()
vbox.addLayout( buttons )
buttons.addStretch(1)
self.sign_button = b = QPushButton(_("Sign"))
b.clicked.connect(self.sign)
buttons.addWidget(b)
self.broadcast_button = b = QPushButton(_("Broadcast"))
b.clicked.connect(lambda: self.parent.broadcast_transaction(self.tx))
b.hide()
buttons.addWidget(b)
self.save_button = b = QPushButton(_("Save"))
b.clicked.connect(self.save)
buttons.addWidget(b)
cancelButton = QPushButton(_("Close"))
cancelButton.clicked.connect(lambda: self.done(0))
buttons.addWidget(cancelButton)
cancelButton.setDefault(True)
self.cancel_button = b = QPushButton(_("Close"))
b.clicked.connect(lambda: self.done(0))
b.setDefault(True)
b = QPushButton()
self.qr_button = b = QPushButton()
b.setIcon(QIcon(":icons/qrcode.png"))
b.clicked.connect(self.show_qr)
buttons.insertWidget(1,b)
self.buttons = [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))
self.update()

2
plugins/cosigner_pool.py

@ -124,7 +124,7 @@ class Plugin(BasePlugin):
def transaction_dialog(self, d):
self.send_button = b = QPushButton(_("Send to cosigner"))
b.clicked.connect(lambda: self.do_send(d.tx))
d.buttons.insertWidget(2, b)
d.buttons.insert(2, b)
self.transaction_dialog_update(d)
@hook

Loading…
Cancel
Save