From dff435a745c57eac781080bf816147bd7a8ed302 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Tue, 4 Oct 2022 14:20:46 +0200 Subject: [PATCH] qml: expose use_recoverable_channels in config/preferences --- electrum/gui/qml/components/Preferences.qml | 22 +++++++++++++++------ electrum/gui/qml/qeconfig.py | 10 ++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/electrum/gui/qml/components/Preferences.qml b/electrum/gui/qml/components/Preferences.qml index 6c561a15c..b5d8c012d 100644 --- a/electrum/gui/qml/components/Preferences.qml +++ b/electrum/gui/qml/components/Preferences.qml @@ -148,6 +148,16 @@ Pane { } } + Switch { + id: useRbf + text: qsTr('Use Replace-By-Fee') + Layout.columnSpan: 2 + onCheckedChanged: { + if (activeFocus) + Config.useRbf = checked + } + } + Label { text: qsTr('Default request expiry') Layout.fillWidth: false @@ -224,22 +234,22 @@ Pane { } Switch { - id: useFallbackAddress - text: qsTr('Use onchain fallback address for Lightning invoices') + id: useRecoverableChannels + text: qsTr('Create recoverable channels') Layout.columnSpan: 2 onCheckedChanged: { if (activeFocus) - Config.useFallbackAddress = checked + Config.useRecoverableChannels = checked } } Switch { - id: useRbf - text: qsTr('Use Replace-By-Fee') + id: useFallbackAddress + text: qsTr('Use onchain fallback address for Lightning invoices') Layout.columnSpan: 2 onCheckedChanged: { if (activeFocus) - Config.useRbf = checked + Config.useFallbackAddress = checked } } diff --git a/electrum/gui/qml/qeconfig.py b/electrum/gui/qml/qeconfig.py index cc5663df2..f6d9a2c50 100644 --- a/electrum/gui/qml/qeconfig.py +++ b/electrum/gui/qml/qeconfig.py @@ -140,6 +140,16 @@ class QEConfig(AuthMixin, QObject): self.config.set_key('use_rbf', useRbf) self.useRbfChanged.emit() + useRecoverableChannelsChanged = pyqtSignal() + @pyqtProperty(bool, notify=useRecoverableChannelsChanged) + def useRecoverableChannels(self): + return self.config.get('use_recoverable_channels', True) + + @useRecoverableChannels.setter + def useRecoverableChannels(self, useRecoverableChannels): + self.config.set_key('use_recoverable_channels', useRecoverableChannels) + self.useRecoverableChannelsChanged.emit() + @pyqtSlot('qint64', result=str) @pyqtSlot('qint64', bool, result=str) @pyqtSlot(QEAmount, result=str)