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): def default(self):
self.ui.set_body(SSHView(self.model, self)) self.ui.set_body(SSHView(self.model, self))
#if self.answers: # if self.answers:
# self.done(self.answers) # self.done(self.answers)
def cancel(self): def cancel(self):
self.signal.emit_signal('prev-screen') self.signal.emit_signal('prev-screen')
def _fetch_cancel(self): def _fetch_cancel(self):
if self._fetching_proc is None: if self._fetching_proc is None:
return return

View File

@ -19,35 +19,20 @@ import re
from urwid import ( from urwid import (
connect_signal, 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 ( from subiquitycore.ui.interactive import (
PasswordEditor, PasswordEditor,
StringEditor, StringEditor,
) )
from subiquitycore.ui.stretchy import Stretchy
from subiquitycore.ui.form import ( from subiquitycore.ui.form import (
ChoiceField,
Form, Form,
simple_field, simple_field,
WantsToKnowFormField, WantsToKnowFormField,
) )
from subiquitycore.ui.utils import button_pile, screen from subiquitycore.ui.utils import screen
from subiquitycore.view import BaseView from subiquitycore.view import BaseView
from subiquity.ui.spinner import Spinner
log = logging.getLogger("subiquity.views.identity") log = logging.getLogger("subiquity.views.identity")
@ -148,9 +133,9 @@ class IdentityForm(Form):
class IdentityView(BaseView): class IdentityView(BaseView):
title = _("Profile setup") title = _("Profile setup")
excerpt = _("Enter the username and password you will use to log in to the " excerpt = _("Enter the username and password you will use to log in to "
"system. You can configure SSH access on the next screen but a " "the system. You can configure SSH access on the next screen "
"password is still needed for sudo.") "but a password is still needed for sudo.")
def __init__(self, model, controller): def __init__(self, model, controller):
self.model = model self.model = model

View File

@ -108,7 +108,8 @@ class SSHForm(Form):
def __init__(self, initial): def __init__(self, initial):
super().__init__(initial=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) self._toggle_server(None, self.install_server.value)
def _toggle_server(self, sender, new_value): def _toggle_server(self, sender, new_value):
@ -244,7 +245,11 @@ class SSHView(BaseView):
self.model = model self.model = model
self.controller = controller 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', connect_signal(self.form.ssh_import_id.widget, 'select',
self._select_ssh_import_id) self._select_ssh_import_id)