aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoingui.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-05-15 22:57:35 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-05-29 15:49:29 +0300
commit20e2e24e90d782219e853ef0676ac66dc6a9de6a (patch)
tree5b24e3705c844bd57f302c9837a17c5c8e89e331 /src/qt/bitcoingui.cpp
parent123b401e0acf3b26f149711bdf06d7f6eced1968 (diff)
downloadbitcoin-20e2e24e90d782219e853ef0676ac66dc6a9de6a.tar.xz
qt: Move WalletView connections from WalletFrame to BitcoinGUI
This changes remove some pointers to the BitcoinGUI instance that is required for the next commits. This commit does not change behavior.
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r--src/qt/bitcoingui.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 858010a38c..4fb693cc6e 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -670,7 +670,10 @@ WalletController* BitcoinGUI::getWalletController()
void BitcoinGUI::addWallet(WalletModel* walletModel)
{
if (!walletFrame) return;
- if (!walletFrame->addWallet(walletModel)) return;
+
+ WalletView* wallet_view = new WalletView(platformStyle, walletFrame);
+ if (!walletFrame->addWallet(walletModel, wallet_view)) return;
+
rpcConsole->addWallet(walletModel);
if (m_wallet_selector->count() == 0) {
setWalletActionsEnabled(true);
@@ -680,6 +683,18 @@ void BitcoinGUI::addWallet(WalletModel* walletModel)
}
const QString display_name = walletModel->getDisplayName();
m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel));
+
+ connect(wallet_view, &WalletView::outOfSyncWarningClicked, walletFrame, &WalletFrame::outOfSyncWarningClicked);
+ connect(wallet_view, &WalletView::transactionClicked, this, &BitcoinGUI::gotoHistoryPage);
+ connect(wallet_view, &WalletView::coinsSent, this, &BitcoinGUI::gotoHistoryPage);
+ connect(wallet_view, &WalletView::message, [this](const QString& title, const QString& message, unsigned int style) {
+ this->message(title, message, style);
+ });
+ connect(wallet_view, &WalletView::encryptionStatusChanged, this, &BitcoinGUI::updateWalletStatus);
+ connect(wallet_view, &WalletView::incomingTransaction, this, &BitcoinGUI::incomingTransaction);
+ connect(wallet_view, &WalletView::hdEnabledStatusChanged, this, &BitcoinGUI::updateWalletStatus);
+ connect(this, &BitcoinGUI::setPrivacy, wallet_view, &WalletView::setPrivacy);
+ wallet_view->setPrivacy(isPrivacyModeActivated());
}
void BitcoinGUI::removeWallet(WalletModel* walletModel)