From 827d928aaa5ae30c028a021dfd6b71870eda9df5 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 28 Sep 2016 12:48:46 +0200 Subject: [PATCH] kivy: handle 2FA seeds --- gui/kivy/uix/dialogs/installwizard.py | 4 ++-- lib/base_wizard.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gui/kivy/uix/dialogs/installwizard.py b/gui/kivy/uix/dialogs/installwizard.py index 20fed582..2ae53e52 100644 --- a/gui/kivy/uix/dialogs/installwizard.py +++ b/gui/kivy/uix/dialogs/installwizard.py @@ -724,7 +724,7 @@ class InstallWizard(BaseWizard, Widget): try: task() except Exception as err: - Clock.schedule_once(lambda dt: app.show_error(str(err))) + self.show_error(str(err)) # on completion hide message Clock.schedule_once(lambda dt: app.info_bubble.hide(now=True), -1) @@ -770,7 +770,7 @@ class InstallWizard(BaseWizard, Widget): def show_xpub_dialog(self, **kwargs): ShowXpubDialog(self, **kwargs).open() def show_error(self, msg): - app.show_error(msg, duration=0.5) + Clock.schedule_once(lambda dt: app.show_error(msg)) def password_dialog(self, message, callback): popup = PasswordDialog() diff --git a/lib/base_wizard.py b/lib/base_wizard.py index aedb8e8a..60167f67 100644 --- a/lib/base_wizard.py +++ b/lib/base_wizard.py @@ -275,8 +275,12 @@ class BaseWizard(object): elif seed_type == 'old': self.run('create_keystore', seed, passphrase) elif seed_type == '2fa': - self.load_2fa() - self.run('on_restore_seed', seed) + if self.is_kivy: + self.show_error('2FA seeds are not supported in this version') + self.run('restore_from_seed') + else: + self.load_2fa() + self.run('on_restore_seed', seed) else: raise