Browse Source

don't store wallet_type in wizard; refactoring

283
ThomasV 11 years ago
parent
commit
edb5552a31
  1. 19
      gui/qt/installwizard.py

19
gui/qt/installwizard.py

@ -373,25 +373,22 @@ class InstallWizard(QDialog):
if action == 'new': if action == 'new':
action, wallet_type = self.restore_or_create() action, wallet_type = self.restore_or_create()
self.storage.put('wallet_type', wallet_type, False)
if action is None: if action is None:
return return
if action == 'restore': if action == 'restore':
wallet = self.restore(wallet_type) wallet = self.restore(wallet_type)
if not wallet: if not wallet:
return return
action = None action = None
elif action == 'create':
else:
wallet = Wallet(self.storage) wallet = Wallet(self.storage)
action = wallet.get_action() action = wallet.get_action()
# fixme: password is only needed for multiple accounts # fixme: password is only needed for multiple accounts
password = None password = None
else:
raise BaseException('unknown action')
while action is not None: while action is not None:
util.print_error("installwizard:", wallet, action) util.print_error("installwizard:", wallet, action)
if action == 'create_seed': if action == 'create_seed':
@ -457,12 +454,10 @@ class InstallWizard(QDialog):
if action == 'restore': if action == 'restore':
self.waiting_dialog(lambda: wallet.restore(self.waiting_label.setText)) self.waiting_dialog(lambda: wallet.restore(self.waiting_label.setText))
if self.network: if self.network:
if wallet.is_found(): msg = _("Recovery successful") if wallet.is_found() else _("No transactions found for this seed")
QMessageBox.information(None, _('Information'), _("Recovery successful"), _('OK'))
else:
QMessageBox.information(None, _('Information'), _("No transactions found for this seed"), _('OK'))
else: else:
QMessageBox.information(None, _('Information'), _("This wallet was restored offline. It may contain more addresses than displayed."), _('OK')) msg = _("This wallet was restored offline. It may contain more addresses than displayed.")
QMessageBox.information(None, _('Information'), msg, _('OK'))
return wallet return wallet
@ -491,7 +486,7 @@ class InstallWizard(QDialog):
elif Wallet.is_private_key(text): elif Wallet.is_private_key(text):
wallet = Wallet.from_private_key(text, self.storage) wallet = Wallet.from_private_key(text, self.storage)
else: else:
raise raise BaseException('unknown wallet type')
elif t in ['2of2']: elif t in ['2of2']:
r = self.multi_seed_dialog(1) r = self.multi_seed_dialog(1)

Loading…
Cancel
Save