Enter now submits the email address on the identity view.

See https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/1621304
This commit is contained in:
Michael Hudson-Doyle 2016-09-09 16:08:37 +12:00
parent bfbb876855
commit 96901f667e
1 changed files with 15 additions and 1 deletions

View File

@ -46,6 +46,20 @@ log = logging.getLogger("console_conf.views.identity")
+---------------------------------------------------+ +---------------------------------------------------+
''' '''
class SubmittingEmailEditor(EmailEditor):
def __init__(self, mainview):
self.mainview = mainview
super().__init__(caption="")
def keypress(self, size, key):
if key == 'enter':
self.mainview.done(None)
return None
else:
return super().keypress(size, key)
class IdentityView(BaseView): class IdentityView(BaseView):
def __init__(self, model, signal, opts, loop): def __init__(self, model, signal, opts, loop):
@ -54,7 +68,7 @@ class IdentityView(BaseView):
self.opts = opts self.opts = opts
self.loop = loop self.loop = loop
self.items = [] self.items = []
self.email = EmailEditor(caption="") self.email = SubmittingEmailEditor(self)
self.error = Text("", align="center") self.error = Text("", align="center")
self.progress = Text("", align="center") self.progress = Text("", align="center")