wizard: remove run_wallet
This commit is contained in:
@@ -309,6 +309,10 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
|
|||||||
"contain more addresses than displayed.")
|
"contain more addresses than displayed.")
|
||||||
self.show_message(msg)
|
self.show_message(msg)
|
||||||
|
|
||||||
|
@wizard_dialog
|
||||||
|
def confirm_dialog(self, msg, run_next):
|
||||||
|
self.confirm(msg)
|
||||||
|
|
||||||
def confirm(self, msg):
|
def confirm(self, msg):
|
||||||
vbox = QVBoxLayout()
|
vbox = QVBoxLayout()
|
||||||
vbox.addWidget(WWLabel(msg))
|
vbox.addWidget(WWLabel(msg))
|
||||||
|
|||||||
@@ -80,12 +80,6 @@ class BaseWizard(object):
|
|||||||
action, args = self.stack.pop()
|
action, args = self.stack.pop()
|
||||||
self.run(action, *args)
|
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):
|
def new(self):
|
||||||
name = os.path.basename(self.storage.path)
|
name = os.path.basename(self.storage.path)
|
||||||
title = _("Welcome to the Electrum installation wizard.")
|
title = _("Welcome to the Electrum installation wizard.")
|
||||||
@@ -147,7 +141,7 @@ class BaseWizard(object):
|
|||||||
def create_2fa(self):
|
def create_2fa(self):
|
||||||
self.storage.put('wallet_type', '2fa')
|
self.storage.put('wallet_type', '2fa')
|
||||||
self.wallet = Wallet(self.storage)
|
self.wallet = Wallet(self.storage)
|
||||||
self.run_wallet()
|
self.run('show_disclaimer')
|
||||||
|
|
||||||
def restore_seed(self):
|
def restore_seed(self):
|
||||||
# TODO: return derivation password too
|
# TODO: return derivation password too
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ from electrum_gui.qt.main_window import StatusBarButton
|
|||||||
from electrum.i18n import _
|
from electrum.i18n import _
|
||||||
from electrum.plugins import hook
|
from electrum.plugins import hook
|
||||||
|
|
||||||
from trustedcoin import TrustedCoinPlugin, DISCLAIMER, server
|
from trustedcoin import TrustedCoinPlugin, server
|
||||||
|
|
||||||
def need_server(wallet, tx):
|
def need_server(wallet, tx):
|
||||||
from electrum.account import BIP32_Account
|
from electrum.account import BIP32_Account
|
||||||
@@ -109,11 +109,6 @@ class Plugin(TrustedCoinPlugin):
|
|||||||
return WaitingDialog(window, 'Getting billing information...', task,
|
return WaitingDialog(window, 'Getting billing information...', task,
|
||||||
on_finished)
|
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
|
@hook
|
||||||
def abort_send(self, window):
|
def abort_send(self, window):
|
||||||
wallet = window.wallet
|
wallet = window.wallet
|
||||||
|
|||||||
@@ -351,6 +351,12 @@ class TrustedCoinPlugin(BasePlugin):
|
|||||||
seed = wallet.make_seed()
|
seed = wallet.make_seed()
|
||||||
self.wizard.show_seed_dialog(run_next=wizard.confirm_seed, seed_text=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):
|
def create_wallet(self, wallet, wizard, seed, password):
|
||||||
wallet.storage.put('seed_version', wallet.seed_version)
|
wallet.storage.put('seed_version', wallet.seed_version)
|
||||||
wallet.storage.put('use_encryption', password is not None)
|
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')
|
_('If you are online, click on "%s" to continue.') % _('Next')
|
||||||
]
|
]
|
||||||
msg = '\n\n'.join(msg)
|
msg = '\n\n'.join(msg)
|
||||||
wizard.confirm(msg)
|
wizard.stack = []
|
||||||
wizard.run('create_remote_key')
|
wizard.confirm_dialog(msg, run_next = lambda x: wizard.run('create_remote_key'))
|
||||||
|
|
||||||
@hook
|
@hook
|
||||||
def do_clear(self, window):
|
def do_clear(self, window):
|
||||||
|
|||||||
Reference in New Issue
Block a user