mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-12 11:19:08 -05:00
refactor: Add Intro::UpdatePruneLabels()
This is a move-only commit and it does not change behavior.
This commit is contained in:
parent
e4caa82a03
commit
daa3f3fa90
2 changed files with 19 additions and 13 deletions
|
@ -135,19 +135,7 @@ Intro::Intro(QWidget *parent, int64_t blockchain_size_gb, int64_t chain_state_si
|
||||||
}
|
}
|
||||||
const int prune_target_gb = PruneMiBtoGB(prune_target_mib);
|
const int prune_target_gb = PruneMiBtoGB(prune_target_mib);
|
||||||
ui->prune->setText(tr("Discard blocks after verification, except most recent %1 GB (prune)").arg(prune_target_gb ? prune_target_gb : DEFAULT_PRUNE_TARGET_GB));
|
ui->prune->setText(tr("Discard blocks after verification, except most recent %1 GB (prune)").arg(prune_target_gb ? prune_target_gb : DEFAULT_PRUNE_TARGET_GB));
|
||||||
m_required_space_gb = m_blockchain_size_gb + m_chain_state_size_gb;
|
UpdatePruneLabels(prune_target_gb);
|
||||||
QString storageRequiresMsg = tr("At least %1 GB of data will be stored in this directory, and it will grow over time.");
|
|
||||||
if (0 < prune_target_gb && prune_target_gb <= m_blockchain_size_gb) {
|
|
||||||
m_required_space_gb = prune_target_gb + m_chain_state_size_gb;
|
|
||||||
storageRequiresMsg = tr("Approximately %1 GB of data will be stored in this directory.");
|
|
||||||
}
|
|
||||||
ui->lblExplanation3->setVisible(prune_target_gb > 0);
|
|
||||||
ui->sizeWarningLabel->setText(
|
|
||||||
tr("%1 will download and store a copy of the Bitcoin block chain.").arg(PACKAGE_NAME) + " " +
|
|
||||||
storageRequiresMsg.arg(m_required_space_gb) + " " +
|
|
||||||
tr("The wallet will also be stored in this directory.")
|
|
||||||
);
|
|
||||||
this->adjustSize();
|
|
||||||
startThread();
|
startThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,3 +329,20 @@ QString Intro::getPathToCheck()
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Intro::UpdatePruneLabels(int64_t prune_target_gb)
|
||||||
|
{
|
||||||
|
m_required_space_gb = m_blockchain_size_gb + m_chain_state_size_gb;
|
||||||
|
QString storageRequiresMsg = tr("At least %1 GB of data will be stored in this directory, and it will grow over time.");
|
||||||
|
if (0 < prune_target_gb && prune_target_gb <= m_blockchain_size_gb) {
|
||||||
|
m_required_space_gb = prune_target_gb + m_chain_state_size_gb;
|
||||||
|
storageRequiresMsg = tr("Approximately %1 GB of data will be stored in this directory.");
|
||||||
|
}
|
||||||
|
ui->lblExplanation3->setVisible(prune_target_gb > 0);
|
||||||
|
ui->sizeWarningLabel->setText(
|
||||||
|
tr("%1 will download and store a copy of the Bitcoin block chain.").arg(PACKAGE_NAME) + " " +
|
||||||
|
storageRequiresMsg.arg(m_required_space_gb) + " " +
|
||||||
|
tr("The wallet will also be stored in this directory.")
|
||||||
|
);
|
||||||
|
this->adjustSize();
|
||||||
|
}
|
||||||
|
|
|
@ -75,6 +75,7 @@ private:
|
||||||
void startThread();
|
void startThread();
|
||||||
void checkPath(const QString &dataDir);
|
void checkPath(const QString &dataDir);
|
||||||
QString getPathToCheck();
|
QString getPathToCheck();
|
||||||
|
void UpdatePruneLabels(int64_t prune_target_gb);
|
||||||
|
|
||||||
friend class FreespaceChecker;
|
friend class FreespaceChecker;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue