From 20c9e035543892e322c7134e89eb33115678bb30 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Mon, 3 Aug 2020 12:25:34 +0300 Subject: gui: Call setWalletActionsEnabled(true) only for the first wallet --- src/qt/bitcoingui.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/qt/bitcoingui.cpp') diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index ebcc04a5eb..b95a1df196 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -664,14 +664,15 @@ void BitcoinGUI::addWallet(WalletModel* walletModel) { if (!walletFrame) return; if (!walletFrame->addWallet(walletModel)) return; - const QString display_name = walletModel->getDisplayName(); - setWalletActionsEnabled(true); rpcConsole->addWallet(walletModel); - m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel)); - if (m_wallet_selector->count() == 2) { + if (m_wallet_selector->count() == 0) { + setWalletActionsEnabled(true); + } else if (m_wallet_selector->count() == 1) { m_wallet_selector_label_action->setVisible(true); m_wallet_selector_action->setVisible(true); } + const QString display_name = walletModel->getDisplayName(); + m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel)); } void BitcoinGUI::removeWallet(WalletModel* walletModel) -- cgit v1.2.3