Skip to content

Commit 7ba2f62

Browse files
committed
qml: declare OnboardingWizard file, reintroduce as PageStack
This should be encapsulated so it can be reasoned about independently and in a well defined location. Additionally, swap from SwipeView to PageStack.
1 parent d49b888 commit 7ba2f62

File tree

4 files changed

+61
-30
lines changed

4 files changed

+61
-30
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ QML_RES_QML = \
421421
qml/pages/onboarding/OnboardingStorageAmount.qml \
422422
qml/pages/onboarding/OnboardingStorageLocation.qml \
423423
qml/pages/onboarding/OnboardingStrengthen.qml \
424+
qml/pages/onboarding/OnboardingWizard.qml \
424425
qml/pages/settings/SettingsAbout.qml \
425426
qml/pages/settings/SettingsBlockClockDisplayMode.qml \
426427
qml/pages/settings/SettingsConnection.qml \

src/qml/bitcoin_qml.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
<file>pages/onboarding/OnboardingStorageAmount.qml</file>
6262
<file>pages/onboarding/OnboardingStorageLocation.qml</file>
6363
<file>pages/onboarding/OnboardingStrengthen.qml</file>
64+
<file>pages/onboarding/OnboardingWizard.qml</file>
6465
<file>pages/settings/SettingsAbout.qml</file>
6566
<file>pages/settings/SettingsBlockClockDisplayMode.qml</file>
6667
<file>pages/settings/SettingsConnection.qml</file>

src/qml/pages/main.qml

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -65,36 +65,8 @@ ApplicationWindow {
6565

6666
Component {
6767
id: onboardingWizard
68-
SwipeView {
69-
id: swipeView
70-
property bool finished: false
71-
interactive: false
72-
73-
OnboardingCover {
74-
onNext: swipeView.incrementCurrentIndex()
75-
}
76-
OnboardingStrengthen {
77-
onBack: swipeView.decrementCurrentIndex()
78-
onNext: swipeView.incrementCurrentIndex()
79-
}
80-
OnboardingBlockclock {
81-
onBack: swipeView.decrementCurrentIndex()
82-
onNext: swipeView.incrementCurrentIndex()
83-
}
84-
OnboardingStorageLocation {
85-
onBack: swipeView.decrementCurrentIndex()
86-
onNext: swipeView.incrementCurrentIndex()
87-
}
88-
OnboardingStorageAmount {
89-
onBack: swipeView.decrementCurrentIndex()
90-
onNext: swipeView.incrementCurrentIndex()
91-
}
92-
OnboardingConnection {
93-
onBack: swipeView.decrementCurrentIndex()
94-
onNext: swipeView.finished = true
95-
}
96-
97-
onFinishedChanged: {
68+
OnboardingWizard {
69+
onFinished: {
9870
optionsModel.onboard()
9971
if (AppMode.walletEnabled && AppMode.isDesktop) {
10072
main.push(desktopWallets)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Copyright (c) 2024 The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
import QtQuick 2.15
6+
import QtQuick.Controls 2.15
7+
import QtQuick.Layouts 1.15
8+
import "../../controls"
9+
10+
PageStack {
11+
id: root
12+
13+
signal finished()
14+
initialItem: cover
15+
16+
Component {
17+
id: cover
18+
OnboardingCover {
19+
onNext: root.push(strengthen)
20+
}
21+
}
22+
Component {
23+
id: strengthen
24+
OnboardingStrengthen {
25+
onBack: root.pop()
26+
onNext: root.push(blockclock)
27+
}
28+
}
29+
Component {
30+
id: blockclock
31+
OnboardingBlockclock {
32+
onBack: root.pop()
33+
onNext: root.push(storageLocation)
34+
}
35+
}
36+
Component {
37+
id: storageLocation
38+
OnboardingStorageLocation {
39+
onBack: root.pop()
40+
onNext: root.push(storageAmount)
41+
}
42+
}
43+
Component {
44+
id: storageAmount
45+
OnboardingStorageAmount {
46+
onBack: root.pop()
47+
onNext: root.push(connection)
48+
}
49+
}
50+
Component {
51+
id: connection
52+
OnboardingConnection {
53+
onBack: root.pop()
54+
onNext: root.finished()
55+
}
56+
}
57+
}

0 commit comments

Comments
 (0)