Browse Source

Merge pull request #5534 from zebra-lucky/kivy_installwizard_back_button

gui/kivy: fix installwizard back button behaviour
dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
ThomasV 6 years ago
committed by GitHub
parent
commit
3a35ab2574
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      electrum/gui/kivy/uix/dialogs/installwizard.py

18
electrum/gui/kivy/uix/dialogs/installwizard.py

@ -533,6 +533,7 @@ class WizardDialog(EventsDialog):
crcontent = ObjectProperty(None)
def __init__(self, wizard, **kwargs):
self.auto_dismiss = False
super(WizardDialog, self).__init__()
self.wizard = wizard
self.ids.back.disabled = not wizard.can_go_back()
@ -540,7 +541,8 @@ class WizardDialog(EventsDialog):
self.run_next = kwargs['run_next']
_trigger_size_dialog = Clock.create_trigger(self._size_dialog)
Window.bind(size=_trigger_size_dialog,
rotation=_trigger_size_dialog)
rotation=_trigger_size_dialog,
on_keyboard=self.on_keyboard)
_trigger_size_dialog()
self._on_release = False
@ -562,6 +564,20 @@ class WizardDialog(EventsDialog):
else:
self.crcontent.add_widget(widget, index=index)
def on_keyboard(self, instance, key, keycode, codepoint, modifier):
if key == 27:
if self.wizard.can_go_back():
self.wizard.go_back()
else:
app = App.get_running_app()
if not app.is_exit:
app.is_exit = True
app.show_info(_('Press again to exit'))
else:
self._on_release = False
self.dismiss()
return True
def on_dismiss(self):
app = App.get_running_app()
if app.wallet is None and not self._on_release:

Loading…
Cancel
Save