Page MenuHomePhabricator

[backport#17453] gui: Fix intro dialog labels when the prune button is toggled
ClosedPublic

Authored by majcosta on Jan 14 2021, 13:03.

Details

Summary

4f7127d1e3a51f0f55d42a08439c516dcc8d1a26 gui: Make Intro consistent with prune checkbox (Hennadii Stepanov)
4824a7d36cf47e766865e0fefe952ec860eb82dd gui: Add Intro::UpdateFreeSpaceLabel() (Hennadii Stepanov)
daa3f3fa9071a229275dd6a1b8445237ddc3fa97 refactor: Add Intro::UpdatePruneLabels() (Hennadii Stepanov)
e4caa82a03df5c6a6d5d29f34ab006d732c6dac1 refactor: Replace static variable with data member (Hennadii Stepanov)
2bede28cd9ec638d8bb32c187ccf12d89345218e util: Add PruneGBtoMiB() function (Hennadii Stepanov)
e35e4b2ba052c9a533626286026dbe0a2d546c5b util: Add PruneMiBtoGB() function (Hennadii Stepanov)

Pull request description:

On master (a6f6333ba253cda83221ee529810cacf930e413f) 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:

![DeepinScreenshot_bitcoin-qt_20191208112228](https://user-images.githubusercontent.com/32963518/70387510-8daab400-19ae-11ea-9338-29add9c31118.png)

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):
![Screenshot from 2019-12-08 11-34-53](https://user-images.githubusercontent.com/32963518/70387542-eed28780-19ae-11ea-9565-49d8a64b2f33.png)

---

This PR is an alternative to #17035.

**ryanofsky**'s [suggestion](https://github.com/bitcoin/bitcoin/pull/17035#discussion_r337594268) also has been implemented.

Backport of Core PR17453

Depends on D8913

Test Plan
ninja all check check-functional
./src/qt/bitcoin-qt -choosedatadir

check that correct information is provided, whether prune checkbox is ticked or not

Event Timeline

Tail of the build log:

/work /work/abc-ci-builds/lint-circular-dependencies
A new circular dependency in the form of "qt/intro -> qt/optionsmodel -> qt/intro" appears to have been introduced.

/work/abc-ci-builds/lint-circular-dependencies
Build lint-circular-dependencies failed with exit code 1
PiRK requested changes to this revision.Jan 14 2021, 13:42
PiRK added a subscriber: PiRK.

PR15874 seems to be the missing backport

This revision now requires changes to proceed.Jan 14 2021, 13:42

rebase on top of D8916 which fixes the circular dependency h/t @PiRK

This revision is now accepted and ready to land.Jan 14 2021, 14:46