Skip to content

Commit 96b2719

Browse files
hebastoPiRK
authored andcommitted
gui: Call setWalletActionsEnabled(true) only for the first wallet
Summary: > On master there is a bug: > - open an encrypted wallet; please note that the "Encrypt Wallet..." menu item is disabled that is expected > - then open any other wallet; note that the "Encrypt Wallet..." menu item gets enabled that is wrong > This PR fixes this bug. This is a backport of [[bitcoin-core/gui#43 | core-gui#43]] Test Plan: `ninja all check-all` Failed to reproduce the bug after this change. Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D10604
1 parent 1cb6319 commit 96b2719

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/qt/bitcoingui.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -761,14 +761,15 @@ void BitcoinGUI::addWallet(WalletModel *walletModel) {
761761
if (!walletFrame->addWallet(walletModel)) {
762762
return;
763763
}
764-
const QString display_name = walletModel->getDisplayName();
765-
setWalletActionsEnabled(true);
766764
rpcConsole->addWallet(walletModel);
767-
m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel));
768-
if (m_wallet_selector->count() == 2) {
765+
if (m_wallet_selector->count() == 0) {
766+
setWalletActionsEnabled(true);
767+
} else if (m_wallet_selector->count() == 1) {
769768
m_wallet_selector_label_action->setVisible(true);
770769
m_wallet_selector_action->setVisible(true);
771770
}
771+
const QString display_name = walletModel->getDisplayName();
772+
m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel));
772773
}
773774

774775
void BitcoinGUI::removeWallet(WalletModel *walletModel) {

0 commit comments

Comments
 (0)