electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit edb5552a31c6de7ef36e5ebe03cfae78d786bbbc
parent 3a5f64fcc7ec521856b3d9d852faef3b508632c7
Author: ThomasV <thomasv@gitorious>
Date:   Thu, 21 Aug 2014 09:49:34 +0200

don't store wallet_type in wizard; refactoring

Diffstat:
Mgui/qt/installwizard.py | 19+++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/gui/qt/installwizard.py b/gui/qt/installwizard.py @@ -373,25 +373,22 @@ class InstallWizard(QDialog): if action == 'new': action, wallet_type = self.restore_or_create() - self.storage.put('wallet_type', wallet_type, False) - if action is None: return - if action == 'restore': wallet = self.restore(wallet_type) if not wallet: return action = None - - else: + elif action == 'create': wallet = Wallet(self.storage) action = wallet.get_action() # fixme: password is only needed for multiple accounts password = None + else: + raise BaseException('unknown action') while action is not None: - util.print_error("installwizard:", wallet, action) if action == 'create_seed': @@ -457,12 +454,10 @@ class InstallWizard(QDialog): if action == 'restore': self.waiting_dialog(lambda: wallet.restore(self.waiting_label.setText)) if self.network: - if wallet.is_found(): - QMessageBox.information(None, _('Information'), _("Recovery successful"), _('OK')) - else: - QMessageBox.information(None, _('Information'), _("No transactions found for this seed"), _('OK')) + msg = _("Recovery successful") if wallet.is_found() else _("No transactions found for this seed") 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 @@ -491,7 +486,7 @@ class InstallWizard(QDialog): elif Wallet.is_private_key(text): wallet = Wallet.from_private_key(text, self.storage) else: - raise + raise BaseException('unknown wallet type') elif t in ['2of2']: r = self.multi_seed_dialog(1)