aboutsummaryrefslogtreecommitdiff
path: root/src/qt/intro.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-11-12 15:21:20 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-01-14 18:53:02 +0200
commitdaa3f3fa9071a229275dd6a1b8445237ddc3fa97 (patch)
tree85ffc0f0b1e137a988e89e6a5feee1a54b848586 /src/qt/intro.cpp
parente4caa82a03df5c6a6d5d29f34ab006d732c6dac1 (diff)
refactor: Add Intro::UpdatePruneLabels()
This is a move-only commit and it does not change behavior.
Diffstat (limited to 'src/qt/intro.cpp')
-rw-r--r--src/qt/intro.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp
index 196f4b50bc..a1a7c8ab8b 100644
--- a/src/qt/intro.cpp
+++ b/src/qt/intro.cpp
@@ -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);
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;
- 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();
+ UpdatePruneLabels(prune_target_gb);
startThread();
}
@@ -341,3 +329,20 @@ QString Intro::getPathToCheck()
mutex.unlock();
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();
+}