From 0d24f642c3e81af8fc61a898c4e69df2bc91fc8b Mon Sep 17 00:00:00 2001 From: dsc Date: Fri, 1 Mar 2019 09:09:02 +0100 Subject: [PATCH] invalidate wallet name after creation --- wizard/WizardCreateDevice1.qml | 6 ++++++ wizard/WizardCreateWallet1.qml | 6 ++++++ wizard/WizardRestoreWallet1.qml | 1 + wizard/WizardWalletInput.qml | 5 +++++ 4 files changed, 18 insertions(+) diff --git a/wizard/WizardCreateDevice1.qml b/wizard/WizardCreateDevice1.qml index a9b15303..cebe0183 100644 --- a/wizard/WizardCreateDevice1.qml +++ b/wizard/WizardCreateDevice1.qml @@ -184,4 +184,10 @@ Rectangle { wizardCreateDevice1.update(); console.log() } + + function onPageCompleted(previousView){ + if(previousView.viewName == "wizardHome"){ + walletInput.reset(); + } + } } diff --git a/wizard/WizardCreateWallet1.qml b/wizard/WizardCreateWallet1.qml index 5d484408..69866abd 100644 --- a/wizard/WizardCreateWallet1.qml +++ b/wizard/WizardCreateWallet1.qml @@ -144,4 +144,10 @@ Rectangle { } } } + + function onPageCompleted(previousView){ + if(previousView.viewName == "wizardHome"){ + walletInput.reset(); + } + } } diff --git a/wizard/WizardRestoreWallet1.qml b/wizard/WizardRestoreWallet1.qml index cff87b4d..95e125fe 100644 --- a/wizard/WizardRestoreWallet1.qml +++ b/wizard/WizardRestoreWallet1.qml @@ -305,6 +305,7 @@ Rectangle { function onPageCompleted(previousView){ if(previousView.viewName == "wizardHome"){ // cleanup + walletInput.reset(); seedInput.text = ""; addressLine.text = ""; spendKeyLine.text = ""; diff --git a/wizard/WizardWalletInput.qml b/wizard/WizardWalletInput.qml index aba521f7..e8946647 100644 --- a/wizard/WizardWalletInput.qml +++ b/wizard/WizardWalletInput.qml @@ -52,6 +52,11 @@ GridLayout { return false; } + function reset() { + walletName.error = !walletName.verify(); + walletLocation.error = walletLocation.text === ""; + } + MoneroComponents.LineEdit { id: walletName Layout.fillWidth: true