|
@ -60,11 +60,9 @@ class LightningTxDialog(WindowModalDialog): |
|
|
self.invoice = invoice.lightning_invoice |
|
|
self.invoice = invoice.lightning_invoice |
|
|
else: |
|
|
else: |
|
|
self.invoice = '' |
|
|
self.invoice = '' |
|
|
|
|
|
|
|
|
self.setMinimumWidth(700) |
|
|
self.setMinimumWidth(700) |
|
|
vbox = QVBoxLayout() |
|
|
vbox = QVBoxLayout() |
|
|
self.setLayout(vbox) |
|
|
self.setLayout(vbox) |
|
|
|
|
|
|
|
|
amount_str = self.parent.format_amount_and_units(self.amount, timestamp=self.timestamp) |
|
|
amount_str = self.parent.format_amount_and_units(self.amount, timestamp=self.timestamp) |
|
|
vbox.addWidget(QLabel(_("Amount") + f": {amount_str}")) |
|
|
vbox.addWidget(QLabel(_("Amount") + f": {amount_str}")) |
|
|
if self.is_sent: |
|
|
if self.is_sent: |
|
@ -74,28 +72,15 @@ class LightningTxDialog(WindowModalDialog): |
|
|
vbox.addWidget(QLabel(_("Fee") + f": {fee_str}")) |
|
|
vbox.addWidget(QLabel(_("Fee") + f": {fee_str}")) |
|
|
time_str = datetime.datetime.fromtimestamp(self.timestamp).isoformat(' ')[:-3] |
|
|
time_str = datetime.datetime.fromtimestamp(self.timestamp).isoformat(' ')[:-3] |
|
|
vbox.addWidget(QLabel(_("Date") + ": " + time_str)) |
|
|
vbox.addWidget(QLabel(_("Date") + ": " + time_str)) |
|
|
|
|
|
|
|
|
vbox.addWidget(QLabel(_("Payment hash") + ":")) |
|
|
vbox.addWidget(QLabel(_("Payment hash") + ":")) |
|
|
self.hash_e = ShowQRLineEdit(self.payment_hash, self.config, title=_("Payment hash")) |
|
|
self.hash_e = ShowQRLineEdit(self.payment_hash, self.config, title=_("Payment hash")) |
|
|
vbox.addWidget(self.hash_e) |
|
|
vbox.addWidget(self.hash_e) |
|
|
|
|
|
|
|
|
vbox.addWidget(QLabel(_("Preimage") + ":")) |
|
|
vbox.addWidget(QLabel(_("Preimage") + ":")) |
|
|
self.preimage_e = ShowQRLineEdit(self.preimage, self.config, title=_("Preimage")) |
|
|
self.preimage_e = ShowQRLineEdit(self.preimage, self.config, title=_("Preimage")) |
|
|
vbox.addWidget(self.preimage_e) |
|
|
vbox.addWidget(self.preimage_e) |
|
|
|
|
|
|
|
|
vbox.addWidget(QLabel(_("Lightning Invoice") + ":")) |
|
|
vbox.addWidget(QLabel(_("Lightning Invoice") + ":")) |
|
|
self.invoice_e = ShowQRTextEdit(self.invoice, config=self.config) |
|
|
self.invoice_e = ShowQRTextEdit(self.invoice, config=self.config) |
|
|
self.invoice_e.setMaximumHeight(150) |
|
|
self.invoice_e.setMaximumHeight(150) |
|
|
self.invoice_e.addCopyButton() |
|
|
self.invoice_e.addCopyButton() |
|
|
vbox.addWidget(self.invoice_e) |
|
|
vbox.addWidget(self.invoice_e) |
|
|
|
|
|
|
|
|
vbox.addLayout(Buttons(CloseButton(self))) |
|
|
vbox.addLayout(Buttons(CloseButton(self))) |
|
|
|
|
|
|
|
|
def show_qr(self, line_edit, title=''): |
|
|
|
|
|
def f(): |
|
|
|
|
|
text = line_edit.text() |
|
|
|
|
|
try: |
|
|
|
|
|
self.parent.show_qrcode(text, title, parent=self) |
|
|
|
|
|
except Exception as e: |
|
|
|
|
|
self.show_message(repr(e)) |
|
|
|
|
|
return f |
|
|
|
|
|