wizzard: ensure ensure `on_wizard_complete` is called

This commit is contained in:
qua-non 2014-02-22 10:25:26 +05:30 committed by ThomasV
parent 23fe2062a1
commit f33fbefce0
3 changed files with 8 additions and 6 deletions

View File

@ -495,17 +495,19 @@ class RestoreSeedDialog(CreateAccountDialog):
tis._keyboard.bind(on_key_down=self.on_key_down) tis._keyboard.bind(on_key_down=self.on_key_down)
stepper = self.ids.stepper stepper = self.ids.stepper
stepper.opacity = 1 stepper.opacity = 1
stepper.source = 'atlas://gui/kivy/theming/light/stepper_restore_seed' stepper.source = ('atlas://gui/kivy/theming"
"/light/stepper_restore_seed')
self._back = _back = partial(self.ids.back.dispatch, 'on_release') self._back = _back = partial(self.ids.back.dispatch, 'on_release')
app.navigation_higherarchy.append(_back) app.navigation_higherarchy.append(_back)
def on_key_down(self, keyboard, keycode, key, modifiers): def on_key_down(self, keyboard, keycode, key, modifiers):
if keycode[1] == 'enter': if keycode[1] == 'enter':
self.on_enter() self.on_enter()
return True
#super #super
def on_enter(self): def on_enter(self):
self._remove_keyboard() #self._remove_keyboard()
# press next # press next
self.ids.next.dispatch('on_release') self.ids.next.dispatch('on_release')

View File

@ -295,7 +295,7 @@ class InstallWizard(Widget):
wallet.start_threads(self.network) wallet.start_threads(self.network)
if not mode == 'restore': if not mode == 'restore':
return return self.dispatch('on_wizard_complete', wallet)
def get_text(text): def get_text(text):
def set_text(*l): app.info_bubble.ids.lbl.text=text def set_text(*l): app.info_bubble.ids.lbl.text=text
@ -311,7 +311,7 @@ class InstallWizard(Widget):
app.show_info(_("Recovery successful")) app.show_info(_("Recovery successful"))
else: else:
app.show_info(_("No transactions found for this seed")) app.show_info(_("No transactions found for this seed"))
self.dispatch('on_wizard_complete', wallet) return self.dispatch('on_wizard_complete', wallet)
self.waiting_dialog(lambda: wallet.restore(get_text), self.waiting_dialog(lambda: wallet.restore(get_text),
on_complete=on_complete) on_complete=on_complete)

View File

@ -158,8 +158,8 @@ class ElectrumWindow(App):
def on_wizard_complete(self, instance, wallet): def on_wizard_complete(self, instance, wallet):
if not wallet: if not wallet:
Logger.debug('Electrum: No Wallet set/found. Exiting...') Logger.debug('Electrum: No Wallet set/found. Exiting...')
self.stop() app.show_error('Electrum: No Wallet set/found. Exiting...',
sys.exit() exit=True)
return return
# plugins that need to change the GUI do it here # plugins that need to change the GUI do it here