commit 920d4c2b27190f5ad8f808cbe288855dbd171fa5
parent f994cd4a5d8e30da8f7261fab628eb0f4cd01988
Author: ThomasV <thomasv@electrum.org>
Date: Wed, 23 Jan 2019 17:17:13 +0100
simplify qr window
Diffstat:
2 files changed, 2 insertions(+), 36 deletions(-)
diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py
@@ -1080,7 +1080,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
uri = util.create_URI(addr, amount, message)
self.receive_qr.setData(uri)
if self.qr_window and self.qr_window.isVisible():
- self.qr_window.set_content(addr, amount, message, uri)
+ self.qr_window.qrw.setData(uri)
def set_feerounding_text(self, num_satoshis_added):
self.feerounding_text = (_('Additional {} satoshis are going to be added.')
diff --git a/electrum/gui/qt/qrwindow.py b/electrum/gui/qt/qrwindow.py
@@ -48,43 +48,9 @@ class QR_Window(QWidget):
QWidget.__init__(self)
self.win = win
self.setWindowTitle('Electrum - '+_('Payment Request'))
- self.setMinimumSize(800, 250)
- self.address = ''
- self.label = ''
- self.amount = 0
+ self.setMinimumSize(800, 800)
self.setFocusPolicy(Qt.NoFocus)
-
main_box = QHBoxLayout()
-
self.qrw = QRCodeWidget()
main_box.addWidget(self.qrw, 1)
-
- vbox = QVBoxLayout()
- main_box.addLayout(vbox)
-
- self.address_label = QLabel("")
- #self.address_label.setFont(QFont(MONOSPACE_FONT))
- vbox.addWidget(self.address_label)
-
- self.label_label = QLabel("")
- vbox.addWidget(self.label_label)
-
- self.amount_label = QLabel("")
- vbox.addWidget(self.amount_label)
-
- vbox.addStretch(1)
self.setLayout(main_box)
-
-
- def set_content(self, address, amount, message, url):
- address_text = "<span style='font-size: 18pt'>%s</span>" % address if address else ""
- self.address_label.setText(address_text)
- if amount:
- amount = self.win.format_amount(amount)
- amount_text = "<span style='font-size: 21pt'>%s</span> <span style='font-size: 16pt'>%s</span> " % (amount, self.win.base_unit())
- else:
- amount_text = ''
- self.amount_label.setText(amount_text)
- label_text = "<span style='font-size: 21pt'>%s</span>" % message if message else ""
- self.label_label.setText(label_text)
- self.qrw.setData(url)