Browse Source

qml: add confirm dialog before disabling recoverable channels (similar to trampoline)

master
ThomasV 3 years ago
parent
commit
f562ad38cf
  1. 17
      electrum/gui/qml/components/Preferences.qml

17
electrum/gui/qml/components/Preferences.qml

@ -287,10 +287,25 @@ Pane {
Switch {
id: useRecoverableChannels
onCheckedChanged: {
if (activeFocus)
if (activeFocus) {
if (!checked) {
var dialog = app.messageDialog.createObject(app, {
text: qsTr('Are you sure? This option allows you to recover your lightning funds if you lose your device, or if you uninstall this app while lightning channels are active. Do not disable it unless you know how to recover channels from backups.'),
yesno: true
})
dialog.accepted.connect(function() {
Config.useRecoverableChannels = False
})
dialog.rejected.connect(function() {
checked = true // revert
})
dialog.open()
} else {
Config.useRecoverableChannels = checked
}
}
}
}
Label {
Layout.fillWidth: true
text: qsTr('Create recoverable channels')

Loading…
Cancel
Save