2
# This file is part of Checkbox.
4
# Copyright 2008 Canonical Ltd.
6
# Checkbox is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
11
# Checkbox is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
19
from gettext import gettext as _
21
from checkbox.plugin import Plugin
22
from checkbox.properties import String
23
from checkbox.user_interface import PREV
26
class IntroPrompt(Plugin):
28
welcome_text = String(default=_("""\
29
Welcome to System Testing!
31
Checkbox provides tests to confirm that your system is working \
32
properly. Once you are finished running the tests, you can view \
33
a summary report for your system.""") + _("""
35
Warning: Some tests could cause your system to freeze \
36
or become unresponsive. Please save all your work \
37
and close all other running applications before \
38
beginning the testing process."""))
40
def register(self, manager):
41
super(IntroPrompt, self).register(manager)
45
self._manager.reactor.call_on("begin-recover", self.begin_recover)
47
# Introduction should be prompted last
48
self._manager.reactor.call_on("prompt-begin", self.prompt_begin, 100)
50
def begin_recover(self, recover):
51
self._recover = recover
53
def prompt_begin(self, interface):
54
if interface.direction == PREV or not self._recover:
56
interface.show_text(self.welcome_text, previous="")