fix trustedcoin wizard. fixes #2276
This commit is contained in:
parent
9628619e68
commit
e43abb5c96
|
@ -232,7 +232,7 @@ class Plugin(TrustedCoinPlugin):
|
|||
email_e.textChanged.connect(set_enabled)
|
||||
email_e.setFocus(True)
|
||||
|
||||
window.set_main_layout(vbox, next_enabled=False)
|
||||
window.exec_layout(vbox, next_enabled=False)
|
||||
next_button.setText(prior_button_text)
|
||||
return str(email_e.text())
|
||||
|
||||
|
@ -275,7 +275,7 @@ class Plugin(TrustedCoinPlugin):
|
|||
pw.textChanged.connect(set_enabled)
|
||||
cb_lost.toggled.connect(set_enabled)
|
||||
|
||||
window.set_main_layout(vbox, next_enabled=False,
|
||||
window.exec_layout(vbox, next_enabled=False,
|
||||
raise_on_cancel=False)
|
||||
return pw.get_amount(), cb_lost.isChecked()
|
||||
|
||||
|
|
|
@ -377,11 +377,11 @@ class TrustedCoinPlugin(BasePlugin):
|
|||
xprv1, xpub1, xprv2, xpub2 = self.xkeys_from_seed(seed, passphrase)
|
||||
k1 = keystore.from_xprv(xprv1)
|
||||
k2 = keystore.from_xpub(xpub2)
|
||||
wizard.request_password(run_next=lambda pw: self.on_password(wizard, pw, k1, k2))
|
||||
wizard.request_password(run_next=lambda pw, encrypt: self.on_password(wizard, pw, encrypt, k1, k2))
|
||||
|
||||
def on_password(self, wizard, password, k1, k2):
|
||||
def on_password(self, wizard, password, encrypt, k1, k2):
|
||||
k1.update_password(None, password)
|
||||
wizard.storage.put('use_encryption', bool(password))
|
||||
wizard.storage.set_password(password, encrypt)
|
||||
wizard.storage.put('x1/', k1.dump())
|
||||
wizard.storage.put('x2/', k2.dump())
|
||||
wizard.storage.write()
|
||||
|
@ -424,12 +424,12 @@ class TrustedCoinPlugin(BasePlugin):
|
|||
|
||||
def on_choice(self, wizard, seed, passphrase, x):
|
||||
if x == 'disable':
|
||||
f = lambda pw: wizard.run('on_restore_pw', seed, passphrase, pw)
|
||||
f = lambda pw, encrypt: wizard.run('on_restore_pw', seed, passphrase, pw, encrypt)
|
||||
wizard.request_password(run_next=f)
|
||||
else:
|
||||
self.create_keystore(wizard, seed, passphrase)
|
||||
|
||||
def on_restore_pw(self, wizard, seed, passphrase, password):
|
||||
def on_restore_pw(self, wizard, seed, passphrase, password, encrypt):
|
||||
storage = wizard.storage
|
||||
xprv1, xpub1, xprv2, xpub2 = self.xkeys_from_seed(seed, passphrase)
|
||||
k1 = keystore.from_xprv(xprv1)
|
||||
|
|
Loading…
Reference in New Issue