diff options
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r-- | src/qt/bitcoingui.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 8b0aba1b5b..a1becc12ec 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -163,6 +163,9 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : // Install event filter to be able to catch status tip events (QEvent::StatusTip) this->installEventFilter(this); + + // Initially wallet actions should be disabled + setWalletActionsEnabled(false); } BitcoinGUI::~BitcoinGUI() @@ -352,6 +355,7 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) bool BitcoinGUI::addWallet(const QString& name, WalletModel *walletModel) { + setWalletActionsEnabled(true); return walletFrame->addWallet(name, walletModel); } @@ -362,9 +366,26 @@ bool BitcoinGUI::setCurrentWallet(const QString& name) void BitcoinGUI::removeAllWallets() { + setWalletActionsEnabled(false); walletFrame->removeAllWallets(); } +void BitcoinGUI::setWalletActionsEnabled(bool enabled) +{ + overviewAction->setEnabled(enabled); + sendCoinsAction->setEnabled(enabled); + receiveCoinsAction->setEnabled(enabled); + historyAction->setEnabled(enabled); + encryptWalletAction->setEnabled(enabled); + backupWalletAction->setEnabled(enabled); + changePassphraseAction->setEnabled(enabled); + signMessageAction->setEnabled(enabled); + verifyMessageAction->setEnabled(enabled); + usedSendingAddressesAction->setEnabled(enabled); + usedReceivingAddressesAction->setEnabled(enabled); + openAction->setEnabled(enabled); +} + void BitcoinGUI::createTrayIcon(bool fIsTestnet) { #ifndef Q_OS_MAC |