fix #1057
This commit is contained in:
parent
50fed3dce5
commit
8251c5b6d9
@ -160,8 +160,12 @@ class ElectrumGui:
|
|||||||
return
|
return
|
||||||
wizard = installwizard.InstallWizard(self.config, self.network, storage)
|
wizard = installwizard.InstallWizard(self.config, self.network, storage)
|
||||||
wizard.show()
|
wizard.show()
|
||||||
|
if action == 'new':
|
||||||
|
action, wallet_type = wizard.restore_or_create()
|
||||||
|
else:
|
||||||
|
wallet_type = None
|
||||||
try:
|
try:
|
||||||
wallet = wizard.run(action)
|
wallet = wizard.run(action, wallet_type)
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
traceback.print_exc(file=sys.stdout)
|
traceback.print_exc(file=sys.stdout)
|
||||||
QMessageBox.information(None, _('Error'), str(e), _('OK'))
|
QMessageBox.information(None, _('Error'), str(e), _('OK'))
|
||||||
|
|||||||
@ -314,13 +314,9 @@ class InstallWizard(QDialog):
|
|||||||
return run_password_dialog(self, None, self)[2]
|
return run_password_dialog(self, None, self)[2]
|
||||||
|
|
||||||
|
|
||||||
|
def run(self, action, wallet_type):
|
||||||
|
|
||||||
|
if action in ['create', 'restore']:
|
||||||
|
|
||||||
def run(self, action):
|
|
||||||
|
|
||||||
if action == 'new':
|
|
||||||
action, wallet_type = self.restore_or_create()
|
|
||||||
if wallet_type == 'multisig':
|
if wallet_type == 'multisig':
|
||||||
wallet_type = self.choice(_("Multi Signature Wallet"), 'Select wallet type', [('2of2', _("2 of 2")),('2of3',_("2 of 3"))])
|
wallet_type = self.choice(_("Multi Signature Wallet"), 'Select wallet type', [('2of2', _("2 of 2")),('2of3',_("2 of 3"))])
|
||||||
if not wallet_type:
|
if not wallet_type:
|
||||||
@ -332,7 +328,6 @@ class InstallWizard(QDialog):
|
|||||||
return
|
return
|
||||||
elif wallet_type == 'twofactor':
|
elif wallet_type == 'twofactor':
|
||||||
wallet_type = '2fa'
|
wallet_type = '2fa'
|
||||||
|
|
||||||
if action == 'create':
|
if action == 'create':
|
||||||
self.storage.put('wallet_type', wallet_type, False)
|
self.storage.put('wallet_type', wallet_type, False)
|
||||||
|
|
||||||
|
|||||||
@ -274,11 +274,12 @@ class ElectrumWindow(QMainWindow):
|
|||||||
# run wizard
|
# run wizard
|
||||||
if action is not None:
|
if action is not None:
|
||||||
wallet = self.gui_object.run_wizard(storage, action)
|
wallet = self.gui_object.run_wizard(storage, action)
|
||||||
if not wallet:
|
|
||||||
self.show()
|
|
||||||
return
|
|
||||||
else:
|
else:
|
||||||
wallet.start_threads(self.network)
|
wallet.start_threads(self.network)
|
||||||
|
# keep current wallet
|
||||||
|
if not wallet:
|
||||||
|
self.show()
|
||||||
|
return
|
||||||
# close current wallet
|
# close current wallet
|
||||||
self.close_wallet()
|
self.close_wallet()
|
||||||
# load new wallet in gui
|
# load new wallet in gui
|
||||||
@ -329,11 +330,19 @@ class ElectrumWindow(QMainWindow):
|
|||||||
|
|
||||||
self.hide()
|
self.hide()
|
||||||
wizard = installwizard.InstallWizard(self.config, self.network, storage)
|
wizard = installwizard.InstallWizard(self.config, self.network, storage)
|
||||||
wallet = wizard.run('new')
|
action, wallet_type = wizard.restore_or_create()
|
||||||
|
if not action:
|
||||||
|
self.show()
|
||||||
|
return
|
||||||
|
# close current wallet, but keep a reference to it
|
||||||
|
self.close_wallet()
|
||||||
|
wallet = wizard.run(action, wallet_type)
|
||||||
if wallet:
|
if wallet:
|
||||||
if self.wallet:
|
|
||||||
self.close_wallet()
|
|
||||||
self.load_wallet(wallet)
|
self.load_wallet(wallet)
|
||||||
|
else:
|
||||||
|
self.wallet.start_threads()
|
||||||
|
self.load_wallet(self.wallet)
|
||||||
|
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user