commit 16db27ffc02e22e3558a34c5e9358e1bfb0cab63
parent 2bb08aa2807901185f68da21979912131d8de743
Author: ThomasV <thomasv@electrum.org>
Date: Sun, 31 Jul 2016 10:59:42 +0200
wizard: remove run_wallet
Diffstat:
4 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/gui/qt/installwizard.py b/gui/qt/installwizard.py
@@ -309,6 +309,10 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
"contain more addresses than displayed.")
self.show_message(msg)
+ @wizard_dialog
+ def confirm_dialog(self, msg, run_next):
+ self.confirm(msg)
+
def confirm(self, msg):
vbox = QVBoxLayout()
vbox.addWidget(WWLabel(msg))
diff --git a/lib/base_wizard.py b/lib/base_wizard.py
@@ -80,12 +80,6 @@ class BaseWizard(object):
action, args = self.stack.pop()
self.run(action, *args)
- def run_wallet(self):
- self.stack = []
- action = self.wallet.get_action()
- if action:
- self.action_dialog(action=action, run_next=lambda x: self.run_wallet())
-
def new(self):
name = os.path.basename(self.storage.path)
title = _("Welcome to the Electrum installation wizard.")
@@ -147,7 +141,7 @@ class BaseWizard(object):
def create_2fa(self):
self.storage.put('wallet_type', '2fa')
self.wallet = Wallet(self.storage)
- self.run_wallet()
+ self.run('show_disclaimer')
def restore_seed(self):
# TODO: return derivation password too
diff --git a/plugins/trustedcoin/qt.py b/plugins/trustedcoin/qt.py
@@ -38,7 +38,7 @@ from electrum_gui.qt.main_window import StatusBarButton
from electrum.i18n import _
from electrum.plugins import hook
-from trustedcoin import TrustedCoinPlugin, DISCLAIMER, server
+from trustedcoin import TrustedCoinPlugin, server
def need_server(wallet, tx):
from electrum.account import BIP32_Account
@@ -109,11 +109,6 @@ class Plugin(TrustedCoinPlugin):
return WaitingDialog(window, 'Getting billing information...', task,
on_finished)
- def show_disclaimer(self, wallet, wizard):
- wizard.set_icon(':icons/trustedcoin.png')
- wizard.confirm('\n\n'.join(DISCLAIMER))
- self.set_enabled(wallet, True)
-
@hook
def abort_send(self, window):
wallet = window.wallet
diff --git a/plugins/trustedcoin/trustedcoin.py b/plugins/trustedcoin/trustedcoin.py
@@ -351,6 +351,12 @@ class TrustedCoinPlugin(BasePlugin):
seed = wallet.make_seed()
self.wizard.show_seed_dialog(run_next=wizard.confirm_seed, seed_text=seed)
+ def show_disclaimer(self, wallet, wizard):
+ self.set_enabled(wallet, True)
+ wizard.set_icon(':icons/trustedcoin.png')
+ wizard.stack = []
+ wizard.confirm_dialog('\n\n'.join(DISCLAIMER), run_next = lambda x: wizard.run('create_extended_seed'))
+
def create_wallet(self, wallet, wizard, seed, password):
wallet.storage.put('seed_version', wallet.seed_version)
wallet.storage.put('use_encryption', password is not None)
@@ -369,8 +375,8 @@ class TrustedCoinPlugin(BasePlugin):
_('If you are online, click on "%s" to continue.') % _('Next')
]
msg = '\n\n'.join(msg)
- wizard.confirm(msg)
- wizard.run('create_remote_key')
+ wizard.stack = []
+ wizard.confirm_dialog(msg, run_next = lambda x: wizard.run('create_remote_key'))
@hook
def do_clear(self, window):