Skip to content

Commit d67883d

Browse files
author
MarcoFalke
committed
Merge bitcoin-core/gui#43: bugfix: Call setWalletActionsEnabled(true) only for the first wallet
20c9e03 gui: Call setWalletActionsEnabled(true) only for the first wallet (Hennadii Stepanov) Pull request description: On master (a787428) there is a bug: - open an encrypted wallet; please note that the "Encrypt Wallet..." menu item is disabled that is expected: ![Screenshot from 2020-08-03 12-38-37](https://user-images.githubusercontent.com/32963518/89169084-70060c80-d586-11ea-86b9-05ef38d08f41.png) - then open any other wallet; note that the "Encrypt Wallet..." menu item gets enabled that is wrong: ![Screenshot from 2020-08-03 12-42-36](https://user-images.githubusercontent.com/32963518/89169385-d68b2a80-d586-11ea-9813-a533a847e098.png) This PR fixes this bug. ACKs for top commit: jonasschnelli: Tested ACK 20c9e03 - I could reproduce the issue on master and have verify that this PR fixes it. achow101: ACK 20c9e03 Tree-SHA512: 2c9ab94bde8c4f413b0a95c05bf3a1a29f5910e0f99d6639a11dd77758c78af25b060b3fecd78117066ef15b113feb79870bc1347cc04289da915c00623e5787
2 parents 49984b4 + 20c9e03 commit d67883d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/qt/bitcoingui.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -669,14 +669,15 @@ void BitcoinGUI::addWallet(WalletModel* walletModel)
669669
{
670670
if (!walletFrame) return;
671671
if (!walletFrame->addWallet(walletModel)) return;
672-
const QString display_name = walletModel->getDisplayName();
673-
setWalletActionsEnabled(true);
674672
rpcConsole->addWallet(walletModel);
675-
m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel));
676-
if (m_wallet_selector->count() == 2) {
673+
if (m_wallet_selector->count() == 0) {
674+
setWalletActionsEnabled(true);
675+
} else if (m_wallet_selector->count() == 1) {
677676
m_wallet_selector_label_action->setVisible(true);
678677
m_wallet_selector_action->setVisible(true);
679678
}
679+
const QString display_name = walletModel->getDisplayName();
680+
m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel));
680681
}
681682

682683
void BitcoinGUI::removeWallet(WalletModel* walletModel)

0 commit comments

Comments
 (0)