Skip to content

Commit 990da14

Browse files
hebastojagdeep sidhu
authored and
jagdeep sidhu
committed
Merge bitcoin-core/gui#333: refactor: Signal-slot connections cleanup
1 parent d17f356 commit 990da14

7 files changed

+4
-33
lines changed

src/qt/overviewpage.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent)
166166

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

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

179-
void OverviewPage::handleOutOfSyncWarningClicks()
180-
{
181-
Q_EMIT outOfSyncWarningClicked();
182-
}
183-
184179
void OverviewPage::setPrivacy(bool privacy)
185180
{
186181
m_privacy = privacy;

src/qt/overviewpage.h

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ private Q_SLOTS:
6565
void handleTransactionClicked(const QModelIndex &index);
6666
void updateAlerts(const QString &warnings);
6767
void updateWatchOnlyLabels(bool showWatchOnly);
68-
void handleOutOfSyncWarningClicks();
6968
void setMonospacedFont(bool use_embedded_font);
7069
};
7170

src/qt/syscoingui.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,6 @@ SyscoinGUI::SyscoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
212212

213213
connect(labelBlocksIcon, &GUIUtil::ClickableLabel::clicked, this, &SyscoinGUI::showModalOverlay);
214214
connect(progressBar, &GUIUtil::ClickableProgressBar::clicked, this, &SyscoinGUI::showModalOverlay);
215-
#ifdef ENABLE_WALLET
216-
if(enableWallet) {
217-
connect(walletFrame, &WalletFrame::requestedSyncWarningInfo, this, &SyscoinGUI::showModalOverlay);
218-
}
219-
#endif
220215

221216
#ifdef Q_OS_MAC
222217
m_app_nap_inhibitor = new CAppNapInhibitor;
@@ -730,7 +725,7 @@ void SyscoinGUI::addWallet(WalletModel* walletModel)
730725
const QString display_name = walletModel->getDisplayName();
731726
m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel));
732727

733-
connect(wallet_view, &WalletView::outOfSyncWarningClicked, walletFrame, &WalletFrame::outOfSyncWarningClicked);
728+
connect(wallet_view, &WalletView::outOfSyncWarningClicked, this, &SyscoinGUI::showModalOverlay);
734729
connect(wallet_view, &WalletView::transactionClicked, this, &SyscoinGUI::gotoHistoryPage);
735730
connect(wallet_view, &WalletView::coinsSent, this, &SyscoinGUI::gotoHistoryPage);
736731
connect(wallet_view, &WalletView::message, [this](const QString& title, const QString& message, unsigned int style) {

src/qt/walletframe.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,3 @@ WalletModel* WalletFrame::currentWalletModel() const
248248
WalletView* wallet_view = currentWalletView();
249249
return wallet_view ? wallet_view->getWalletModel() : nullptr;
250250
}
251-
252-
void WalletFrame::outOfSyncWarningClicked()
253-
{
254-
Q_EMIT requestedSyncWarningInfo();
255-
}

src/qt/walletframe.h

-5
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ class WalletFrame : public QFrame
4747
QSize sizeHint() const override { return m_size_hint; }
4848

4949
Q_SIGNALS:
50-
/** Notify that the user has requested more information about the out-of-sync warning */
51-
void requestedSyncWarningInfo();
52-
5350
void createWalletButtonClicked();
5451

5552
private:
@@ -100,8 +97,6 @@ public Q_SLOTS:
10097
void usedSendingAddresses();
10198
/** Show used receiving addresses */
10299
void usedReceivingAddresses();
103-
/** Pass on signal over requested out-of-sync-warning information */
104-
void outOfSyncWarningClicked();
105100
};
106101

107102
#endif // SYSCOIN_QT_WALLETFRAME_H

src/qt/walletview.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ WalletView::WalletView(const PlatformStyle *_platformStyle, QWidget *parent):
8080
// Clicking on a transaction on the overview pre-selects the transaction on the transaction history page
8181
connect(overviewPage, &OverviewPage::transactionClicked, transactionView, qOverload<const QModelIndex&>(&TransactionView::focusTransaction));
8282

83-
connect(overviewPage, &OverviewPage::outOfSyncWarningClicked, this, &WalletView::requestedSyncWarningInfo);
83+
connect(overviewPage, &OverviewPage::outOfSyncWarningClicked, this, &WalletView::outOfSyncWarningClicked);
8484

8585
connect(sendCoinsPage, &SendCoinsDialog::coinsSent, this, &WalletView::coinsSent);
8686
// Highlight transaction after send
@@ -370,8 +370,3 @@ void WalletView::showProgress(const QString &title, int nProgress)
370370
}
371371
}
372372
}
373-
374-
void WalletView::requestedSyncWarningInfo()
375-
{
376-
Q_EMIT outOfSyncWarningClicked();
377-
}

src/qt/walletview.h

-3
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ public Q_SLOTS:
116116
/** Show progress dialog e.g. for rescan */
117117
void showProgress(const QString &title, int nProgress);
118118

119-
/** User has requested more information about the out of sync state */
120-
void requestedSyncWarningInfo();
121-
122119
Q_SIGNALS:
123120
void setPrivacy(bool privacy);
124121
void transactionClicked();

0 commit comments

Comments
 (0)