Browse Source

show_lightning_invoice: minor improvements

patch-4
ThomasV 3 years ago
parent
commit
4ff1ed5de5
  1. 13
      electrum/gui/qt/main_window.py

13
electrum/gui/qt/main_window.py

@ -1449,8 +1449,14 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
d = WindowModalDialog(self, _("Lightning Invoice"))
vbox = QVBoxLayout(d)
grid = QGridLayout()
grid.addWidget(QLabel(_("Node ID") + ':'), 0, 0)
grid.addWidget(QLabel(lnaddr.pubkey.serialize().hex()), 0, 1)
pubkey_e = ButtonsLineEdit(lnaddr.pubkey.serialize().hex())
pubkey_e.setFont(QFont(MONOSPACE_FONT))
pubkey_e.add_qr_show_button(config=self.config, title=_("Public Key"))
pubkey_e.addCopyButton()
pubkey_e.setReadOnly(True)
pubkey_e.setMinimumWidth(700)
grid.addWidget(QLabel(_("Public Key") + ':'), 0, 0)
grid.addWidget(pubkey_e, 0, 1)
grid.addWidget(QLabel(_("Amount") + ':'), 1, 0)
amount_str = self.format_amount(invoice.get_amount_sat()) + ' ' + self.base_unit()
grid.addWidget(QLabel(amount_str), 1, 1)
@ -1464,11 +1470,14 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
grid.addWidget(QLabel(_('Features') + ':'), 5, 0)
grid.addWidget(QLabel('\n'.join(lnaddr.get_features().get_names())), 5, 1)
payhash_e = ButtonsLineEdit(lnaddr.paymenthash.hex())
payhash_e.setFont(QFont(MONOSPACE_FONT))
payhash_e.add_qr_show_button(config=self.config, title=_("Payment Hash"))
payhash_e.addCopyButton()
payhash_e.setReadOnly(True)
grid.addWidget(QLabel(_("Payment Hash") + ':'), 6, 0)
grid.addWidget(payhash_e, 6, 1)
invoice_e = ShowQRTextEdit(config=self.config)
invoice_e.setFont(QFont(MONOSPACE_FONT))
invoice_e.addCopyButton()
invoice_e.setText(invoice.lightning_invoice)
grid.addWidget(QLabel(_('Text') + ':'), 7, 0)

Loading…
Cancel
Save