From 73dd6827e0c58b9bc56fe0c9518f531aebfcf48c Mon Sep 17 00:00:00 2001 From: ThomasV Date: Mon, 17 Apr 2023 17:54:55 +0200 Subject: [PATCH] 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 --- electrum/gui/qml/components/WalletDetails.qml | 11 +---------- electrum/gui/qml/qedaemon.py | 1 + 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/electrum/gui/qml/components/WalletDetails.qml b/electrum/gui/qml/components/WalletDetails.qml index 290b25bf0..f33fdf640 100644 --- a/electrum/gui/qml/components/WalletDetails.qml +++ b/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 { diff --git a/electrum/gui/qml/qedaemon.py b/electrum/gui/qml/qedaemon.py index 0dbfff7c8..25876a918 100644 --- a/electrum/gui/qml/qedaemon.py +++ b/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