diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 1e27ddee98..33f4e26f24 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -428,12 +428,12 @@ QML_RES_QML = \ qml/pages/settings/SettingsProxy.qml \ qml/pages/settings/SettingsStorage.qml \ qml/pages/settings/SettingsTheme.qml \ - qml/pages/wallet/AddWallet.qml \ qml/pages/wallet/CreateBackup.qml \ qml/pages/wallet/CreateConfirm.qml \ qml/pages/wallet/CreateIntro.qml \ qml/pages/wallet/CreateName.qml \ qml/pages/wallet/CreatePassword.qml \ + qml/pages/wallet/CreateWalletWizard.qml \ qml/pages/wallet/DesktopWallets.qml \ qml/pages/wallet/WalletBadge.qml \ qml/pages/wallet/WalletSelect.qml diff --git a/src/qml/bitcoin_qml.qrc b/src/qml/bitcoin_qml.qrc index ec48e0c74d..e64fab65e1 100644 --- a/src/qml/bitcoin_qml.qrc +++ b/src/qml/bitcoin_qml.qrc @@ -68,12 +68,12 @@ pages/settings/SettingsProxy.qml pages/settings/SettingsStorage.qml pages/settings/SettingsTheme.qml - pages/wallet/AddWallet.qml pages/wallet/CreateBackup.qml pages/wallet/CreateConfirm.qml pages/wallet/CreateIntro.qml pages/wallet/CreateName.qml pages/wallet/CreatePassword.qml + pages/wallet/CreateWalletWizard.qml pages/wallet/DesktopWallets.qml pages/wallet/WalletBadge.qml pages/wallet/WalletSelect.qml diff --git a/src/qml/pages/main.qml b/src/qml/pages/main.qml index 80cb25a623..428e5f7527 100644 --- a/src/qml/pages/main.qml +++ b/src/qml/pages/main.qml @@ -98,7 +98,7 @@ ApplicationWindow { optionsModel.onboard() if (AppMode.walletEnabled && AppMode.isDesktop) { main.push(desktopWallets) - main.push(addWallet) + main.push(createWalletWizard) } else { main.push(node) } @@ -112,8 +112,8 @@ ApplicationWindow { } Component { - id: addWallet - AddWallet { + id: createWalletWizard + CreateWalletWizard { onFinished: { main.pop() } diff --git a/src/qml/pages/wallet/CreateBackup.qml b/src/qml/pages/wallet/CreateBackup.qml index fe01bed443..603b5ae989 100644 --- a/src/qml/pages/wallet/CreateBackup.qml +++ b/src/qml/pages/wallet/CreateBackup.qml @@ -12,6 +12,8 @@ import "../settings" Page { id: root + signal back + signal next background: null header: NavigationBar2 { @@ -20,7 +22,7 @@ Page { iconSource: "image://images/caret-left" text: qsTr("Back") onClicked: { - root.StackView.view.pop() + root.back() } } } @@ -83,7 +85,7 @@ Page { Layout.alignment: Qt.AlignCenter text: qsTr("Done") onClicked: { - root.StackView.view.finished() + root.next() } } } diff --git a/src/qml/pages/wallet/CreateConfirm.qml b/src/qml/pages/wallet/CreateConfirm.qml index 64a2e37e98..d99e7d41a6 100644 --- a/src/qml/pages/wallet/CreateConfirm.qml +++ b/src/qml/pages/wallet/CreateConfirm.qml @@ -12,6 +12,8 @@ import "../settings" Page { id: root + signal back + signal next background: null header: NavigationBar2 { @@ -20,7 +22,7 @@ Page { iconSource: "image://images/caret-left" text: qsTr("Back") onClicked: { - root.StackView.view.pop() + root.back() } } } @@ -67,7 +69,7 @@ Page { Layout.alignment: Qt.AlignCenter text: qsTr("Next") onClicked: { - root.StackView.view.push("qrc:/qml/pages/wallet/CreateBackup.qml") + root.next() } } } diff --git a/src/qml/pages/wallet/CreateIntro.qml b/src/qml/pages/wallet/CreateIntro.qml index ee1cb8bdf2..802a1d2a63 100644 --- a/src/qml/pages/wallet/CreateIntro.qml +++ b/src/qml/pages/wallet/CreateIntro.qml @@ -12,6 +12,8 @@ import "../settings" Page { id: root + signal back + signal next background: null header: NavigationBar2 { @@ -20,7 +22,7 @@ Page { iconSource: "image://images/caret-left" text: qsTr("Back") onClicked: { - root.StackView.view.pop() + root.back() } } } @@ -107,7 +109,7 @@ Page { Layout.alignment: Qt.AlignCenter text: qsTr("Start") onClicked: { - root.StackView.view.push("qrc:/qml/pages/wallet/CreateName.qml") + root.next() } } } diff --git a/src/qml/pages/wallet/CreateName.qml b/src/qml/pages/wallet/CreateName.qml index 5410cf3ba3..a780f23f76 100644 --- a/src/qml/pages/wallet/CreateName.qml +++ b/src/qml/pages/wallet/CreateName.qml @@ -12,6 +12,9 @@ import "../settings" Page { id: root + signal back + signal next + property string walletName: "" background: null header: NavigationBar2 { @@ -20,7 +23,7 @@ Page { iconSource: "image://images/caret-left" text: qsTr("Back") onClicked: { - root.StackView.view.pop() + root.back() } } } @@ -62,14 +65,8 @@ Page { text: qsTr("Continue") onClicked: { console.log("Creating wallet with name: " + walletNameInput.text) - root.StackView.view.push(createPassword) - } - } - - Component { - id: createPassword - CreatePassword { - walletName: walletNameInput.text + root.walletName = walletNameInput.text + root.next() } } } diff --git a/src/qml/pages/wallet/CreatePassword.qml b/src/qml/pages/wallet/CreatePassword.qml index 6b6cfcd624..595443e2ac 100644 --- a/src/qml/pages/wallet/CreatePassword.qml +++ b/src/qml/pages/wallet/CreatePassword.qml @@ -12,6 +12,8 @@ import "../settings" Page { id: root + signal back + signal next background: null required property string walletName; @@ -22,14 +24,14 @@ Page { iconSource: "image://images/caret-left" text: qsTr("Back") onClicked: { - root.StackView.view.pop() + root.back() } } rightItem: NavButton { text: qsTr("Skip") onClicked: { walletController.createSingleSigWallet(walletName, "") - root.StackView.view.push("qrc:/qml/pages/wallet/CreateConfirm.qml") + root.next() } } } @@ -108,7 +110,7 @@ Page { enabled: password.text != "" && passwordRepeat.text != "" && password.text == passwordRepeat.text && confirmToggle.loadedItem.checked onClicked: { walletController.createSingleSigWallet(walletName, password.text) - root.StackView.view.push("qrc:/qml/pages/wallet/CreateConfirm.qml") + root.next() } } } diff --git a/src/qml/pages/wallet/AddWallet.qml b/src/qml/pages/wallet/CreateWalletWizard.qml similarity index 71% rename from src/qml/pages/wallet/AddWallet.qml rename to src/qml/pages/wallet/CreateWalletWizard.qml index f77fc7ebf3..ff60b637f7 100644 --- a/src/qml/pages/wallet/AddWallet.qml +++ b/src/qml/pages/wallet/CreateWalletWizard.qml @@ -11,9 +11,10 @@ import "../settings" import "../wallet" StackView { - id: addWalletStack + id: root signal finished() + property string walletName: "" initialItem: Page { background: null @@ -23,7 +24,7 @@ StackView { rightItem: NavButton { text: qsTr("Skip") onClicked: { - addWalletStack.finished() + root.finished() } } } @@ -59,7 +60,7 @@ StackView { Layout.alignment: Qt.AlignCenter text: qsTr("Create wallet") onClicked: { - addWalletStack.push("qrc:/qml/pages/wallet/CreateIntro.qml"); + root.push(intro) } } @@ -79,5 +80,44 @@ StackView { } } } + Component { + id: intro + CreateIntro { + onBack: root.pop() + onNext: root.push(name) + } + } + Component { + id: name + CreateName { + id: createName + onBack: root.pop() + onNext: { + root.walletName = createName.walletName + root.push(password) + } + } + } + Component { + id: password + CreatePassword { + walletName: root.walletName + onBack: root.pop() + onNext: root.push(confirm) + } + } + Component { + id: confirm + CreateConfirm { + onBack: root.pop() + onNext: root.push(backup) + } + } + Component { + id: backup + CreateBackup { + onBack: root.pop() + onNext: root.finished() + } + } } -