1
1
mirror of https://github.com/bitcoin/bitcoin.git synced 2024-05-17 23:56:39 +00:00

gui: Call setWalletActionsEnabled(true) only for the first wallet

This commit is contained in:
Hennadii Stepanov 2020-08-03 12:25:34 +03:00
parent a78742830a
commit 20c9e03554
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

View File

@ -664,14 +664,15 @@ void BitcoinGUI::addWallet(WalletModel* walletModel)
{ {
if (!walletFrame) return; if (!walletFrame) return;
if (!walletFrame->addWallet(walletModel)) return; if (!walletFrame->addWallet(walletModel)) return;
const QString display_name = walletModel->getDisplayName();
setWalletActionsEnabled(true);
rpcConsole->addWallet(walletModel); rpcConsole->addWallet(walletModel);
m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel)); if (m_wallet_selector->count() == 0) {
if (m_wallet_selector->count() == 2) { setWalletActionsEnabled(true);
} else if (m_wallet_selector->count() == 1) {
m_wallet_selector_label_action->setVisible(true); m_wallet_selector_label_action->setVisible(true);
m_wallet_selector_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) void BitcoinGUI::removeWallet(WalletModel* walletModel)