diff --git a/electrum/gui/qml/components/WalletMainView.qml b/electrum/gui/qml/components/WalletMainView.qml index 26249e76c..9680ae19d 100644 --- a/electrum/gui/qml/components/WalletMainView.qml +++ b/electrum/gui/qml/components/WalletMainView.qml @@ -89,7 +89,17 @@ Item { text: qsTr('Open/Create Wallet') Layout.alignment: Qt.AlignHCenter onClicked: { - stack.push(Qt.resolvedUrl('Wallets.qml')) + if (Daemon.availableWallets.rowCount() > 0) { + stack.push(Qt.resolvedUrl('Wallets.qml')) + } else { + var newww = app.newWalletWizard.createObject(app) + newww.walletCreated.connect(function() { + Daemon.availableWallets.reload() + // and load the new wallet + Daemon.load_wallet(newww.path, newww.wizard_data['password']) + }) + newww.open() + } } } } diff --git a/electrum/gui/qml/components/main.qml b/electrum/gui/qml/components/main.qml index 270e973eb..0d3cf58cd 100644 --- a/electrum/gui/qml/components/main.qml +++ b/electrum/gui/qml/components/main.qml @@ -223,16 +223,26 @@ ApplicationWindow }) dialog.accepted.connect(function() { var newww = app.newWalletWizard.createObject(app) - newww.open() newww.walletCreated.connect(function() { Daemon.availableWallets.reload() // and load the new wallet Daemon.load_wallet(newww.path, newww.wizard_data['password']) }) + newww.open() }) dialog.open() } else { - Daemon.load_wallet() + if (Daemon.availableWallets.rowCount() > 0) { + Daemon.load_wallet() + } else { + var newww = app.newWalletWizard.createObject(app) + newww.walletCreated.connect(function() { + Daemon.availableWallets.reload() + // and load the new wallet + Daemon.load_wallet(newww.path, newww.wizard_data['password']) + }) + newww.open() + } } }