Skip to content

Commit

Permalink
qml: updated pages so they use optionsModel instead of nodeModel
Browse files Browse the repository at this point in the history
  • Loading branch information
D33r-Gee committed Jun 17, 2024
1 parent 30c9a92 commit c57f7fd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/qml/components/AboutOptions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ ColumnLayout {
header: qsTr("Version")
actionItem: ExternalLink {
parentState: versionLink.state
description: nodeModel.fullClientVersion
// description: nodeModel.fullClientVersion
description: optionsModel.fullClientVersion
link: "https://bitcoin.org/en/download"
iconSource: "image://images/caret-right"
iconWidth: 18
Expand Down
14 changes: 12 additions & 2 deletions src/qml/components/StorageLocations.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,21 @@ ColumnLayout {
ButtonGroup.group: group
text: qsTr("Default")
description: qsTr("Your application directory.")
customDir: optionsModel.getDefaultDataDirString
checked: optionsModel.dataDir === optionsModel.getDefaultDataDirString
checked: true
customDir: updateCustomDir()
function updateCustomDir() {
if (checked) {
optionsModel.dataDir = optionsModel.getDefaultDataDirString;
optionsModel.defaultReset();
return optionsModel.dataDir;
} else {
return "";
}
}
onClicked: {
defaultDirOption.checked = true
optionsModel.dataDir = optionsModel.getDefaultDataDirString
optionsModel.defaultReset()
}
}
OptionButton {
Expand Down
7 changes: 5 additions & 2 deletions src/qml/components/StorageOptions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ ColumnLayout {
Layout.fillWidth: true
ButtonGroup.group: group
text: qsTr("Reduce storage")
description: qsTr("Uses about %1GB. For simple wallet use.").arg(chainModel.assumedChainstateSize + 2)
// description: qsTr("Uses about %1GB. For simple wallet use.").arg(chainModel.assumedChainstateSize + 2)
description: qsTr("Uses about %1GB. For simple wallet use.").arg(optionsModel.assumedChainstateSize + 2)
recommended: true
checked: !root.customStorage && optionsModel.prune
onClicked: {
Expand All @@ -39,8 +40,10 @@ ColumnLayout {
ButtonGroup.group: group
text: qsTr("Store all data")
checked: !optionsModel.prune
// description: qsTr("Uses about %1GB. Support the network.").arg(
// chainModel.assumedBlockchainSize + chainModel.assumedChainstateSize)
description: qsTr("Uses about %1GB. Support the network.").arg(
chainModel.assumedBlockchainSize + chainModel.assumedChainstateSize)
optionsModel.assumedBlockchainSize + optionsModel.assumedChainstateSize)
onClicked: {
optionsModel.prune = false
}
Expand Down
5 changes: 3 additions & 2 deletions src/qml/pages/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ ApplicationWindow {
focus: true
Keys.onReleased: {
if (event.key == Qt.Key_Back) {
nodeModel.requestShutdown()
optionsModel.requestShutdown()
event.accepted = true
}
}
}

Connections {
target: nodeModel
target: optionsModel
function onRequestedShutdown() {
main.clear()
main.push(shutdown)
Expand All @@ -78,6 +78,7 @@ ApplicationWindow {
OnboardingConnection {}

onFinishedChanged: {
optionsModel.onboardingFinished()
optionsModel.onboard()
if (AppMode.walletEnabled && AppMode.isDesktop) {
main.push(desktopWallets)
Expand Down
3 changes: 2 additions & 1 deletion src/qml/pages/onboarding/OnboardingStorageLocation.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ InformationPage {
bold: true
headerText: qsTr("Storage location")
headerMargin: 0
description: qsTr("Where do you want to store the downloaded block data?\nYou need a minimum of %1GB of storage.").arg(chainModel.assumedChainstateSize + 1)
// description: qsTr("Where do you want to store the downloaded block data?\nYou need a minimum of %1GB of storage.").arg(chainModel.assumedChainstateSize + 1)
description: qsTr("Where do you want to store the downloaded block data?\nYou need a minimum of %1GB of storage.").arg(optionsModel.assumedChainstateSize + 1)
descriptionMargin: 20
detailActive: true
detailItem: StorageLocations {}
Expand Down

0 comments on commit c57f7fd

Please sign in to comment.