mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
[Qt] modalinfolayer: removed unused comments, renamed signal, code style overhaul
This commit is contained in:
parent
d8b062ef5e
commit
08827df3ec
7 changed files with 15 additions and 16 deletions
|
@ -247,7 +247,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
|
||||||
modalOverlay = new ModalOverlay(this->centralWidget());
|
modalOverlay = new ModalOverlay(this->centralWidget());
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
if(enableWallet)
|
if(enableWallet)
|
||||||
connect(walletFrame, SIGNAL(requestedOfSyncWarningInfo()), this, SLOT(showModalOverlay()));
|
connect(walletFrame, SIGNAL(requestedSyncWarningInfo()), this, SLOT(showModalOverlay()));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -717,13 +717,13 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
|
||||||
{
|
{
|
||||||
if (modalOverlay)
|
if (modalOverlay)
|
||||||
{
|
{
|
||||||
if (header)
|
if (header) {
|
||||||
{
|
|
||||||
/* use clientmodels getHeaderTipHeight and getHeaderTipTime because the NotifyHeaderTip signal does not fire when updating the best header */
|
/* use clientmodels getHeaderTipHeight and getHeaderTipTime because the NotifyHeaderTip signal does not fire when updating the best header */
|
||||||
modalOverlay->setKnownBestHeight(clientModel->getHeaderTipHeight(), QDateTime::fromTime_t(clientModel->getHeaderTipTime()));
|
modalOverlay->setKnownBestHeight(clientModel->getHeaderTipHeight(), QDateTime::fromTime_t(clientModel->getHeaderTipTime()));
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
modalOverlay->tipUpdate(count, blockDate, nVerificationProgress);
|
modalOverlay->tipUpdate(count, blockDate, nVerificationProgress);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!clientModel)
|
if (!clientModel)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -130,7 +130,7 @@ QLabel { color: rgb(40,40,40); }</string>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="infoText">
|
<widget class="QLabel" name="infoText">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<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>
|
<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>
|
||||||
</property>
|
</property>
|
||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::RichText</enum>
|
<enum>Qt::RichText</enum>
|
||||||
|
@ -149,7 +149,7 @@ QLabel { color: rgb(40,40,40); }</string>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<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>
|
<string>Spending bitcoins may not be possible during that phase!</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::RichText</enum>
|
<enum>Qt::RichText</enum>
|
||||||
|
|
|
@ -86,7 +86,6 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
|
||||||
// show progress speed if we have more then one sample
|
// show progress speed if we have more then one sample
|
||||||
if (blockProcessTime.size() >= 2)
|
if (blockProcessTime.size() >= 2)
|
||||||
{
|
{
|
||||||
// try to get the window from the last 500 seconds or at least 10 samples
|
|
||||||
double progressStart = blockProcessTime[0].second;
|
double progressStart = blockProcessTime[0].second;
|
||||||
double progressDelta = 0;
|
double progressDelta = 0;
|
||||||
double progressPerHour = 0;
|
double progressPerHour = 0;
|
||||||
|
@ -114,9 +113,9 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
|
||||||
ui->expectedTimeLeft->setText(GUIUtil::formateNiceTimeOffset(remainingMSecs/1000.0));
|
ui->expectedTimeLeft->setText(GUIUtil::formateNiceTimeOffset(remainingMSecs/1000.0));
|
||||||
|
|
||||||
// keep maximal 5000 samples
|
// keep maximal 5000 samples
|
||||||
static int maxSamples = 5000;
|
static const int MAX_SAMPLES = 5000;
|
||||||
if (blockProcessTime.count() > maxSamples)
|
if (blockProcessTime.count() > MAX_SAMPLES)
|
||||||
blockProcessTime.remove(maxSamples, blockProcessTime.count()-maxSamples);
|
blockProcessTime.remove(MAX_SAMPLES, blockProcessTime.count()-MAX_SAMPLES);
|
||||||
}
|
}
|
||||||
|
|
||||||
// show the last block date
|
// show the last block date
|
||||||
|
|
|
@ -199,5 +199,5 @@ WalletView *WalletFrame::currentWalletView()
|
||||||
|
|
||||||
void WalletFrame::outOfSyncWarningClicked()
|
void WalletFrame::outOfSyncWarningClicked()
|
||||||
{
|
{
|
||||||
Q_EMIT requestedOfSyncWarningInfo();
|
Q_EMIT requestedSyncWarningInfo();
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public:
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
/** Notify that the user has requested more information about the out-of-sync warning */
|
/** Notify that the user has requested more information about the out-of-sync warning */
|
||||||
void requestedOfSyncWarningInfo();
|
void requestedSyncWarningInfo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QStackedWidget *walletStack;
|
QStackedWidget *walletStack;
|
||||||
|
|
|
@ -66,7 +66,7 @@ WalletView::WalletView(const PlatformStyle *platformStyle, QWidget *parent):
|
||||||
|
|
||||||
// Clicking on a transaction on the overview pre-selects the transaction on the transaction history page
|
// Clicking on a transaction on the overview pre-selects the transaction on the transaction history page
|
||||||
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));
|
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));
|
||||||
connect(overviewPage, SIGNAL(outOfSyncWarningClicked()), this, SLOT(requestedOfSyncWarningInfo()));
|
connect(overviewPage, SIGNAL(outOfSyncWarningClicked()), this, SLOT(requestedSyncWarningInfo()));
|
||||||
|
|
||||||
// Double-clicking on a transaction on the transaction history page shows details
|
// Double-clicking on a transaction on the transaction history page shows details
|
||||||
connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
|
connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
|
||||||
|
@ -324,7 +324,7 @@ void WalletView::showProgress(const QString &title, int nProgress)
|
||||||
progressDialog->setValue(nProgress);
|
progressDialog->setValue(nProgress);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WalletView::requestedOfSyncWarningInfo()
|
void WalletView::requestedSyncWarningInfo()
|
||||||
{
|
{
|
||||||
Q_EMIT outOfSyncWarningClicked();
|
Q_EMIT outOfSyncWarningClicked();
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ public Q_SLOTS:
|
||||||
void showProgress(const QString &title, int nProgress);
|
void showProgress(const QString &title, int nProgress);
|
||||||
|
|
||||||
/** User has requested more information about the out of sync state */
|
/** User has requested more information about the out of sync state */
|
||||||
void requestedOfSyncWarningInfo();
|
void requestedSyncWarningInfo();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
/** Signal that we want to show the main window */
|
/** Signal that we want to show the main window */
|
||||||
|
|
Loading…
Add table
Reference in a new issue