Skip to content

Commit

Permalink
Merge bitcoin-core/gui#333: refactor: Signal-slot connections cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto authored and jagdeep sidhu committed Jun 13, 2021
1 parent d17f356 commit 990da14
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 33 deletions.
9 changes: 2 additions & 7 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent)

// start with displaying the "out of sync" warnings
showOutOfSyncWarning(true);
connect(ui->labelWalletStatus, &QPushButton::clicked, this, &OverviewPage::handleOutOfSyncWarningClicks);
connect(ui->labelTransactionsStatus, &QPushButton::clicked, this, &OverviewPage::handleOutOfSyncWarningClicks);
connect(ui->labelWalletStatus, &QPushButton::clicked, this, &OverviewPage::outOfSyncWarningClicked);
connect(ui->labelTransactionsStatus, &QPushButton::clicked, this, &OverviewPage::outOfSyncWarningClicked);
}

void OverviewPage::handleTransactionClicked(const QModelIndex &index)
Expand All @@ -176,11 +176,6 @@ void OverviewPage::handleTransactionClicked(const QModelIndex &index)
Q_EMIT transactionClicked(filter->mapToSource(index));
}

void OverviewPage::handleOutOfSyncWarningClicks()
{
Q_EMIT outOfSyncWarningClicked();
}

void OverviewPage::setPrivacy(bool privacy)
{
m_privacy = privacy;
Expand Down
1 change: 0 additions & 1 deletion src/qt/overviewpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ private Q_SLOTS:
void handleTransactionClicked(const QModelIndex &index);
void updateAlerts(const QString &warnings);
void updateWatchOnlyLabels(bool showWatchOnly);
void handleOutOfSyncWarningClicks();
void setMonospacedFont(bool use_embedded_font);
};

Expand Down
7 changes: 1 addition & 6 deletions src/qt/syscoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,6 @@ SyscoinGUI::SyscoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty

connect(labelBlocksIcon, &GUIUtil::ClickableLabel::clicked, this, &SyscoinGUI::showModalOverlay);
connect(progressBar, &GUIUtil::ClickableProgressBar::clicked, this, &SyscoinGUI::showModalOverlay);
#ifdef ENABLE_WALLET
if(enableWallet) {
connect(walletFrame, &WalletFrame::requestedSyncWarningInfo, this, &SyscoinGUI::showModalOverlay);
}
#endif

#ifdef Q_OS_MAC
m_app_nap_inhibitor = new CAppNapInhibitor;
Expand Down Expand Up @@ -730,7 +725,7 @@ void SyscoinGUI::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::outOfSyncWarningClicked, this, &SyscoinGUI::showModalOverlay);
connect(wallet_view, &WalletView::transactionClicked, this, &SyscoinGUI::gotoHistoryPage);
connect(wallet_view, &WalletView::coinsSent, this, &SyscoinGUI::gotoHistoryPage);
connect(wallet_view, &WalletView::message, [this](const QString& title, const QString& message, unsigned int style) {
Expand Down
5 changes: 0 additions & 5 deletions src/qt/walletframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,3 @@ WalletModel* WalletFrame::currentWalletModel() const
WalletView* wallet_view = currentWalletView();
return wallet_view ? wallet_view->getWalletModel() : nullptr;
}

void WalletFrame::outOfSyncWarningClicked()
{
Q_EMIT requestedSyncWarningInfo();
}
5 changes: 0 additions & 5 deletions src/qt/walletframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +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();

void createWalletButtonClicked();

private:
Expand Down Expand Up @@ -100,8 +97,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 // SYSCOIN_QT_WALLETFRAME_H
7 changes: 1 addition & 6 deletions src/qt/walletview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ WalletView::WalletView(const PlatformStyle *_platformStyle, QWidget *parent):
// Clicking on a transaction on the overview pre-selects the transaction on the transaction history page
connect(overviewPage, &OverviewPage::transactionClicked, transactionView, qOverload<const QModelIndex&>(&TransactionView::focusTransaction));

connect(overviewPage, &OverviewPage::outOfSyncWarningClicked, this, &WalletView::requestedSyncWarningInfo);
connect(overviewPage, &OverviewPage::outOfSyncWarningClicked, this, &WalletView::outOfSyncWarningClicked);

connect(sendCoinsPage, &SendCoinsDialog::coinsSent, this, &WalletView::coinsSent);
// Highlight transaction after send
Expand Down Expand Up @@ -370,8 +370,3 @@ void WalletView::showProgress(const QString &title, int nProgress)
}
}
}

void WalletView::requestedSyncWarningInfo()
{
Q_EMIT outOfSyncWarningClicked();
}
3 changes: 0 additions & 3 deletions src/qt/walletview.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ public Q_SLOTS:
/** Show progress dialog e.g. for rescan */
void showProgress(const QString &title, int nProgress);

/** User has requested more information about the out of sync state */
void requestedSyncWarningInfo();

Q_SIGNALS:
void setPrivacy(bool privacy);
void transactionClicked();
Expand Down

0 comments on commit 990da14

Please sign in to comment.