mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
parent
7aaac2ee30
commit
003e6c3e79
2 changed files with 10 additions and 3 deletions
|
@ -560,11 +560,13 @@ class BaseWizard(Logger):
|
|||
self.terminate()
|
||||
|
||||
def create_storage(self, path):
|
||||
if os.path.exists(path):
|
||||
raise Exception('file already exists at path')
|
||||
if not self.pw_args:
|
||||
return
|
||||
password, encrypt_storage, storage_enc_version = self.pw_args
|
||||
storage = WalletStorage(path)
|
||||
storage.set_keystore_encryption(bool(password)) # and encrypt_keystore)
|
||||
storage.set_keystore_encryption(bool(password))
|
||||
if encrypt_storage:
|
||||
storage.set_password(password, enc_version=storage_enc_version)
|
||||
for key, value in self.data.items():
|
||||
|
|
|
@ -43,6 +43,7 @@ from electrum.i18n import _
|
|||
from electrum.plugin import hook
|
||||
from electrum.util import is_valid_email
|
||||
from electrum.logging import Logger
|
||||
from electrum.base_wizard import GoBack
|
||||
|
||||
from .trustedcoin import TrustedCoinPlugin, server
|
||||
|
||||
|
@ -221,9 +222,13 @@ class Plugin(TrustedCoinPlugin):
|
|||
_('If you are online, click on "{}" to continue.').format(_('Next'))
|
||||
]
|
||||
msg = '\n\n'.join(msg)
|
||||
wizard.create_storage(wizard.path)
|
||||
wizard.reset_stack()
|
||||
wizard.confirm_dialog(title='', message=msg, run_next = lambda x: wizard.run('accept_terms_of_use'))
|
||||
try:
|
||||
wizard.confirm_dialog(title='', message=msg, run_next = lambda x: wizard.run('accept_terms_of_use'))
|
||||
except GoBack:
|
||||
# user clicked 'Cancel' and decided to move wallet file manually
|
||||
wizard.create_storage(wizard.path)
|
||||
raise
|
||||
|
||||
def accept_terms_of_use(self, window):
|
||||
vbox = QVBoxLayout()
|
||||
|
|
Loading…
Add table
Reference in a new issue