mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-31 16:24:48 +02:00
Merge bitcoin-core/gui#125: Enable changing the autoprune block space size in intro dialog
415fb2e1abGUI/Intro: Move prune setting below explanation (Luke Dashjr)2a84c6bcf6GUI/Intro: Estimate max age of backups that can be restored with pruning (Luke Dashjr)e2dcd957faGUI/Intro: Rework UI flow to let the user set prune size in GBs (Luke Dashjr)f2e5a6b54fGUI/Intro: Abstract GUI-to-option into Intro::getPrune (Luke Dashjr)62932cc686GUI/Intro: Return actual prune setting from showIfNeeded (Luke Dashjr) Pull request description:  Moved from https://github.com/bitcoin/bitcoin/pull/18728 ACKs for top commit: ryanofsky: Code review ACK415fb2e1ab. Changes since last review: mb/gib suffixes, constexpr QOverload expected_backup_days tweaks, new moveonly layout commit jarolrod: Tested ACK415fb2e. Talkless: tACK415fb2e1ab, tested on Debian Sid with Qt 5.15.2. hebasto: ACK415fb2e1ab, my unresolved comments are not blockers, and they could be resolved in follow ups. Tree-SHA512: bd4882a9c08e6a6eb14b7fb6366983db8581425b4949fea212785d34d8fad9e32fb81ca8c8cdbfb2c05ea394aaf5a746ba2cf16623795c7252c3bdb61d455f00
This commit is contained in:
@@ -319,11 +319,9 @@ void BitcoinApplication::parameterSetup()
|
||||
InitParameterInteraction(gArgs);
|
||||
}
|
||||
|
||||
void BitcoinApplication::InitializePruneSetting(bool prune)
|
||||
void BitcoinApplication::InitPruneSetting(int64_t prune_MiB)
|
||||
{
|
||||
// If prune is set, intentionally override existing prune size with
|
||||
// the default size since this is called when choosing a new datadir.
|
||||
optionsModel->SetPruneTargetGB(prune ? DEFAULT_PRUNE_TARGET_GB : 0, true);
|
||||
optionsModel->SetPruneTargetGB(PruneMiBtoGB(prune_MiB), true);
|
||||
}
|
||||
|
||||
void BitcoinApplication::requestInitialize()
|
||||
@@ -533,9 +531,9 @@ int GuiMain(int argc, char* argv[])
|
||||
/// 5. Now that settings and translations are available, ask user for data directory
|
||||
// User language is set up: pick a data directory
|
||||
bool did_show_intro = false;
|
||||
bool prune = false; // Intro dialog prune check box
|
||||
int64_t prune_MiB = 0; // Intro dialog prune configuration
|
||||
// Gracefully exit if the user cancels
|
||||
if (!Intro::showIfNeeded(did_show_intro, prune)) return EXIT_SUCCESS;
|
||||
if (!Intro::showIfNeeded(did_show_intro, prune_MiB)) return EXIT_SUCCESS;
|
||||
|
||||
/// 6. Determine availability of data directory and parse bitcoin.conf
|
||||
/// - Do not call GetDataDir(true) before this step finishes
|
||||
@@ -617,7 +615,7 @@ int GuiMain(int argc, char* argv[])
|
||||
|
||||
if (did_show_intro) {
|
||||
// Store intro dialog settings other than datadir (network specific)
|
||||
app.InitializePruneSetting(prune);
|
||||
app.InitPruneSetting(prune_MiB);
|
||||
}
|
||||
|
||||
if (gArgs.GetBoolArg("-splash", DEFAULT_SPLASHSCREEN) && !gArgs.GetBoolArg("-min", false))
|
||||
|
||||
Reference in New Issue
Block a user