Skip to content

Commit

Permalink
qt: Connect WalletView signal to BitcoinGUI slot directly
Browse files Browse the repository at this point in the history
This change removes redundant intermediate WalletFrame connections.

This commit does not change behavior.
  • Loading branch information
hebasto committed May 15, 2021
1 parent ac2761b commit faf0639
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
5 changes: 0 additions & 5 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 1 addition & 6 deletions src/qt/walletframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
}
6 changes: 0 additions & 6 deletions src/qt/walletframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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

0 comments on commit faf0639

Please sign in to comment.