wizard: display seed type. restore 2fa if needed
This commit is contained in:
@@ -252,7 +252,10 @@ class Plugin(TrustedCoinPlugin):
|
||||
vbox.addWidget(qrw, 1)
|
||||
msg = _('Then, enter your Google Authenticator code:')
|
||||
else:
|
||||
label = QLabel("This wallet is already registered, but it was never authenticated. To finalize your registration, please enter your Google Authenticator Code. If you do not have this code, delete the wallet file and start a new registration")
|
||||
label = QLabel(
|
||||
"This wallet is already registered with Trustedcoin. "
|
||||
"To finalize wallet creation, please enter your Google Authenticator Code. "
|
||||
"If you do not have this code, delete the wallet file and start a new registration")
|
||||
label.setWordWrap(1)
|
||||
vbox.addWidget(label)
|
||||
msg = _('Google Authenticator code:')
|
||||
|
||||
@@ -404,8 +404,24 @@ class TrustedCoinPlugin(BasePlugin):
|
||||
wizard.restore_seed_dialog(run_next=f, test=self.is_valid_seed)
|
||||
|
||||
def on_restore_seed(self, wizard, seed):
|
||||
f = lambda pw: wizard.run('on_restore_pw', seed, pw)
|
||||
wizard.request_password(run_next=f)
|
||||
wizard.set_icon(':icons/trustedcoin.png')
|
||||
wizard.stack = []
|
||||
title = _('Restore 2FA wallet')
|
||||
msg = ' '.join([
|
||||
'You are going to restore a wallet protected with two-factor authentication.',
|
||||
'Do you want to keep using two-factor authentication with this wallet,',
|
||||
'or do you want to disable it, and have two master private keys in your wallet?'
|
||||
])
|
||||
choices = [('keep', 'Keep'), ('disable', 'Disable')]
|
||||
f = lambda x: self.on_choice(wizard, seed, x)
|
||||
wizard.choice_dialog(choices=choices, message=msg, title=title, run_next=f)
|
||||
|
||||
def on_choice(self, wizard, seed, x):
|
||||
if x == 'disable':
|
||||
f = lambda pw: wizard.run('on_restore_pw', seed, pw)
|
||||
wizard.request_password(run_next=f)
|
||||
else:
|
||||
self.create_keystore(wizard, seed, '')
|
||||
|
||||
def on_restore_pw(self, wizard, seed, password):
|
||||
storage = wizard.storage
|
||||
|
||||
Reference in New Issue
Block a user