aboutsummaryrefslogtreecommitdiff
path: root/src/qt/intro.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/intro.cpp')
-rw-r--r--src/qt/intro.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp
index bb03899f07..c521bf3c51 100644
--- a/src/qt/intro.cpp
+++ b/src/qt/intro.cpp
@@ -142,6 +142,7 @@ Intro::Intro(QWidget *parent, int64_t blockchain_size_gb, int64_t chain_state_si
const int min_prune_target_GB = std::ceil(MIN_DISK_SPACE_FOR_BLOCK_FILES / 1e9);
ui->pruneGB->setRange(min_prune_target_GB, std::numeric_limits<int>::max());
if (gArgs.IsArgSet("-prune")) {
+ m_prune_checkbox_is_default = false;
ui->prune->setChecked(gArgs.GetIntArg("-prune", 0) >= 1);
ui->prune->setEnabled(false);
}
@@ -151,6 +152,7 @@ Intro::Intro(QWidget *parent, int64_t blockchain_size_gb, int64_t chain_state_si
UpdatePruneLabels(ui->prune->isChecked());
connect(ui->prune, &QCheckBox::toggled, [this](bool prune_checked) {
+ m_prune_checkbox_is_default = false;
UpdatePruneLabels(prune_checked);
UpdateFreeSpaceLabel();
});
@@ -286,7 +288,7 @@ void Intro::setStatus(int status, const QString &message, quint64 bytesAvailable
ui->freeSpace->setText("");
} else {
m_bytes_available = bytesAvailable;
- if (ui->prune->isEnabled() && !(gArgs.IsArgSet("-prune") && gArgs.GetIntArg("-prune", 0) == 0)) {
+ if (ui->prune->isEnabled() && m_prune_checkbox_is_default) {
ui->prune->setChecked(m_bytes_available < (m_blockchain_size_gb + m_chain_state_size_gb + 10) * GB_BYTES);
}
UpdateFreeSpaceLabel();