This commit is contained in:
Michael Hudson-Doyle 2018-12-10 14:07:04 +13:00
parent 67299c6181
commit 046fbb5e3e
3 changed files with 14 additions and 23 deletions

View File

@ -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

View File

@ -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

View File

@ -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)