From b06e149d22a494139f9d87f9c9fde949d78353ab Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 15 Dec 2025 14:18:57 +0100 Subject: [PATCH 1/4] qt: channels_list: add tooltip to New Channel btn Adds tooltips to the "New Channel" button so users understand why it is disabled and what it does when it is enabled. --- electrum/gui/qt/channels_list.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/electrum/gui/qt/channels_list.py b/electrum/gui/qt/channels_list.py index 70514bdbfd8..c62d49c5a93 100644 --- a/electrum/gui/qt/channels_list.py +++ b/electrum/gui/qt/channels_list.py @@ -368,7 +368,11 @@ def create_toolbar(self, config): # and maybe add item "main_window.init_lightning_dialog()" when applicable menu.setEnabled(self.wallet.has_lightning()) self.new_channel_button = EnterButton(_('New Channel'), self.main_window.new_channel_dialog) - self.new_channel_button.setEnabled(self.wallet.can_have_lightning()) + if not self.wallet.can_have_lightning(): + self.new_channel_button.setEnabled(False) + self.new_channel_button.setToolTip(_("Lightning is not available for this wallet.")) + else: + self.new_channel_button.setToolTip(_("Open a channel to send payments over the Lightning network.")) toolbar.insertWidget(2, self.new_channel_button) return toolbar From ffdac41b7b44516ce33486202704041fac21cad7 Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 15 Dec 2025 14:25:06 +0100 Subject: [PATCH 2/4] qt: disable Submarine Payment tab if not swap_manager Disable the `Submarine Payments` tab if the swap_manager is None (the wallet has no lightning support). --- electrum/gui/qt/confirm_tx_dialog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/electrum/gui/qt/confirm_tx_dialog.py b/electrum/gui/qt/confirm_tx_dialog.py index 3961c09014b..5549d7e76a7 100644 --- a/electrum/gui/qt/confirm_tx_dialog.py +++ b/electrum/gui/qt/confirm_tx_dialog.py @@ -303,7 +303,8 @@ def update_tab_visibility(self): # always show onchain payment tab self.tab_widget.addTab(self.onchain_tab, _('Onchain Transaction')) - allow_swaps = self.allow_preview and self.payee_outputs # allow_preview is false for ln channel opening txs + # allow_preview is false for ln channel opening txs + allow_swaps = self.allow_preview and self.payee_outputs and self.swap_manager if self.config.WALLET_ENABLE_SUBMARINE_PAYMENTS and allow_swaps: i = self.tab_widget.addTab(self.submarine_payment_tab, _('Submarine Payment')) tooltip = self.config.cv.WALLET_ENABLE_SUBMARINE_PAYMENTS.get_long_desc() From 349f54e748716e5b97a8e722451eb9daa44c551c Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 15 Dec 2025 14:40:46 +0100 Subject: [PATCH 3/4] qt: disable ln configs in ConfirmTxDialog if no ln Disables the lightning related config options in the ConfirmTxDialog tools and shows an according tooltip if lightning is not available in the wallet. This should prevent confusion of users. --- electrum/gui/qt/confirm_tx_dialog.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qt/confirm_tx_dialog.py b/electrum/gui/qt/confirm_tx_dialog.py index 5549d7e76a7..b5aeb61a611 100644 --- a/electrum/gui/qt/confirm_tx_dialog.py +++ b/electrum/gui/qt/confirm_tx_dialog.py @@ -500,8 +500,23 @@ def cb(): self.resize_to_fit_content() self.pref_menu.addConfig(self.config.cv.GUI_QT_TX_EDITOR_SHOW_LOCKTIME, callback=cb) self.pref_menu.addSeparator() - self.pref_menu.addConfig(self.config.cv.WALLET_SEND_CHANGE_TO_LIGHTNING, callback=self.trigger_update) - self.pref_menu.addConfig(self.config.cv.WALLET_ENABLE_SUBMARINE_PAYMENTS, callback=self.update_tab_visibility) + can_have_lightning = self.wallet.can_have_lightning() + send_ch_to_ln = self.pref_menu.addConfig( + self.config.cv.WALLET_SEND_CHANGE_TO_LIGHTNING, + callback=self.trigger_update, + checked=False if not can_have_lightning else None, + ) + sub_payments = self.pref_menu.addConfig( + self.config.cv.WALLET_ENABLE_SUBMARINE_PAYMENTS, + callback=self.update_tab_visibility, + checked=False if not can_have_lightning else None, + ) + if not can_have_lightning: # disable the buttons and override tooltip + ln_unavailable_msg = _("Not available for this wallet.") \ + + "\n" + _("Requires a wallet with Lightning network support.") + for ln_conf in (send_ch_to_ln, sub_payments): + ln_conf.setEnabled(False) + ln_conf.setToolTip(ln_unavailable_msg) self.pref_menu.addToggle( _('Use change addresses'), self.toggle_use_change, From de58ecb7721be48be5a3f7b44a2ac2e528f1d8a7 Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 15 Dec 2025 14:47:16 +0100 Subject: [PATCH 4/4] qt: ConfirmTxDialog: also show Tools text Also show the `Tools` text besides the preferences icon so it looks equal to the main window. Originally this was a followup part of #10300 which got closed due to other reasons. --- electrum/gui/qt/confirm_tx_dialog.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/electrum/gui/qt/confirm_tx_dialog.py b/electrum/gui/qt/confirm_tx_dialog.py index b5aeb61a611..5456fa04d95 100644 --- a/electrum/gui/qt/confirm_tx_dialog.py +++ b/electrum/gui/qt/confirm_tx_dialog.py @@ -539,6 +539,8 @@ def cb(): self.pref_menu.addConfig(self.config.cv.WALLET_COIN_CHOOSER_OUTPUT_ROUNDING, callback=self.trigger_update) self.pref_button = QToolButton() self.pref_button.setIcon(read_QIcon("preferences.png")) + self.pref_button.setText(_('Tools')) + self.pref_button.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextBesideIcon) self.pref_button.setMenu(self.pref_menu) self.pref_button.setPopupMode(QToolButton.ToolButtonPopupMode.InstantPopup) self.pref_button.setFocusPolicy(Qt.FocusPolicy.NoFocus)