summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2003-09-12 21:20:41 +0000
committerMike Fulbright <msf@redhat.com>2003-09-12 21:20:41 +0000
commit114ca03be7dab9ce579531a318be02ea7562fb84 (patch)
tree4bbc019a347c37bffb43ad7f4f86c802b4acb405
parent3670d962a6f7da0f8b9d6f5cb22e7c2a001a48c5 (diff)
downloadanaconda-114ca03be7dab9ce579531a318be02ea7562fb84.tar.gz
anaconda-114ca03be7dab9ce579531a318be02ea7562fb84.tar.xz
anaconda-114ca03be7dab9ce579531a318be02ea7562fb84.zip
add notification right before install/upgrade starts on how many CDs will be required so user can abort if they didnt burn them all
-rw-r--r--dispatch.py4
-rw-r--r--image.py39
-rw-r--r--iw/confirm_gui.py41
-rw-r--r--textw/confirm_text.py33
4 files changed, 110 insertions, 7 deletions
diff --git a/dispatch.py b/dispatch.py
index 9ce6c5db3..3ca15405d 100644
--- a/dispatch.py
+++ b/dispatch.py
@@ -116,8 +116,8 @@ installSteps = [
("checkdeps", checkDependencies, ("dir", "intf", "dispatch",
"id", "instPath")),
("dependencies", ("id.grpset", "id.dependencies")),
- ("confirminstall", ()),
- ("confirmupgrade", ()),
+ ("confirminstall", ("intf", "id",)),
+ ("confirmupgrade", ("intf", "id",)),
("install", ("dir", "intf", "id")),
("enablefilesystems", turnOnFilesystems, ("dir", "id.fsset",
"id.diskset", "id.partitions",
diff --git a/image.py b/image.py
index af45a20ca..22c95c19a 100644
--- a/image.py
+++ b/image.py
@@ -22,6 +22,8 @@ import stat
import kudzu
import string
import shutil
+import product
+
from constants import *
from rhpl.log import log
@@ -34,6 +36,43 @@ if os.uname()[4] == "s390x":
else:
_arch = iutil.getArch()
+# given groupset containing information about selected packages, use
+# the disc number info in the headers to come up with message describing
+# the required CDs
+#
+# dialog returns a value of 0 if user selected to abort install
+def presentRequiredMediaMessage(intf, grpset):
+ reqcds = []
+ for hdr in grpset.hdrlist.values():
+ if not hdr.isSelected():
+ continue
+ elif hdr[1000002] not in reqcds:
+ reqcds.append(hdr[1000002])
+ else:
+ continue
+
+ # if only one CD required no need to pop up a message
+ if len(reqcds) < 2:
+ return
+
+ reqcds.sort()
+ reqcdstr = ""
+ for cdnum in reqcds:
+ reqcdstr += "\t\t%s %s CD #%d\n" % (product.productName, product.productVersion, cdnum,)
+
+ return intf.messageWindow( _("Required Install Media"),
+ _("The software you have selected to "
+ "install will require the following CDs:\n\n"
+ "%s\nPlease "
+ "have these ready before proceeding with "
+ "the installation. If you need to abort "
+ "the installation and reboot please "
+ "select \"Reboot\".") % (reqcdstr,),
+ type="custom", custom_icon="warning",
+ custom_buttons=[_("_Reboot"), _("_Continue")])
+
+
+
class ImageInstallMethod(InstallMethod):
def readCompsViaMethod(self, hdlist):
diff --git a/iw/confirm_gui.py b/iw/confirm_gui.py
index bddeddeb3..e5beb32a5 100644
--- a/iw/confirm_gui.py
+++ b/iw/confirm_gui.py
@@ -1,7 +1,7 @@
#
# confirm_gui.py: install/upgrade point of no return screen.
#
-# Copyright 2000-2002 Red Hat, Inc.
+# Copyright 2000-2003 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
# library public license.
@@ -16,7 +16,9 @@ from iw_gui import *
from rhpl.translate import _, N_
from constants import *
from package_gui import queryUpgradeContinue
+from image import presentRequiredMediaMessage
import gui
+import sys
class ConfirmWindow (InstallWindow):
@@ -55,7 +57,24 @@ class InstallConfirmWindow (ConfirmWindow):
windowTitle = N_("About to Install")
htmlTag = "aboutinstall"
- def getScreen(self):
+ def getNext(self):
+ if self.id.methodstr.startswith("cdrom://") and (self.id.instClass.name and self.id.instClass.name != "kickstart"):
+ rc = presentRequiredMediaMessage(self.intf, self.id.grpset)
+
+ if rc == 0:
+ rc2 = self.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:
+ raise gui.StayOnScreen
+
+ def getScreen(self, intf, id):
+ self.intf = intf
+ self.id = id
+
return ConfirmWindow.getScreen(self,
_("Click next to begin installation of %s.") % (productName,),
_("A complete log of the installation can be found in "
@@ -68,7 +87,23 @@ class UpgradeConfirmWindow (ConfirmWindow):
windowTitle = N_("About to Upgrade")
htmlTag = "aboutupgrade"
- def getScreen(self):
+ def getNext(self):
+ if self.id.methodstr.startswith("cdrom://") and (self.id.instClass.name and self.id.instClass.name != "kickstart"):
+ rc = presentRequiredMediaMessage(self.intf, self.id.grpset)
+
+ if rc == 0:
+ rc2 = self.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:
+ raise gui.StayOnScreen
+
+ def getScreen(self, intf, id):
+ self.intf = intf
+ self.id = id
return ConfirmWindow.getScreen(self,
_("Click next to begin upgrade of %s.") % (productName,),
_("A complete log of the upgrade can be found in "
diff --git a/textw/confirm_text.py b/textw/confirm_text.py
index 6e667abf8..3877e3d4c 100644
--- a/textw/confirm_text.py
+++ b/textw/confirm_text.py
@@ -1,7 +1,7 @@
#
# confirm_text.py: text mode install/upgrade confirmation window
#
-# Copyright 2001-2002 Red Hat, Inc.
+# Copyright 2001-2003 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
# library public license.
@@ -14,9 +14,10 @@
from snack import *
from constants_text import *
from rhpl.translate import _
+from image import presentRequiredMediaMessage
class BeginInstallWindow:
- def __call__ (self, screen):
+ 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 "
@@ -25,6 +26,20 @@ class BeginInstallWindow:
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:
@@ -37,4 +52,18 @@ class BeginUpgradeWindow:
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