Skip to content

Commit bd44a04

Browse files
committed
[Qt] make Out-Of-Sync warning icon clickable
1 parent 0904c3c commit bd44a04

File tree

7 files changed

+34
-2
lines changed

7 files changed

+34
-2
lines changed

src/qt/forms/overviewpage.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<item>
6262
<widget class="QPushButton" name="labelWalletStatus">
6363
<property name="enabled">
64-
<bool>false</bool>
64+
<bool>true</bool>
6565
</property>
6666
<property name="maximumSize">
6767
<size>
@@ -447,7 +447,7 @@
447447
<item>
448448
<widget class="QPushButton" name="labelTransactionsStatus">
449449
<property name="enabled">
450-
<bool>false</bool>
450+
<bool>true</bool>
451451
</property>
452452
<property name="maximumSize">
453453
<size>

src/qt/overviewpage.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent)
140140

141141
// start with displaying the "out of sync" warnings
142142
showOutOfSyncWarning(true);
143+
connect(ui->labelWalletStatus, SIGNAL(clicked()), this, SLOT(handleOutOfSyncWarningClicks()));
144+
connect(ui->labelTransactionsStatus, SIGNAL(clicked()), this, SLOT(handleOutOfSyncWarningClicks()));
143145
}
144146

145147
void OverviewPage::handleTransactionClicked(const QModelIndex &index)
@@ -148,6 +150,11 @@ void OverviewPage::handleTransactionClicked(const QModelIndex &index)
148150
Q_EMIT transactionClicked(filter->mapToSource(index));
149151
}
150152

153+
void OverviewPage::handleOutOfSyncWarningClicks()
154+
{
155+
Q_EMIT outOfSyncWarningClicked();
156+
}
157+
151158
OverviewPage::~OverviewPage()
152159
{
153160
delete ui;

src/qt/overviewpage.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public Q_SLOTS:
4242

4343
Q_SIGNALS:
4444
void transactionClicked(const QModelIndex &index);
45+
void outOfSyncWarningClicked();
4546

4647
private:
4748
Ui::OverviewPage *ui;
@@ -62,6 +63,7 @@ private Q_SLOTS:
6263
void handleTransactionClicked(const QModelIndex &index);
6364
void updateAlerts(const QString &warnings);
6465
void updateWatchOnlyLabels(bool showWatchOnly);
66+
void handleOutOfSyncWarningClicks();
6567
};
6668

6769
#endif // BITCOIN_QT_OVERVIEWPAGE_H

src/qt/walletframe.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ bool WalletFrame::addWallet(const QString& name, WalletModel *walletModel)
5757
// Ensure a walletView is able to show the main window
5858
connect(walletView, SIGNAL(showNormalIfMinimized()), gui, SLOT(showNormalIfMinimized()));
5959

60+
connect(walletView, SIGNAL(outOfSyncWarningClicked()), this, SLOT(outOfSyncWarningClicked()));
61+
6062
return true;
6163
}
6264

@@ -195,3 +197,7 @@ WalletView *WalletFrame::currentWalletView()
195197
return qobject_cast<WalletView*>(walletStack->currentWidget());
196198
}
197199

200+
void WalletFrame::outOfSyncWarningClicked()
201+
{
202+
Q_EMIT requestedOfSyncWarningInfo();
203+
}

src/qt/walletframe.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ class WalletFrame : public QFrame
3838

3939
void showOutOfSyncWarning(bool fShow);
4040

41+
Q_SIGNALS:
42+
/** Notify that the user has requested more information about the out-of-sync warning */
43+
void requestedOfSyncWarningInfo();
44+
4145
private:
4246
QStackedWidget *walletStack;
4347
BitcoinGUI *gui;
@@ -78,6 +82,8 @@ public Q_SLOTS:
7882
void usedSendingAddresses();
7983
/** Show used receiving addresses */
8084
void usedReceivingAddresses();
85+
/** Pass on signal over requested out-of-sync-warning information */
86+
void outOfSyncWarningClicked();
8187
};
8288

8389
#endif // BITCOIN_QT_WALLETFRAME_H

src/qt/walletview.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ WalletView::WalletView(const PlatformStyle *platformStyle, QWidget *parent):
6666

6767
// Clicking on a transaction on the overview pre-selects the transaction on the transaction history page
6868
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));
69+
connect(overviewPage, SIGNAL(outOfSyncWarningClicked()), this, SLOT(requestedOfSyncWarningInfo()));
6970

7071
// Double-clicking on a transaction on the transaction history page shows details
7172
connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
@@ -322,3 +323,8 @@ void WalletView::showProgress(const QString &title, int nProgress)
322323
else if (progressDialog)
323324
progressDialog->setValue(nProgress);
324325
}
326+
327+
void WalletView::requestedOfSyncWarningInfo()
328+
{
329+
Q_EMIT outOfSyncWarningClicked();
330+
}

src/qt/walletview.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ public Q_SLOTS:
110110
/** Show progress dialog e.g. for rescan */
111111
void showProgress(const QString &title, int nProgress);
112112

113+
/** User has requested more information about the out of sync state */
114+
void requestedOfSyncWarningInfo();
115+
113116
Q_SIGNALS:
114117
/** Signal that we want to show the main window */
115118
void showNormalIfMinimized();
@@ -121,6 +124,8 @@ public Q_SLOTS:
121124
void hdEnabledStatusChanged(int hdEnabled);
122125
/** Notify that a new transaction appeared */
123126
void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label);
127+
/** Notify that the out of sync warning icon has been pressed */
128+
void outOfSyncWarningClicked();
124129
};
125130

126131
#endif // BITCOIN_QT_WALLETVIEW_H

0 commit comments

Comments
 (0)