diff --git a/gui/kivy/dialog.py b/gui/kivy/dialog.py index 66c42cca..502c6a92 100644 --- a/gui/kivy/dialog.py +++ b/gui/kivy/dialog.py @@ -192,7 +192,7 @@ class InfoBubble(Bubble): anim.start(self) - def hide(self, *dt): + def hide(self, now=False): ''' Auto fade out the Bubble ''' def on_stop(*l): @@ -205,6 +205,8 @@ class InfoBubble(Bubble): App.get_running_app().stop() import sys sys.exit() + if now: + return on_stop() anim = Animation(opacity=0, d=.25) anim.bind(on_complete=on_stop) diff --git a/gui/kivy/drawer.py b/gui/kivy/drawer.py index b52062d1..bcf580d0 100644 --- a/gui/kivy/drawer.py +++ b/gui/kivy/drawer.py @@ -82,11 +82,13 @@ class Drawer(StencilView): if app.ui_mode[0] == 't': return super(Drawer, self).on_touch_down(touch) + state = self.state touch.ud['send_touch_down'] = False + start = 0 if state[0] == 'c' else self._hidden_widget.right drag_area = ((self.width * self.drag_area) if self.state[0] == 'c' else - self._hidden_widget.width) - if touch.x > drag_area: + self.width) + if touch.x not in range(int(start), int(drag_area)): return super(Drawer, self).on_touch_down(touch) self._touch = touch Clock.schedule_once(self._change_touch_mode, @@ -106,8 +108,13 @@ class Drawer(StencilView): if not touch.ud.get('in_drag_area', None): return super(Drawer, self).on_touch_move(touch) - self._overlay_widget.x = min(self._hidden_widget.width, - max(self._overlay_widget.x + touch.dx*2, 0)) + ov = self._overlay_widget + ov.x=min(self._hidden_widget.width, + max(ov.x + touch.dx*2, 0)) + #_anim = Animation(x=x, duration=1/60) + #_anim.cancel_all(ov) + #_anim.start(ov) + if abs(touch.x - touch.ox) < self.scroll_distance: return touch.ud['send_touch_down'] = False diff --git a/gui/kivy/installwizard.py b/gui/kivy/installwizard.py index e0fb6c9a..41809a8e 100644 --- a/gui/kivy/installwizard.py +++ b/gui/kivy/installwizard.py @@ -45,10 +45,16 @@ class InstallWizard(Widget): ''' def target(): + # run your threaded function - task() + try: + task() + except Exception as err: + Clock.schedule_once(lambda dt: app.show_error(str(err))) + # on completion hide message - Clock.schedule_once(lambda dt: app.info_bubble.hide()) + Clock.schedule_once(lambda dt: app.info_bubble.hide(now=True), -1) + # call completion routine if on_complete: Clock.schedule_once(lambda dt: on_complete()) @@ -138,14 +144,14 @@ class InstallWizard(Widget): brainwallet = seed - msg2 = _("[color=#414141][b]"+\ + msg2 = _("[color=#414141]"+\ "[b]PLEASE WRITE DOWN YOUR SEED PASS[/b][/color]"+\ "[size=9]\n\n[/size]" +\ "[color=#929292]If you ever forget your pincode, your seed" +\ " phrase will be the [color=#EB984E]"+\ "[b]only way to recover[/b][/color] your wallet. Your " +\ " [color=#EB984E][b]Bitcoins[/b][/color] will otherwise be" +\ - " [color=#EB984E]lost forever![/color]") + " [color=#EB984E][b]lost forever![/b][/color]") if wallet.imported_keys: msg2 += "[b][color=#ff0000ff]" + _("WARNING") + "[/color]:[/b] " +\ @@ -234,13 +240,13 @@ class InstallWizard(Widget): return app.show_error(_('Passwords do not match'), duration=.5) if mode == 'restore': - try: - wallet.save_seed(new_password) - except Exception as err: - app.show_error(str(err)) - return - _dlg.close() - self.load_network(wallet, mode='restore') + def on_complete(*l): + _dlg.close() + self.load_network(wallet, mode='restore') + + self.waiting_dialog(lambda: wallet.save_seed(new_password), + msg=_("saving seed"), + on_complete=on_complete) return if not instance: # create diff --git a/gui/kivy/main.kv b/gui/kivy/main.kv index f559d065..35bd64af 100644 --- a/gui/kivy/main.kv +++ b/gui/kivy/main.kv @@ -2,6 +2,7 @@ #:import _ electrum.i18n._ #:import partial functools.partial + # Custom Global Widgets : @@ -27,7 +28,7 @@