summaryrefslogtreecommitdiffstats
path: root/textw/confirm_text.py
blob: 4701b1588be54b03aa0ab8d988678e79d049c51f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#
# confirm_text.py: text mode install/upgrade confirmation window
#
# Copyright 2001-2003 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
# library public license.
#
# You should have received a copy of the GNU Library Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
import sys

from snack import *
from constants_text import *
from rhpl.translate import _
from image import presentRequiredMediaMessage

class BeginInstallWindow:
    def __call__ (self, screen, intf, id):
        rc = ButtonChoiceWindow (screen, _("Installation to begin"),
                                _("A complete log of your installation will be in "
                                  "%s after rebooting your system. You "
                                  "may want to keep this file for later reference.") %("/root/install.log",),
                                buttons = [ _("OK"), _("Back") ],
				help = "begininstall")
        if rc == string.lower (_("Back")):
            return INSTALL_BACK

	if id.methodstr.startswith("cdrom://") and (id.instClass.name and id.instClass.name != "kickstart"):
	    rc = presentRequiredMediaMessage(intf, id.grpset)

	    if rc == 0:
		rc2 = intf.messageWindow(_("Reboot?"),
					_("The system will be rebooted now."),
					type="custom", custom_icon="warning",
					custom_buttons=[_("_Back"), _("_Reboot")])
		if rc2 == 1:
		    sys.exit(0)
		else:
		    return INSTALL_BACK
	
        return INSTALL_OK

class BeginUpgradeWindow:
    def __call__ (self, screen, intf, id) :
        rc = ButtonChoiceWindow (screen, _("Upgrade to begin"),
                                _("A complete log of your upgrade will be in "
                                  "%s after rebooting your system. You "
                                  "may want to keep this file for later reference." %("/root/upgrade.log",)),
                                buttons = [ _("OK"), _("Back") ],
				help = "beginupgrade")
        if rc == string.lower (_("Back")):
            return INSTALL_BACK

	if id.methodstr.startswith("cdrom://") and (id.instClass.name and id.instClass.name != "kickstart"):
	    rc = presentRequiredMediaMessage(intf, id.grpset)

	    if rc == 0:
		rc2 = intf.messageWindow(_("Reboot?"),
					_("The system will be rebooted now."),
					type="custom", custom_icon="warning",
					custom_buttons=[_("_Back"), _("_Reboot")])
		if rc2 == 1:
		    sys.exit(0)
		else:
		    return INSTALL_BACK

        return INSTALL_OK