Skip to content

Commit 67a220c

Browse files
committed
qml: smart storage values based on assumed chain and chainstate size
1 parent 18aa5c9 commit 67a220c

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/qml/components/StorageOptions.qml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
import QtQuick 2.15
66
import QtQuick.Controls 2.15
77
import QtQuick.Layouts 1.15
8+
9+
import org.bitcoincore.qt 1.0
10+
811
import "../controls"
912

1013
ColumnLayout {
@@ -19,7 +22,7 @@ ColumnLayout {
1922
Layout.fillWidth: true
2023
ButtonGroup.group: group
2124
text: qsTr("Reduce storage")
22-
description: qsTr("Uses about 2GB. For simple wallet use.")
25+
description: qsTr("Uses about %1GB. For simple wallet use.").arg(chainModel.assumedChainstateSize + 2)
2326
recommended: true
2427
checked: !root.customStorage && optionsModel.prune
2528
onClicked: {
@@ -36,7 +39,8 @@ ColumnLayout {
3639
ButtonGroup.group: group
3740
text: qsTr("Store all data")
3841
checked: !optionsModel.prune
39-
description: qsTr("Uses about 550GB. Support the network.")
42+
description: qsTr("Uses about %1GB. Support the network.").arg(
43+
chainModel.assumedBlockchainSize + chainModel.assumedChainstateSize)
4044
onClicked: {
4145
optionsModel.prune = false
4246
}
@@ -49,7 +53,7 @@ ColumnLayout {
4953
ButtonGroup.group: group
5054
checked: root.customStorage && optionsModel.prune
5155
text: qsTr("Custom")
52-
description: qsTr("Storing recent blocks up to %1GB").arg(root.customStorageAmount)
56+
description: qsTr("Storing about %1GB of data.").arg(root.customStorageAmount + chainModel.assumedChainstateSize)
5357
onClicked: {
5458
optionsModel.prune = true
5559
optionsModel.pruneSizeGB = root.customStorageAmount

src/qml/components/StorageSettings.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ColumnLayout {
3535
Setting {
3636
id: pruneTargetSetting
3737
Layout.fillWidth: true
38-
header: qsTr("Storage limit (GB)")
38+
header: qsTr("Block Storage limit (GB)")
3939
errorText: qsTr("This is not a valid prune target. Please choose a value that is equal to or larger than 1GB")
4040
showErrorText: false
4141
actionItem: ValueInput {

src/qml/pages/onboarding/OnboardingStorageLocation.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ InformationPage {
1919
bold: true
2020
headerText: qsTr("Storage location")
2121
headerMargin: 0
22-
description: qsTr("Where do you want to store the downloaded block data?\nYou need a minimum of 1GB of storage.")
22+
description: qsTr("Where do you want to store the downloaded block data?\nYou need a minimum of %1GB of storage.").arg(chainModel.assumedChainstateSize + 1)
2323
descriptionMargin: 20
2424
detailActive: true
2525
detailItem: StorageLocations {}

0 commit comments

Comments
 (0)