mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-04 12:55:02 +02:00
Merge #17453: gui: Fix intro dialog labels when the prune button is toggled
4f7127d1e3gui: Make Intro consistent with prune checkbox (Hennadii Stepanov)4824a7d36cgui: Add Intro::UpdateFreeSpaceLabel() (Hennadii Stepanov)daa3f3fa90refactor: Add Intro::UpdatePruneLabels() (Hennadii Stepanov)e4caa82a03refactor: Replace static variable with data member (Hennadii Stepanov)2bede28cd9util: Add PruneGBtoMiB() function (Hennadii Stepanov)e35e4b2ba0util: Add PruneMiBtoGB() function (Hennadii Stepanov) Pull request description: On master (a6f6333ba2) and on 0.19.0.1 the intro dialog with prune enabled (checkbox "Discard blocks..." is checked) provides a user with wrong info about the required disk space:  Also the paragraph "If you have chosen to limit..." is missed. --- With this PR when prune checkbox is toggled, the related text labels and the amount of required space shown are updated (previously they were only updated when the data directory was updated):  --- This PR is an alternative to #17035. **ryanofsky**'s [suggestion](https://github.com/bitcoin/bitcoin/pull/17035#discussion_r337594268) also has been implemented. ACKs for top commit: emilengler: ACK4f7127d1e3Sjors: tACK4f7127d1e3ryanofsky: Code review ACK4f7127d1e3. It seems like there are a few visible changes here: jonasschnelli: utACK4f7127d1e3Tree-SHA512: fa0bbdcfafde97d7906cda066cbd4608b936a71cae1b4cda3ee3aa2eed3a9795f279f14c6b1b4997278e094db891c7d3bb695368ba0882347aa42165a86e5172
This commit is contained in:
@@ -240,9 +240,8 @@ void OptionsModel::SetPruneEnabled(bool prune, bool force)
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("bPrune", prune);
|
||||
// Convert prune size from GB to MiB:
|
||||
const uint64_t nPruneSizeMiB = (settings.value("nPruneSize").toInt() * GB_BYTES) >> 20;
|
||||
std::string prune_val = prune ? std::to_string(nPruneSizeMiB) : "0";
|
||||
const int64_t prune_target_mib = PruneGBtoMiB(settings.value("nPruneSize").toInt());
|
||||
std::string prune_val = prune ? std::to_string(prune_target_mib) : "0";
|
||||
if (force) {
|
||||
m_node.forceSetArg("-prune", prune_val);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user