aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-10-24 09:01:29 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-10-24 09:01:37 +0200
commitd67883d01e507dd22d1281f4a4860e79d6a46a47 (patch)
treed5c21b4a6887534b89a1f12eb49ca99162f6ed56 /src/qt
parent49984b44cfcd3fd0cef16c8ce97197973afc3c04 (diff)
parent20c9e035543892e322c7134e89eb33115678bb30 (diff)
downloadbitcoin-d67883d01e507dd22d1281f4a4860e79d6a46a47.tar.xz
Merge bitcoin-core/gui#43: bugfix: Call setWalletActionsEnabled(true) only for the first wallet
20c9e035543892e322c7134e89eb33115678bb30 gui: Call setWalletActionsEnabled(true) only for the first wallet (Hennadii Stepanov) Pull request description: On master (a78742830aa35bf57bcb0a4730977a1e5a1876bc) 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 20c9e035543892e322c7134e89eb33115678bb30 - I could reproduce the issue on master and have verify that this PR fixes it. achow101: ACK 20c9e035543892e322c7134e89eb33115678bb30 Tree-SHA512: 2c9ab94bde8c4f413b0a95c05bf3a1a29f5910e0f99d6639a11dd77758c78af25b060b3fecd78117066ef15b113feb79870bc1347cc04289da915c00623e5787
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/bitcoingui.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 0c2dcc3584..23370e6ad3 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -669,14 +669,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)