From faf0639b168b22df7ff92e57c766b89a231d7483 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 16 May 2021 00:13:58 +0300 Subject: [PATCH] qt: Connect WalletView signal to BitcoinGUI slot directly This change removes redundant intermediate WalletFrame connections. This commit does not change behavior. --- src/qt/bitcoingui.cpp | 5 ----- src/qt/walletframe.cpp | 7 +------ src/qt/walletframe.h | 6 ------ 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 17fffe20877..f60c1559ef3 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -208,11 +208,6 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty connect(labelBlocksIcon, &GUIUtil::ClickableLabel::clicked, this, &BitcoinGUI::showModalOverlay); connect(progressBar, &GUIUtil::ClickableProgressBar::clicked, this, &BitcoinGUI::showModalOverlay); -#ifdef ENABLE_WALLET - if(enableWallet) { - connect(walletFrame, &WalletFrame::requestedSyncWarningInfo, this, &BitcoinGUI::showModalOverlay); - } -#endif #ifdef Q_OS_MAC m_app_nap_inhibitor = new CAppNapInhibitor; diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp index 02b3c628679..1ea642cb3e0 100644 --- a/src/qt/walletframe.cpp +++ b/src/qt/walletframe.cpp @@ -88,7 +88,7 @@ bool WalletFrame::addWallet(WalletModel *walletModel) walletStack->addWidget(walletView); mapWalletViews[walletModel] = walletView; - connect(walletView, &WalletView::outOfSyncWarningClicked, this, &WalletFrame::outOfSyncWarningClicked); + connect(walletView, &WalletView::outOfSyncWarningClicked, gui, &BitcoinGUI::showModalOverlay); connect(walletView, &WalletView::transactionClicked, gui, &BitcoinGUI::gotoHistoryPage); connect(walletView, &WalletView::coinsSent, gui, &BitcoinGUI::gotoHistoryPage); connect(walletView, &WalletView::message, [this](const QString& title, const QString& message, unsigned int style) { @@ -263,8 +263,3 @@ WalletModel* WalletFrame::currentWalletModel() const WalletView* wallet_view = currentWalletView(); return wallet_view ? wallet_view->getWalletModel() : nullptr; } - -void WalletFrame::outOfSyncWarningClicked() -{ - Q_EMIT requestedSyncWarningInfo(); -} diff --git a/src/qt/walletframe.h b/src/qt/walletframe.h index f57f8678d69..1bb0fe0b3f0 100644 --- a/src/qt/walletframe.h +++ b/src/qt/walletframe.h @@ -47,10 +47,6 @@ class WalletFrame : public QFrame QSize sizeHint() const override { return m_size_hint; } -Q_SIGNALS: - /** Notify that the user has requested more information about the out-of-sync warning */ - void requestedSyncWarningInfo(); - private: QStackedWidget *walletStack; BitcoinGUI *gui; @@ -98,8 +94,6 @@ public Q_SLOTS: void usedSendingAddresses(); /** Show used receiving addresses */ void usedReceivingAddresses(); - /** Pass on signal over requested out-of-sync-warning information */ - void outOfSyncWarningClicked(); }; #endif // BITCOIN_QT_WALLETFRAME_H