Skip to content

Commit 7205d5e

Browse files
jarolrodhebasto
authored andcommitted
qml: Wire Storage amount options to OptionsModel backend
Wires both the easy and advanced configuration options related to storage amount to the options model backend. Additionally, this removes an unused and unwanted storage location setting from the advanced storage amount settings table. Github-Pull: #207 Rebased-From: 63162b0
1 parent 6674e27 commit 7205d5e

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

src/qml/BitcoinApp/Components/StorageOptions.qml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,18 @@ ColumnLayout {
1919
description: qsTr("Uses about 2GB. For simple wallet use.")
2020
recommended: true
2121
checked: true
22+
onClicked: {
23+
optionsModel.prune = true
24+
optionsModel.pruneSizeGB = 2
25+
}
2226
}
2327
OptionButton {
2428
Layout.fillWidth: true
2529
ButtonGroup.group: group
2630
text: qsTr("Store all data")
2731
description: qsTr("Uses about 550GB. Support the network.")
32+
onClicked: {
33+
optionsModel.prune = false
34+
}
2835
}
2936
}

src/qml/BitcoinApp/Components/StorageSettings.qml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,18 @@ ColumnLayout {
1111
spacing: 20
1212
Setting {
1313
Layout.fillWidth: true
14-
header: qsTr("Store Recent blocks only")
15-
actionItem: OptionSwitch {}
16-
}
17-
Setting {
18-
Layout.fillWidth: true
19-
header: qsTr("Storage limit")
20-
actionItem: ValueInput {
21-
description: qsTr("2 GB")
14+
header: qsTr("Store recent blocks only")
15+
actionItem: OptionSwitch {
16+
checked: optionsModel.prune
17+
onToggled: optionsModel.prune = checked
2218
}
2319
}
2420
Setting {
2521
Layout.fillWidth: true
26-
header: qsTr("Data location")
22+
header: qsTr("Storage limit (GB)")
2723
actionItem: ValueInput {
28-
description: "c://.../data"
24+
description: optionsModel.pruneSizeGB
25+
onEditingFinished: optionsModel.pruneSizeGB = parseInt(text)
2926
}
3027
}
3128
}

src/qml/BitcoinApp/SettingsStorage.qml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@ InformationPage {
1414
headerText: qsTr("Storage settings")
1515
headerMargin: 0
1616
detailActive: true
17-
detailItem: StorageSettings {}
17+
detailItem: StorageSettings {
18+
// Set default prune values
19+
Component.onCompleted: {
20+
optionsModel.prune = true
21+
optionsModel.pruneSizeGB = 2
22+
}
23+
}
1824
}

0 commit comments

Comments
 (0)