From 87909485c5075a63be209e023af693e2c33e4d2e Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 27 Apr 2023 08:47:02 +0000 Subject: [PATCH] qml: wizard to check if wallet name is already used was erroring at the very last moment previously --- electrum/gui/qml/components/wizard/WCWalletName.qml | 2 +- electrum/gui/qml/qedaemon.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/electrum/gui/qml/components/wizard/WCWalletName.qml b/electrum/gui/qml/components/wizard/WCWalletName.qml index 07d12f8bb..3da936ee1 100644 --- a/electrum/gui/qml/components/wizard/WCWalletName.qml +++ b/electrum/gui/qml/components/wizard/WCWalletName.qml @@ -5,7 +5,7 @@ import QtQuick.Controls 2.1 import org.electrum 1.0 WizardComponent { - valid: wallet_name.text.length > 0 + valid: wallet_name.text.length > 0 && !Daemon.availableWallets.wallet_name_exists(wallet_name.text) function apply() { wizard_data['wallet_name'] = wallet_name.text diff --git a/electrum/gui/qml/qedaemon.py b/electrum/gui/qml/qedaemon.py index cf6ba212b..6f4a50b5a 100644 --- a/electrum/gui/qml/qedaemon.py +++ b/electrum/gui/qml/qedaemon.py @@ -91,6 +91,7 @@ class QEWalletListModel(QAbstractListModel): self.wallets = wallets self.endRemoveRows() + @pyqtSlot(str, result=bool) def wallet_name_exists(self, name): for wallet_name, wallet_path in self.wallets: if name == wallet_name: