diff options
| author | Ilya Kitaev <mbg033@gmail.com> | 2016-08-19 14:44:44 +0300 |
|---|---|---|
| committer | Ilya Kitaev <mbg033@gmail.com> | 2016-08-19 14:44:44 +0300 |
| commit | 8d93f01db434ffd873e095d55abeeae7d8021f6f (patch) | |
| tree | 4ff1e7b9e902602ad7651d18d948fd3d596f2836 /wizard | |
| parent | d3234bb91564ee8327b111e0acf2a83153929c25 (diff) | |
| download | monzero-gui-8d93f01db434ffd873e095d55abeeae7d8021f6f.tar.gz monzero-gui-8d93f01db434ffd873e095d55abeeae7d8021f6f.tar.xz monzero-gui-8d93f01db434ffd873e095d55abeeae7d8021f6f.zip | |
WalletManager::openWalletAsync integrating with UI
Diffstat (limited to 'wizard')
| -rw-r--r-- | wizard/WizardCreateWallet.qml | 3 | ||||
| -rw-r--r-- | wizard/WizardRecoveryWallet.qml | 9 | ||||
| -rw-r--r-- | wizard/utils.js | 5 |
3 files changed, 11 insertions, 6 deletions
diff --git a/wizard/WizardCreateWallet.qml b/wizard/WizardCreateWallet.qml index 771a13ec..43b8158f 100644 --- a/wizard/WizardCreateWallet.qml +++ b/wizard/WizardCreateWallet.qml @@ -29,6 +29,7 @@ import QtQuick 2.2 import moneroComponents 1.0 import QtQuick.Dialogs 1.2 +import 'utils.js' as Utils Item { opacity: 0 @@ -54,7 +55,7 @@ Item { } function checkNextButton() { - var wordsArray = cleanWordsInput(uiItem.wordsTextItem.memoText).split(" "); + var wordsArray = Utils.lineBreaksToSpaces(uiItem.wordsTextItem.memoText).split(" "); wizard.nextButton.enabled = wordsArray.length === 25; } diff --git a/wizard/WizardRecoveryWallet.qml b/wizard/WizardRecoveryWallet.qml index 2e6fe5f6..505bc239 100644 --- a/wizard/WizardRecoveryWallet.qml +++ b/wizard/WizardRecoveryWallet.qml @@ -30,6 +30,7 @@ import QtQuick 2.2 import moneroComponents 1.0 import QtQuick.Dialogs 1.2 import Bitmonero.Wallet 1.0 +import 'utils.js' as Utils Item { opacity: 0 @@ -46,13 +47,13 @@ Item { } function checkNextButton() { - var wordsArray = cleanWordsInput(uiItem.wordsTextItem.memoText).split(" "); + var wordsArray = Utils.lineBreaksToSpaces(uiItem.wordsTextItem.memoText).split(" "); wizard.nextButton.enabled = wordsArray.length === 25; } function onPageClosed(settingsObject) { settingsObject['account_name'] = uiItem.accountNameText - settingsObject['words'] = cleanWordsInput(uiItem.wordsTextItem.memoText) + settingsObject['words'] = Utils.lineBreaksToSpaces(uiItem.wordsTextItem.memoText) settingsObject['wallet_path'] = uiItem.walletPath return recoveryWallet(settingsObject) } @@ -69,9 +70,7 @@ Item { return success; } - function cleanWordsInput(text) { - return text.trim().replace(/(\r\n|\n|\r)/gm, " "); - } + WizardManageWalletUI { id: uiItem diff --git a/wizard/utils.js b/wizard/utils.js index 0cc910c6..be066598 100644 --- a/wizard/utils.js +++ b/wizard/utils.js @@ -42,3 +42,8 @@ function mapScope (inputScopeFrom, inputScopeTo, outputScopeFrom, outputScopeTo, function tr(text) { return qsTr(text) + translationManager.emptyString } + + +function lineBreaksToSpaces(text) { + return text.trim().replace(/(\r\n|\n|\r)/gm, " "); +} |
