From f36d7872c3dab4eec52bab5e8f1fe876cc9bb7cd Mon Sep 17 00:00:00 2001 From: bitromortac Date: Fri, 30 Oct 2020 10:46:45 +0100 Subject: [PATCH] qt: move local node id to info menu --- electrum/gui/qt/channels_list.py | 21 +++++++-------------- electrum/gui/qt/main_window.py | 4 ++++ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/electrum/gui/qt/channels_list.py b/electrum/gui/qt/channels_list.py index caa1b9406..985245c2f 100644 --- a/electrum/gui/qt/channels_list.py +++ b/electrum/gui/qt/channels_list.py @@ -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) diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index c93af5daf..84b70bab2 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -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)