qml: wizard to check if wallet name is already used
was erroring at the very last moment previously
This commit is contained in:
@@ -5,7 +5,7 @@ import QtQuick.Controls 2.1
|
|||||||
import org.electrum 1.0
|
import org.electrum 1.0
|
||||||
|
|
||||||
WizardComponent {
|
WizardComponent {
|
||||||
valid: wallet_name.text.length > 0
|
valid: wallet_name.text.length > 0 && !Daemon.availableWallets.wallet_name_exists(wallet_name.text)
|
||||||
|
|
||||||
function apply() {
|
function apply() {
|
||||||
wizard_data['wallet_name'] = wallet_name.text
|
wizard_data['wallet_name'] = wallet_name.text
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ class QEWalletListModel(QAbstractListModel):
|
|||||||
self.wallets = wallets
|
self.wallets = wallets
|
||||||
self.endRemoveRows()
|
self.endRemoveRows()
|
||||||
|
|
||||||
|
@pyqtSlot(str, result=bool)
|
||||||
def wallet_name_exists(self, name):
|
def wallet_name_exists(self, name):
|
||||||
for wallet_name, wallet_path in self.wallets:
|
for wallet_name, wallet_path in self.wallets:
|
||||||
if name == wallet_name:
|
if name == wallet_name:
|
||||||
|
|||||||
Reference in New Issue
Block a user