Skip to content

Commit 08827df

Browse files
committed
[Qt] modalinfolayer: removed unused comments, renamed signal, code style overhaul
1 parent d8b062e commit 08827df

File tree

7 files changed

+15
-16
lines changed

7 files changed

+15
-16
lines changed

src/qt/bitcoingui.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
247247
modalOverlay = new ModalOverlay(this->centralWidget());
248248
#ifdef ENABLE_WALLET
249249
if(enableWallet)
250-
connect(walletFrame, SIGNAL(requestedOfSyncWarningInfo()), this, SLOT(showModalOverlay()));
250+
connect(walletFrame, SIGNAL(requestedSyncWarningInfo()), this, SLOT(showModalOverlay()));
251251
#endif
252252
}
253253

@@ -717,13 +717,13 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
717717
{
718718
if (modalOverlay)
719719
{
720-
if (header)
721-
{
720+
if (header) {
722721
/* use clientmodels getHeaderTipHeight and getHeaderTipTime because the NotifyHeaderTip signal does not fire when updating the best header */
723722
modalOverlay->setKnownBestHeight(clientModel->getHeaderTipHeight(), QDateTime::fromTime_t(clientModel->getHeaderTipTime()));
724723
}
725-
else
724+
else {
726725
modalOverlay->tipUpdate(count, blockDate, nVerificationProgress);
726+
}
727727
}
728728
if (!clientModel)
729729
return;

src/qt/forms/modaloverlay.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ QLabel { color: rgb(40,40,40); }</string>
130130
<item>
131131
<widget class="QLabel" name="infoText">
132132
<property name="text">
133-
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</string>
133+
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. This means that recent transactions will not be visible, and the balance will not be up-to-date until this process has completed.</string>
134134
</property>
135135
<property name="textFormat">
136136
<enum>Qt::RichText</enum>
@@ -149,7 +149,7 @@ QLabel { color: rgb(40,40,40); }</string>
149149
</font>
150150
</property>
151151
<property name="text">
152-
<string>This means that recent transactions will not be visible, and the balance will not be up-to-date until this process has completed. Spending bitcoins is not possible during that phase!</string>
152+
<string>Spending bitcoins may not be possible during that phase!</string>
153153
</property>
154154
<property name="textFormat">
155155
<enum>Qt::RichText</enum>

src/qt/modaloverlay.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
8686
// show progress speed if we have more then one sample
8787
if (blockProcessTime.size() >= 2)
8888
{
89-
// try to get the window from the last 500 seconds or at least 10 samples
9089
double progressStart = blockProcessTime[0].second;
9190
double progressDelta = 0;
9291
double progressPerHour = 0;
@@ -114,9 +113,9 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
114113
ui->expectedTimeLeft->setText(GUIUtil::formateNiceTimeOffset(remainingMSecs/1000.0));
115114

116115
// keep maximal 5000 samples
117-
static int maxSamples = 5000;
118-
if (blockProcessTime.count() > maxSamples)
119-
blockProcessTime.remove(maxSamples, blockProcessTime.count()-maxSamples);
116+
static const int MAX_SAMPLES = 5000;
117+
if (blockProcessTime.count() > MAX_SAMPLES)
118+
blockProcessTime.remove(MAX_SAMPLES, blockProcessTime.count()-MAX_SAMPLES);
120119
}
121120

122121
// show the last block date

src/qt/walletframe.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,5 +199,5 @@ WalletView *WalletFrame::currentWalletView()
199199

200200
void WalletFrame::outOfSyncWarningClicked()
201201
{
202-
Q_EMIT requestedOfSyncWarningInfo();
203-
}
202+
Q_EMIT requestedSyncWarningInfo();
203+
}

src/qt/walletframe.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class WalletFrame : public QFrame
4040

4141
Q_SIGNALS:
4242
/** Notify that the user has requested more information about the out-of-sync warning */
43-
void requestedOfSyncWarningInfo();
43+
void requestedSyncWarningInfo();
4444

4545
private:
4646
QStackedWidget *walletStack;

src/qt/walletview.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +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()));
69+
connect(overviewPage, SIGNAL(outOfSyncWarningClicked()), this, SLOT(requestedSyncWarningInfo()));
7070

7171
// Double-clicking on a transaction on the transaction history page shows details
7272
connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
@@ -324,7 +324,7 @@ void WalletView::showProgress(const QString &title, int nProgress)
324324
progressDialog->setValue(nProgress);
325325
}
326326

327-
void WalletView::requestedOfSyncWarningInfo()
327+
void WalletView::requestedSyncWarningInfo()
328328
{
329329
Q_EMIT outOfSyncWarningClicked();
330330
}

src/qt/walletview.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public Q_SLOTS:
111111
void showProgress(const QString &title, int nProgress);
112112

113113
/** User has requested more information about the out of sync state */
114-
void requestedOfSyncWarningInfo();
114+
void requestedSyncWarningInfo();
115115

116116
Q_SIGNALS:
117117
/** Signal that we want to show the main window */

0 commit comments

Comments
 (0)