1
0

move recoverable channel option from preferences to new_channel_dialog toolbar

This commit is contained in:
ThomasV
2023-03-13 09:36:02 +01:00
parent b15387c89b
commit 4909cebdae
2 changed files with 9 additions and 12 deletions

View File

@@ -9,7 +9,8 @@ from electrum.lnworker import hardcoded_trampoline_nodes
from electrum import ecc
from electrum.util import NotEnoughFunds, NoDynamicFeeEstimates
from electrum.gui import messages
from . import util
from .util import (WindowModalDialog, Buttons, OkButton, CancelButton,
EnterButton, ColorScheme, WWLabel, read_QIcon, IconLabel,
char_width_in_lineedit)
@@ -33,6 +34,13 @@ class NewChannelDialog(WindowModalDialog):
self.trampoline_names = list(self.trampolines.keys())
self.min_amount_sat = min_amount_sat or MIN_FUNDING_SAT
vbox = QVBoxLayout(self)
toolbar, menu = util.create_toolbar_with_menu(self.config, '')
recov_tooltip = messages.to_rtf(_(messages.MSG_RECOVERABLE_CHANNELS))
menu.addConfig(
_("Create recoverable channels"), 'use_recoverable_channels', True,
tooltip=recov_tooltip,
).setEnabled(self.lnworker.can_have_recoverable_channels())
vbox.addLayout(toolbar)
msg = _('Choose a remote node and an amount to fund the channel.')
if min_amount_sat:
# only displayed if min_amount_sat is passed as parameter

View File

@@ -105,16 +105,6 @@ class SettingsDialog(QDialog, QtEventListener):
nz.valueChanged.connect(on_nz)
# lightning
help_recov = _(messages.MSG_RECOVERABLE_CHANNELS)
recov_cb = QCheckBox(_("Create recoverable channels"))
enable_toggle_use_recoverable_channels = bool(self.wallet.lnworker and self.wallet.lnworker.can_have_recoverable_channels())
recov_cb.setEnabled(enable_toggle_use_recoverable_channels)
recov_cb.setToolTip(messages.to_rtf(help_recov))
recov_cb.setChecked(bool(self.config.get('use_recoverable_channels', True)) and enable_toggle_use_recoverable_channels)
def on_recov_checked(x):
self.config.set_key('use_recoverable_channels', bool(x))
recov_cb.stateChanged.connect(on_recov_checked)
help_trampoline = _(messages.MSG_HELP_TRAMPOLINE)
trampoline_cb = QCheckBox(_("Use trampoline routing (disable gossip)"))
trampoline_cb.setToolTip(messages.to_rtf(help_trampoline))
@@ -377,7 +367,6 @@ class SettingsDialog(QDialog, QtEventListener):
gui_widgets.append((msat_cb, None))
gui_widgets.append((thousandsep_cb, None))
lightning_widgets = []
lightning_widgets.append((recov_cb, None))
lightning_widgets.append((trampoline_cb, None))
lightning_widgets.append((instant_swaps_cb, None))
lightning_widgets.append((remote_wt_cb, self.watchtower_url_e))