2016-06-30 18:18:54 +00:00
|
|
|
# Copyright 2015 Canonical, Ltd.
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Affero General Public License as
|
|
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
|
|
# License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Affero General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
""" Welcome
|
|
|
|
|
|
|
|
Welcome provides user with language selection
|
|
|
|
|
|
|
|
"""
|
|
|
|
import logging
|
2017-01-13 03:10:40 +00:00
|
|
|
from subiquitycore.ui.buttons import ok_btn
|
2017-02-03 01:20:05 +00:00
|
|
|
from subiquitycore.ui.container import ListBox, Pile
|
2017-09-15 20:47:12 +00:00
|
|
|
from subiquitycore.ui.utils import Padding
|
2017-01-13 03:10:40 +00:00
|
|
|
from subiquitycore.view import BaseView
|
2016-06-30 18:18:54 +00:00
|
|
|
|
|
|
|
log = logging.getLogger("console_conf.views.welcome")
|
|
|
|
|
|
|
|
|
2017-01-13 03:10:40 +00:00
|
|
|
class WelcomeView(BaseView):
|
2017-01-13 03:11:42 +00:00
|
|
|
def __init__(self, controller):
|
2017-01-13 03:10:40 +00:00
|
|
|
self.controller = controller
|
|
|
|
self.body = [
|
|
|
|
Padding.fixed_10(self._build_buttons())
|
|
|
|
]
|
|
|
|
super().__init__(ListBox(self.body))
|
|
|
|
|
2016-06-30 18:35:19 +00:00
|
|
|
def _build_buttons(self):
|
|
|
|
self.buttons = [
|
2018-03-08 03:39:03 +00:00
|
|
|
ok_btn("OK", on_press=self.confirm),
|
2016-06-30 18:35:19 +00:00
|
|
|
]
|
|
|
|
return Pile(self.buttons)
|
2017-01-13 03:10:40 +00:00
|
|
|
|
|
|
|
def confirm(self, result):
|
|
|
|
self.controller.done()
|