Browse Source

qml: expose bolt11_fallback in preferences

patch-4
Sander van Grieken 2 years ago
parent
commit
ae15c0527b
  1. 12
      electrum/gui/qml/components/Preferences.qml
  2. 10
      electrum/gui/qml/qeconfig.py

12
electrum/gui/qml/components/Preferences.qml

@ -222,6 +222,17 @@ Pane {
Config.useGossip = currentValue == 'gossip'
}
}
Switch {
id: useFallbackAddress
text: qsTr('Use onchain fallback address for Lightning invoices')
Layout.columnSpan: 2
onCheckedChanged: {
if (activeFocus)
Config.useFallbackAddress = checked
}
}
}
}
@ -275,6 +286,7 @@ Pane {
fiatEnable.checked = Daemon.fx.enabled
spendUnconfirmed.checked = Config.spendUnconfirmed
lnRoutingType.currentIndex = Config.useGossip ? 0 : 1
useFallbackAddress.checked = Config.useFallbackAddress
var plugins = AppController.plugins
for (var i=0; i<plugins.length; i++) {

10
electrum/gui/qml/qeconfig.py

@ -120,6 +120,16 @@ class QEConfig(AuthMixin, QObject):
self.config.set_key('use_gossip', gossip)
self.useGossipChanged.emit()
useFallbackAddressChanged = pyqtSignal()
@pyqtProperty(bool, notify=useFallbackAddressChanged)
def useFallbackAddress(self):
return self.config.get('bolt11_fallback', True)
@useFallbackAddress.setter
def useFallbackAddress(self, use_fallback):
self.config.set_key('bolt11_fallback', use_fallback)
self.useFallbackAddressChanged.emit()
@pyqtSlot('qint64', result=str)
@pyqtSlot('qint64', bool, result=str)
@pyqtSlot(QEAmount, result=str)

Loading…
Cancel
Save