1
0

kivy settings: more intuitive "recoverable channels" toggle

Previously if the wallet did not have a deterministic node id,
the wallet info dialog could say "lightning enabled, non-recoverable channels", but
the "recoverable channels" setting could be toggled and might even say "yes".
This commit is contained in:
SomberNight
2021-06-11 15:00:06 +02:00
parent 325cd950a4
commit 3adb309d49

View File

@@ -24,6 +24,7 @@ Builder.load_string('''
title: _('Electrum Settings')
has_pin_code: False
use_encryption: False
enable_toggle_use_recoverable_channels: False
BoxLayout:
orientation: 'vertical'
ScrollView:
@@ -83,7 +84,8 @@ Builder.load_string('''
action: root.change_password
CardSeparator
SettingsItem:
status: _('Yes') if app.use_recoverable_channels else _('No')
disabled: not root.enable_toggle_use_recoverable_channels
status: _('Yes') if (app.use_recoverable_channels and not self.disabled) else _('No')
title: _('Create recoverable channels') + ': ' + self.status
description: _("Add channel recovery data to funding transaction.")
message: _(messages.MSG_RECOVERABLE_CHANNELS)
@@ -128,6 +130,7 @@ class SettingsDialog(Factory.Popup):
self.wallet = self.app.wallet
self.use_encryption = self.wallet.has_password() if self.wallet else False
self.has_pin_code = self.app.has_pin_code()
self.enable_toggle_use_recoverable_channels = self.wallet.lnworker and self.wallet.lnworker.has_deterministic_node_id()
def get_language_name(self):
return languages.get(self.config.get('language', 'en_UK'), '')