wizard: remove run_wallet
This commit is contained in:
parent
2bb08aa280
commit
16db27ffc0
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue