diff options
author | Erik Troan <ewt@redhat.com> | 1999-08-30 14:07:43 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 1999-08-30 14:07:43 +0000 |
commit | 6e903ffe0f0805cfaae4be434ae9b3a250d29e7f (patch) | |
tree | 450fa8bb637895539b47230e73b05e4f152c22a4 /iw/installpath.py | |
parent | 8e43c33791c32fbc2bb853f93a150a7c96b2be0a (diff) | |
download | anaconda-6e903ffe0f0805cfaae4be434ae9b3a250d29e7f.tar.gz anaconda-6e903ffe0f0805cfaae4be434ae9b3a250d29e7f.tar.xz anaconda-6e903ffe0f0805cfaae4be434ae9b3a250d29e7f.zip |
work with classed installs
Diffstat (limited to 'iw/installpath.py')
-rw-r--r-- | iw/installpath.py | 179 |
1 files changed, 96 insertions, 83 deletions
diff --git a/iw/installpath.py b/iw/installpath.py index dbfd8a716..3bcc50e71 100644 --- a/iw/installpath.py +++ b/iw/installpath.py @@ -1,121 +1,134 @@ from gtk import * from iw import * -#from autopartition import * - -# import only screens common to both upgrade and install here. - -from progress import InstallProgressWindow -from dependencies import UnresolvedDependenciesWindow -from congrats import CongratulationWindow - +from language import * +from welcome import * +from progress import * +from package import * +from network import * +from account import * +from rootpartition import * +from auth import * +from mouse import * +from keyboard import * +from format import * +from congrats import * +from autopartition import * +from dependencies import * +from lilo import * +from examine import * +from bootdisk import * +from timezone import * from gui import _ +import installclass UPGRADE = 0 INSTALL = 1 -CUSTOM = 0 -WORKSTATION_GNOME = 1 -WORKSTATION_KDE = 2 -SERVER = 3 +CUSTOM = 2 +WORKSTATION_GNOME = 3 +WORKSTATION_KDE = 4 +SERVER = 5 class InstallPathWindow (InstallWindow): + installTypes = ((CUSTOM, _("Custom")), (WORKSTATION_GNOME, _("GNOME Workstation")), (WORKSTATION_KDE, _("KDE Workstation")), (SERVER, _("Server"))) + installSteps = [ ( PartitionWindow, "partition" ), + ( FormatWindow, "format" ), + ( LiloWindow, "lilo" ), + ( NetworkWindow, "network" ), + ( TimezoneWindow, "timezone" ), + ( AccountWindow, "accounts" ), + ( AuthWindow, "authentication" ), + ( PackageSelectionWindow, "package-selection" ), + ( UnresolvedDependenciesWindow, "dependencies" ), + InstallProgressWindow, + ( BootdiskWindow, "bootdisk" ), + ( CongratulationWindow, "complete" ) + ] + + upgradeSteps = [ UpgradeExamineWindow, + UnresolvedDependenciesWindow, + InstallProgressWindow, + CongratulationWindow + ] + def __init__ (self, ics): - from language import LanguageWindow - from mouse import MouseWindow - from keyboard import KeyboardWindow - from welcome import WelcomeWindow - InstallWindow.__init__ (self, ics) - self.commonSteps = [ LanguageWindow, - KeyboardWindow, - MouseWindow, - WelcomeWindow, - InstallPathWindow + self.commonSteps = [ ( LanguageWindow, "language" ), + ( KeyboardWindow, "keyboard" ), + ( MouseWindow, "mouse" ), + ( WelcomeWindow, "welcome" ), + ( InstallPathWindow, "installtype" ), ] ics.setTitle (_("Install Type")) ics.setNextEnabled (1) + def getNext(self): + if self.upgradeButton.get_active(): + self.todo.upgrade = 1 + self.ics.getICW ().setStateList (self.commonSteps + + self.upgradeSteps, len (self.commonSteps)-1) + else: + self.ics.getICW ().setStateList (self.commonSteps + + self.installSteps, len (self.commonSteps)-1) + self.todo.upgrade = 0 + + for (button, type) in self.installClasses: + if button.get_active(): + break + + if type == WORKSTATION_GNOME: + self.todo.setClass(installclass.GNOMEWorkstation()) + elif type == WORKSTATION_KDE: + self.todo.setClass(installclass.KDEWorkstation()) + elif type == SERVER: + self.todo.setClass(installclass.Server()) + else: + self.todo.setClass(installclass.CustomInstall()) + def toggled (self, widget, type): if not widget.get_active (): return if type == INSTALL: - if not self.__dict__.has_key ("installSteps"): - print '1' -# from xconfig import XConfigWindow - print '2' - from package import PackageSelectionWindow - print '3' - from network import NetworkWindow - print '4' - from account import AccountWindow - print '5' - from rootpartition import PartitionWindow - print '6' - from auth import AuthWindow - print '7' - from format import FormatWindow - print '8' - from lilo import LiloWindow - print '9' - from bootdisk import BootdiskWindow - print '10' - from timezone import TimezoneWindow - print '11' - - self.installSteps = [ #XConfigWindow, - PartitionWindow, - FormatWindow, - LiloWindow, - NetworkWindow, - TimezoneWindow, - AccountWindow, - PackageSelectionWindow, - UnresolvedDependenciesWindow, - AuthWindow, - #XConfigWindow, - InstallProgressWindow, - BootdiskWindow, - CongratulationWindow - ] - - self.ics.getICW ().setStateList (self.commonSteps + - self.installSteps, len (self.commonSteps)-1) - self.todo.upgrade = 0 self.installBox.set_sensitive(1) - else: - # upgrade - if not self.__dict__.has_key ("upgradeSteps"): - from examine import UpgradeExamineWindow - - self.upgradeSteps = [ UpgradeExamineWindow, - UnresolvedDependenciesWindow, - InstallProgressWindow, - CongratulationWindow - ] - - self.ics.getICW ().setStateList (self.commonSteps + - self.upgradeSteps, len (self.commonSteps)-1) - self.todo.upgrade = 1 + elif type == UPGRADE: self.installBox.set_sensitive(0) def getScreen (self): box = GtkVBox (FALSE, 5) installButton = GtkRadioButton (None, _("Install")) installButton.connect ("toggled", self.toggled, INSTALL) - upgradeButton = GtkRadioButton (installButton, _("Upgrade")) - upgradeButton.connect ("toggled", self.toggled, UPGRADE) + self.upgradeButton = GtkRadioButton (installButton, _("Upgrade")) + self.upgradeButton.connect ("toggled", self.toggled, UPGRADE) + + if (self.todo.upgrade): + self.upgradeButton.set_active(1) + default = None + else: + instClass = self.todo.getClass() + default = CUSTOM + installButton.set_active(1) + if isinstance(instClass, installclass.GNOMEWorkstation): + default = WORKSTATION_GNOME + elif isinstance(instClass, installclass.KDEWorkstation): + default = WORKSTATION_KDE + elif isinstance(instClass, installclass.Server): + default = SERVER self.installBox = GtkVBox (FALSE) group = None - for i in range (len (self.installTypes)): - group = GtkRadioButton (group, self.installTypes[i][1]) + self.installClasses = [] + for (type, name) in self.installTypes: + group = GtkRadioButton (group, name) self.installBox.pack_start (group, FALSE) + self.installClasses.append((group, type)) + if (type == default): + group.set_active(1) spacer = GtkLabel("") spacer.set_usize(15, 1) @@ -124,7 +137,7 @@ class InstallPathWindow (InstallWindow): table.attach(installButton, 0, 2, 0, 1) table.attach(spacer, 0, 1, 1, 2, xoptions = FALSE) table.attach(self.installBox, 1, 2, 1, 2, xoptions = FILL | EXPAND) - table.attach(upgradeButton, 0, 2, 2, 3) + table.attach(self.upgradeButton, 0, 2, 2, 3) box.pack_start(table, FALSE) |