From 010b153ab26676ae345cbeca0cddb48d09bc2f3c Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 17 Jan 2025 12:15:24 +0100 Subject: [PATCH 1/2] qml: fix regression caused by ee42e09387b64ba8c5f40128d082ee1c0ac21b77 in qml, we need the password in-memory as the auth wrapper (@auth_protect) does not pass the password to the wrapped fn. --- electrum/gui/qml/qedaemon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qml/qedaemon.py b/electrum/gui/qml/qedaemon.py index 356427431..7f7c57b9d 100644 --- a/electrum/gui/qml/qedaemon.py +++ b/electrum/gui/qml/qedaemon.py @@ -251,8 +251,8 @@ class QEDaemon(AuthMixin, QObject): assert wallet is not None self._current_wallet = QEWallet.getInstanceFor(wallet) self.availableWallets.updateWallet(self._path) - if wallet.requires_unlock(): - wallet.unlock(password or None) + wallet.unlock(password or None) # not conditional on wallet.requires_unlock in qml, as + # the auth wrapper doesn't pass the entered password, but instead we rely on the password in memory self._loading = False self.loadingChanged.emit() self.walletLoaded.emit(self._name, self._path) From 19a4b149d302944acf3d3f0640a4a9ff513b0848 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 17 Jan 2025 13:02:28 +0100 Subject: [PATCH 2/2] qml: show proper Payment failed message when reason is empty (e.g. from previous session) also capitalisation consistency. --- electrum/gui/qml/components/WalletMainView.qml | 2 +- electrum/gui/qml/components/main.qml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/electrum/gui/qml/components/WalletMainView.qml b/electrum/gui/qml/components/WalletMainView.qml index 76123d99c..bfdb9f522 100644 --- a/electrum/gui/qml/components/WalletMainView.qml +++ b/electrum/gui/qml/components/WalletMainView.qml @@ -485,7 +485,7 @@ Item { var dialog = app.messageDialog.createObject(app, { title: qsTr('Error'), iconSource: Qt.resolvedUrl('../../icons/warning.png'), - text: message + text: message ? message : qsTr('Payment failed') }) dialog.open() } diff --git a/electrum/gui/qml/components/main.qml b/electrum/gui/qml/components/main.qml index daade9c63..e89afc227 100644 --- a/electrum/gui/qml/components/main.qml +++ b/electrum/gui/qml/components/main.qml @@ -613,10 +613,10 @@ ApplicationWindow } // TODO: add to notification queue instead of barging through function onPaymentSucceeded(key) { - notificationPopup.show(Daemon.currentWallet.name, qsTr('Payment Succeeded')) + notificationPopup.show(Daemon.currentWallet.name, qsTr('Payment succeeded')) } function onPaymentFailed(key, reason) { - notificationPopup.show(Daemon.currentWallet.name, qsTr('Payment Failed') + ': ' + reason) + notificationPopup.show(Daemon.currentWallet.name, qsTr('Payment failed') + ': ' + reason) } }