diff --git a/src/qml/components/ConnectionSettings.qml b/src/qml/components/ConnectionSettings.qml index 90625a7def..63a08264ba 100644 --- a/src/qml/components/ConnectionSettings.qml +++ b/src/qml/components/ConnectionSettings.qml @@ -14,9 +14,10 @@ ColumnLayout { header: qsTr("Enable listening") description: qsTr("Allows incoming connections") actionItem: OptionSwitch { - checked: optionsModel.listen - onToggled: optionsModel.listen = checked + checked: onboardingModel.listen + onToggled: onboardingModel.listen = checked } + Component.onCompleted: onboardingModel.listen = false onClicked: { loadedItem.toggle() loadedItem.toggled() @@ -27,9 +28,10 @@ ColumnLayout { Layout.fillWidth: true header: qsTr("Map port using UPnP") actionItem: OptionSwitch { - checked: optionsModel.upnp - onToggled: optionsModel.upnp = checked + checked: onboardingModel.upnp + onToggled: onboardingModel.upnp = checked } + Component.onCompleted: onboardingModel.upnp = false onClicked: { loadedItem.toggle() loadedItem.toggled() @@ -40,9 +42,10 @@ ColumnLayout { Layout.fillWidth: true header: qsTr("Map port using NAT-PMP") actionItem: OptionSwitch { - checked: optionsModel.natpmp - onToggled: optionsModel.natpmp = checked + checked: onboardingModel.natpmp + onToggled: onboardingModel.natpmp = checked } + Component.onCompleted: onboardingModel.natpmp = false onClicked: { loadedItem.toggle() loadedItem.toggled() @@ -53,9 +56,10 @@ ColumnLayout { Layout.fillWidth: true header: qsTr("Enable RPC server") actionItem: OptionSwitch { - checked: optionsModel.server - onToggled: optionsModel.server = checked + checked: onboardingModel.server + onToggled: onboardingModel.server = checked } + Component.onCompleted: onboardingModel.server = false onClicked: { loadedItem.toggle() loadedItem.toggled() diff --git a/src/qml/components/StorageOptions.qml b/src/qml/components/StorageOptions.qml index eed962b951..e150b32ea6 100644 --- a/src/qml/components/StorageOptions.qml +++ b/src/qml/components/StorageOptions.qml @@ -22,27 +22,27 @@ 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(onboardingModel.assumedChainstateSize + 2) recommended: true - checked: !root.customStorage && optionsModel.prune + checked: !root.customStorage && onboardingModel.prune onClicked: { - optionsModel.prune = true - optionsModel.pruneSizeGB = 2 + onboardingModel.prune = true + onboardingModel.pruneSizeGB = 2 } Component.onCompleted: { - optionsModel.prune = true - optionsModel.pruneSizeGB = 2 + onboardingModel.prune = true + onboardingModel.pruneSizeGB = 2 } } OptionButton { Layout.fillWidth: true ButtonGroup.group: group text: qsTr("Store all data") - checked: !optionsModel.prune + checked: !onboardingModel.prune description: qsTr("Uses about %1GB. Support the network.").arg( - chainModel.assumedBlockchainSize + chainModel.assumedChainstateSize) + onboardingModel.assumedBlockchainSize + onboardingModel.assumedChainstateSize) onClicked: { - optionsModel.prune = false + onboardingModel.prune = false } } Loader { @@ -51,12 +51,12 @@ ColumnLayout { visible: active sourceComponent: OptionButton { ButtonGroup.group: group - checked: root.customStorage && optionsModel.prune + checked: root.customStorage && onboardingModel.prune text: qsTr("Custom") - description: qsTr("Storing about %1GB of data.").arg(root.customStorageAmount + chainModel.assumedChainstateSize) + description: qsTr("Storing about %1GB of data.").arg(root.customStorageAmount + onboardingModel.assumedChainstateSize) onClicked: { - optionsModel.prune = true - optionsModel.pruneSizeGB = root.customStorageAmount + onboardingModel.prune = true + onboardingModel.pruneSizeGB = root.customStorageAmount } } } diff --git a/src/qml/components/StorageSettings.qml b/src/qml/components/StorageSettings.qml index 2a2951bfac..820d594830 100644 --- a/src/qml/components/StorageSettings.qml +++ b/src/qml/components/StorageSettings.qml @@ -16,8 +16,8 @@ ColumnLayout { Layout.fillWidth: true header: qsTr("Store recent blocks only") actionItem: OptionSwitch { - checked: optionsModel.prune - onToggled: optionsModel.prune = checked + checked: onboardingModel.prune + onToggled: onboardingModel.prune = checked onCheckedChanged: { if (checked == false) { pruneTargetSetting.state = "DISABLED" @@ -40,14 +40,14 @@ ColumnLayout { showErrorText: false actionItem: ValueInput { parentState: pruneTargetSetting.state - description: optionsModel.pruneSizeGB + description: onboardingModel.pruneSizeGB onEditingFinished: { if (parseInt(text) < 1) { pruneTargetSetting.showErrorText = true } else { root.customStorage = true root.customStorageAmount = parseInt(text) - optionsModel.pruneSizeGB = parseInt(text) + onboardingModel.pruneSizeGB = parseInt(text) pruneTargetSetting.forceActiveFocus() pruneTargetSetting.showErrorText = false } diff --git a/src/qml/pages/main.qml b/src/qml/pages/main.qml index 581e9b42b4..c8563613d7 100644 --- a/src/qml/pages/main.qml +++ b/src/qml/pages/main.qml @@ -45,7 +45,7 @@ ApplicationWindow { } Connections { - target: nodeModel + target: onboardingModel function onRequestedShutdown() { main.clear() main.push(shutdown) @@ -66,7 +66,13 @@ ApplicationWindow { OnboardingStorageAmount {} OnboardingConnection {} - onFinishedChanged: main.push(node) + onFinishedChanged:{ + if (swipeView.finished) { + onboardingModel.onboardingFinished() + optionsModel.onboard() + main.push(node) + } + } } } @@ -93,4 +99,4 @@ ApplicationWindow { } } } -} +} \ No newline at end of file diff --git a/src/qml/pages/onboarding/OnboardingStorageLocation.qml b/src/qml/pages/onboarding/OnboardingStorageLocation.qml index b2c3aa1e00..2187aee689 100644 --- a/src/qml/pages/onboarding/OnboardingStorageLocation.qml +++ b/src/qml/pages/onboarding/OnboardingStorageLocation.qml @@ -19,7 +19,7 @@ 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(onboardingModel.assumedChainstateSize + 1) descriptionMargin: 20 detailActive: true detailItem: StorageLocations {}