1
0

qt: move local node id to info menu

This commit is contained in:
bitromortac
2020-10-30 10:46:45 +01:00
parent 085056532c
commit f36d7872c3
2 changed files with 11 additions and 14 deletions

View File

@@ -329,11 +329,6 @@ class ChannelsList(MyTreeView):
d = WindowModalDialog(self.parent, _('Open Channel'))
vbox = QVBoxLayout(d)
vbox.addWidget(QLabel(_('Enter Remote Node ID or connection string or invoice')))
local_nodeid = FreezableLineEdit()
local_nodeid.setMinimumWidth(700)
local_nodeid.setText(bh2u(lnworker.node_keypair.pubkey))
local_nodeid.setFrozen(True)
local_nodeid.setCursorPosition(0)
remote_nodeid = QLineEdit()
remote_nodeid.setMinimumWidth(700)
amount_e = BTCAmountEdit(self.parent.get_decimal_point)
@@ -380,15 +375,13 @@ class ChannelsList(MyTreeView):
max_button.repaint() # macOS hack for #6269
clear_button.clicked.connect(on_clear)
h = QGridLayout()
h.addWidget(QLabel(_('Your Node ID')), 0, 0)
h.addWidget(local_nodeid, 0, 1, 1, 3)
h.addWidget(QLabel(_('Remote Node ID')), 1, 0)
h.addWidget(remote_nodeid, 1, 1, 1, 3)
h.addWidget(suggest_button, 2, 1)
h.addWidget(clear_button, 2, 2)
h.addWidget(QLabel('Amount'), 3, 0)
h.addWidget(amount_e, 3, 1)
h.addWidget(max_button, 3, 2)
h.addWidget(QLabel(_('Remote Node ID')), 0, 0)
h.addWidget(remote_nodeid, 0, 1, 1, 3)
h.addWidget(suggest_button, 1, 1)
h.addWidget(clear_button, 1, 2)
h.addWidget(QLabel('Amount'), 2, 0)
h.addWidget(amount_e, 2, 1)
h.addWidget(max_button, 2, 2)
vbox.addLayout(h)
ok_button = OkButton(d)
ok_button.setDefault(True)

View File

@@ -2318,6 +2318,10 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
grid.addWidget(QLabel(_('Lightning') + ':'), 5, 0)
if self.wallet.can_have_lightning():
grid.addWidget(QLabel(_('Enabled')), 5, 1)
local_nodeid = QLabel(bh2u(self.wallet.lnworker.node_keypair.pubkey))
local_nodeid.setTextInteractionFlags(Qt.TextSelectableByMouse)
grid.addWidget(QLabel(_('Lightning Node ID:')), 6, 0)
grid.addWidget(local_nodeid, 6, 1, 1, 3)
else:
grid.addWidget(QLabel(_("Not available for this wallet.")), 5, 1)
grid.addWidget(HelpButton(_("Lightning is currently restricted to HD wallets with p2wpkh addresses.")), 5, 2)