mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
GUI/Intro: Abstract GUI-to-option into Intro::getPrune
This commit is contained in:
parent
62932cc686
commit
f2e5a6b54f
2 changed files with 12 additions and 1 deletions
|
@ -182,6 +182,16 @@ void Intro::setDataDirectory(const QString &dataDir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int64_t Intro::getPruneMiB() const
|
||||||
|
{
|
||||||
|
switch (ui->prune->checkState()) {
|
||||||
|
case Qt::Checked:
|
||||||
|
return PruneGBtoMiB(m_prune_target_gb);
|
||||||
|
case Qt::Unchecked: default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool Intro::showIfNeeded(bool& did_show_intro, int64_t& prune_MiB)
|
bool Intro::showIfNeeded(bool& did_show_intro, int64_t& prune_MiB)
|
||||||
{
|
{
|
||||||
did_show_intro = false;
|
did_show_intro = false;
|
||||||
|
@ -233,7 +243,7 @@ bool Intro::showIfNeeded(bool& did_show_intro, int64_t& prune_MiB)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Additional preferences:
|
// Additional preferences:
|
||||||
prune_MiB = intro.ui->prune->isChecked() ? PruneGBtoMiB(intro.m_prune_target_gb) : int64_t(0);
|
prune_MiB = intro.getPruneMiB();
|
||||||
|
|
||||||
settings.setValue("strDataDir", dataDir);
|
settings.setValue("strDataDir", dataDir);
|
||||||
settings.setValue("fReset", false);
|
settings.setValue("fReset", false);
|
||||||
|
|
|
@ -36,6 +36,7 @@ public:
|
||||||
|
|
||||||
QString getDataDirectory();
|
QString getDataDirectory();
|
||||||
void setDataDirectory(const QString &dataDir);
|
void setDataDirectory(const QString &dataDir);
|
||||||
|
int64_t getPruneMiB() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine data directory. Let the user choose if the current one doesn't exist.
|
* Determine data directory. Let the user choose if the current one doesn't exist.
|
||||||
|
|
Loading…
Add table
Reference in a new issue