diff --git a/wizard/WizardMain.qml b/wizard/WizardMain.qml index b81dee4f..194f047a 100644 --- a/wizard/WizardMain.qml +++ b/wizard/WizardMain.qml @@ -132,6 +132,8 @@ ColumnLayout { print ("show recovery wallet page"); currentPath = "recovery_wallet" pages = paths[currentPath] + // Create temporary wallet + createWalletPage.createWallet(settings) wizard.nextButton.visible = true // goto next page switchPage(true); diff --git a/wizard/WizardManageWalletUI.qml b/wizard/WizardManageWalletUI.qml index 9c79672d..fb714ad0 100644 --- a/wizard/WizardManageWalletUI.qml +++ b/wizard/WizardManageWalletUI.qml @@ -86,6 +86,31 @@ ColumnLayout { return wordsArray.length === 25 } + function updateFromQrCode(address, payment_id, amount, tx_description, recipient_name, extra_parameters) { + // Switch to recover from keys + recoverFromSeedMode = false + spendKeyLine.text = "" + viewKeyLine.text = "" + restoreHeightItem.text = "" + + + if(typeof extra_parameters.secret_view_key != "undefined") { + viewKeyLine.text = extra_parameters.secret_view_key + } + if(typeof extra_parameters.secret_spend_key != "undefined") { + spendKeyLine.text = extra_parameters.secret_spend_key + } + if(typeof extra_parameters.restore_height != "undefined") { + restoreHeightItem.text = extra_parameters.restore_height + } + addressLine.text = address + + cameraUi.qrcode_decoded.disconnect(updateFromQrCode) + + // Check if keys are correct + checkNextButton(); + } + RowLayout { id: dotsRow Layout.alignment: Qt.AlignRight @@ -144,9 +169,10 @@ ColumnLayout { } } - RowLayout{ + GridLayout{ + columns: (isMobile)? 2 : 4 visible: recoverMode - spacing: 0 + StandardButton { id: recoverFromSeedButton text: qsTr("Restore from seed") + translationManager.emptyString @@ -174,6 +200,22 @@ ColumnLayout { checkNextButton(); } } + + StandardButton { + id: qrfinderButton + text: qsTr("From QR Code") + translationManager.emptyString + shadowReleasedColor: "#FF4304" + shadowPressedColor: "#B32D00" + releasedColor: "#FF6C3C" + pressedColor: "#FF4304" + visible : true //appWindow.qrScannerEnabled + enabled : visible + onClicked: { + cameraUi.state = "Capture" + cameraUi.qrcode_decoded.connect(updateFromQrCode) + } + } + } // Recover from seed diff --git a/wizard/WizardRecoveryWallet.qml b/wizard/WizardRecoveryWallet.qml index ed92ce1c..acf0caea 100644 --- a/wizard/WizardRecoveryWallet.qml +++ b/wizard/WizardRecoveryWallet.qml @@ -81,6 +81,12 @@ ColumnLayout { var tmp_wallet_filename = oshelper.temporaryFilename() console.log("Creating temporary wallet", tmp_wallet_filename) + // delete the temporary wallet object before creating new + if (typeof m_wallet !== 'undefined') { + walletManager.closeWallet() + console.log("deleting temporary wallet") + } + // From seed or keys if(fromSeed) var wallet = walletManager.recoveryWallet(tmp_wallet_filename, settingsObject.words, testnet, restoreHeight)