diff --git a/subiquity/controllers/ssh.py b/subiquity/controllers/ssh.py index 19b43588..9deb5573 100644 --- a/subiquity/controllers/ssh.py +++ b/subiquity/controllers/ssh.py @@ -38,11 +38,12 @@ class SSHController(BaseController): def default(self): self.ui.set_body(SSHView(self.model, self)) - #if self.answers: - # self.done(self.answers) + # if self.answers: + # self.done(self.answers) def cancel(self): self.signal.emit_signal('prev-screen') + def _fetch_cancel(self): if self._fetching_proc is None: return diff --git a/subiquity/ui/views/identity.py b/subiquity/ui/views/identity.py index 17ec47d4..5985a78a 100644 --- a/subiquity/ui/views/identity.py +++ b/subiquity/ui/views/identity.py @@ -19,35 +19,20 @@ import re from urwid import ( connect_signal, - LineBox, - Pile, - Text, ) -from subiquitycore.ui.buttons import ( - cancel_btn, - ok_btn, - other_btn, - ) -from subiquitycore.ui.container import ( - ListBox, - WidgetWrap, - ) from subiquitycore.ui.interactive import ( PasswordEditor, StringEditor, ) -from subiquitycore.ui.stretchy import Stretchy from subiquitycore.ui.form import ( - ChoiceField, Form, simple_field, WantsToKnowFormField, ) -from subiquitycore.ui.utils import button_pile, screen +from subiquitycore.ui.utils import screen from subiquitycore.view import BaseView -from subiquity.ui.spinner import Spinner log = logging.getLogger("subiquity.views.identity") @@ -148,9 +133,9 @@ class IdentityForm(Form): class IdentityView(BaseView): title = _("Profile setup") - excerpt = _("Enter the username and password you will use to log in to the " - "system. You can configure SSH access on the next screen but a " - "password is still needed for sudo.") + excerpt = _("Enter the username and password you will use to log in to " + "the system. You can configure SSH access on the next screen " + "but a password is still needed for sudo.") def __init__(self, model, controller): self.model = model diff --git a/subiquity/ui/views/ssh.py b/subiquity/ui/views/ssh.py index ee0de892..5e40a408 100644 --- a/subiquity/ui/views/ssh.py +++ b/subiquity/ui/views/ssh.py @@ -108,7 +108,8 @@ class SSHForm(Form): def __init__(self, initial): super().__init__(initial=initial) - connect_signal(self.install_server.widget, 'change', self._toggle_server) + connect_signal( + self.install_server.widget, 'change', self._toggle_server) self._toggle_server(None, self.install_server.value) def _toggle_server(self, sender, new_value): @@ -244,7 +245,11 @@ class SSHView(BaseView): self.model = model self.controller = controller - self.form = SSHForm(initial={"install": self.model.install_server, "pwauth": self.model.pwauth}) + self.form = SSHForm(initial={ + "install": self.model.install_server, + "pwauth": self.model.pwauth, + "import_username": self.model.ssh_import_id, + }) connect_signal(self.form.ssh_import_id.widget, 'select', self._select_ssh_import_id)