Browse Source

add auth_message to delete_wallet

This changes the flow slightly: pin confirmation is asked after
we have checked that the wallet does not have open channels,
which is better
master
ThomasV 3 years ago
parent
commit
73dd6827e0
  1. 11
      electrum/gui/qml/components/WalletDetails.qml
  2. 1
      electrum/gui/qml/qedaemon.py

11
electrum/gui/qml/components/WalletDetails.qml

@ -24,15 +24,6 @@ Pane {
dialog.open()
}
function deleteWallet() {
var dialog = app.messageDialog.createObject(rootItem,
{'text': qsTr('Really delete this wallet?'), 'yesno': true})
dialog.accepted.connect(function() {
Daemon.checkThenDeleteWallet(Daemon.currentWallet)
})
dialog.open()
}
function changePassword() {
// trigger dialog via wallet (auth then signal)
Daemon.startChangePassword()
@ -418,7 +409,7 @@ Pane {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Delete Wallet')
onClicked: rootItem.deleteWallet()
onClicked: Daemon.checkThenDeleteWallet(Daemon.currentWallet)
icon.source: '../../icons/delete.png'
}
FlatButton {

1
electrum/gui/qml/qedaemon.py

@ -261,6 +261,7 @@ class QEDaemon(AuthMixin, QObject):
self.walletDeleteError.emit('balance', _('There are still coins present in this wallet. Really delete?'))
return
self.auth_message = _('Really delete this wallet?')
self.delete_wallet(wallet)
@auth_protect

Loading…
Cancel
Save