diff options
| author | Ilya Kitaev <mbg033@gmail.com> | 2016-06-10 16:41:13 +0300 |
|---|---|---|
| committer | Ilya Kitaev <mbg033@gmail.com> | 2016-06-10 16:41:13 +0300 |
| commit | fd50e6f9a3bc445cb3c0d21b7a0f584e95b44450 (patch) | |
| tree | e942ec37af313d0e51a2f7f7eca8f45ff834b679 /wizard/WizardCreateWallet.qml | |
| parent | 5c10be325103d668884fc5e463aaa59c726d4f8e (diff) | |
| download | monzero-gui-fd50e6f9a3bc445cb3c0d21b7a0f584e95b44450.tar.gz monzero-gui-fd50e6f9a3bc445cb3c0d21b7a0f584e95b44450.tar.xz monzero-gui-fd50e6f9a3bc445cb3c0d21b7a0f584e95b44450.zip | |
new wallet wizard: wallet created in temporary directory and moved to
the destination at the final step
Diffstat (limited to 'wizard/WizardCreateWallet.qml')
| -rw-r--r-- | wizard/WizardCreateWallet.qml | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/wizard/WizardCreateWallet.qml b/wizard/WizardCreateWallet.qml index 346627dc..653db251 100644 --- a/wizard/WizardCreateWallet.qml +++ b/wizard/WizardCreateWallet.qml @@ -40,18 +40,23 @@ Item { onOpacityChanged: visible = opacity !== 0 - function saveSettings(settingsObject) { + //! function called each time we display this page + + function onPageClosed(settingsObject) { settingsObject['account_name'] = uiItem.accountNameText settingsObject['words'] = uiItem.wordsTexttext settingsObject['wallet_path'] = uiItem.walletPath + // put wallet files to the subdirectory with the same name as + // wallet name var new_wallet_filename = settingsObject.wallet_path + "/" + + settingsObject.account_name + "/" + settingsObject.account_name; // moving wallet files to the new destination, if user changed it if (new_wallet_filename !== settingsObject.wallet_filename) { // using previously saved wallet; - settingsObject.wallet.rename(new_wallet_filename); + settingsObject.wallet.store(new_wallet_filename); //walletManager.moveWallet(settingsObject.wallet_filename, new_wallet_filename); } @@ -59,10 +64,18 @@ Item { settingsObject['wallet_filename'] = new_wallet_filename; } + //! function called each time we hide this page + // + + function createWallet(settingsObject) { - var wallet_filename = uiItem.walletPath + "/" + uiItem.accountNameText + // TODO: create wallet in temporary filename and a) move it to the path specified by user after the final + // page submitted or b) delete it when program closed before reaching final page + + var wallet_filename = oshelper.temporaryFilename(); if (typeof settingsObject.wallet === 'undefined') { - var wallet = walletManager.createWallet(wallet_filename, "", settingsObject.locale) + //var wallet = walletManager.createWallet(wallet_filename, "", settingsObject.language) + var wallet = walletManager.createWallet(wallet_filename, "", settingsObject.wallet_language) uiItem.wordsTextItem.memoText = wallet.seed // saving wallet in "global" settings object // TODO: wallet should have a property pointing to the file where it stored or loaded from @@ -70,10 +83,12 @@ Item { } else { print("wallet already created. we just stepping back"); } - settingsObject.wallet_filename = wallet_filename } + + + WizardManageWalletUI { id: uiItem titleText: qsTr("A new wallet has been created for you") |
