Skip to content

Commit 03b568d

Browse files
committed
qml: Add Context to CreateWalletWizard
The Context is used to change the nav bar text
1 parent 5b9b484 commit 03b568d

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

src/qml/pages/main.qml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ ApplicationWindow {
6969
onFinished: {
7070
optionsModel.onboard()
7171
if (AppMode.walletEnabled && AppMode.isDesktop) {
72-
main.push(desktopWallets)
73-
main.push(createWalletWizard)
72+
main.push([
73+
desktopWallets, {},
74+
createWalletWizard, { "launchContext": CreateWalletWizard.Context.Onboarding }
75+
])
7476
} else {
7577
main.push(node)
7678
}
@@ -82,7 +84,7 @@ ApplicationWindow {
8284
id: desktopWallets
8385
DesktopWallets {
8486
onAddWallet: {
85-
main.push(createWalletWizard)
87+
main.push(createWalletWizard, { "launchContext": CreateWalletWizard.Context.Main })
8688
}
8789
onSendTransaction: {
8890
main.push(sendReviewPage)

src/qml/pages/wallet/CreateWalletWizard.qml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,27 @@ import "../wallet"
1313
PageStack {
1414
id: root
1515

16+
enum Context { Onboarding, Main }
17+
1618
signal finished()
1719
property string walletName: ""
20+
property int launchContext: CreateWalletWizard.Context.Onboarding
1821

1922
initialItem: Page {
2023
background: null
2124

2225
header: NavigationBar2 {
2326
id: navbar
2427
rightItem: NavButton {
25-
text: qsTr("Skip")
28+
text: {
29+
switch (root.launchContext) {
30+
case CreateWalletWizard.Context.Main:
31+
return qsTr("Cancel");
32+
case CreateWalletWizard.Context.Onboarding:
33+
default:
34+
return qsTr("Skip");
35+
}
36+
}
2637
onClicked: {
2738
root.finished()
2839
}

0 commit comments

Comments
 (0)