diff options
-rw-r--r-- | installclass.py | 1 | ||||
-rw-r--r-- | installclasses/custom.py | 1 | ||||
-rw-r--r-- | installclasses/personal_desktop.py | 1 | ||||
-rw-r--r-- | installclasses/server.py | 1 | ||||
-rw-r--r-- | installclasses/workstation.py | 1 | ||||
-rw-r--r-- | iw/xconfig_gui.py | 51 | ||||
-rw-r--r-- | textw/xconfig_text.py | 40 |
7 files changed, 56 insertions, 40 deletions
diff --git a/installclass.py b/installclass.py index 709c2d11c..28291fba2 100644 --- a/installclass.py +++ b/installclass.py @@ -31,6 +31,7 @@ class BaseInstallClass: hidden = 0 pixmap = None showMinimal = 0 + showLoginChoice = 0 description = None # don't select this class by default diff --git a/installclasses/custom.py b/installclasses/custom.py index 440124c49..d338c9e8c 100644 --- a/installclasses/custom.py +++ b/installclasses/custom.py @@ -10,6 +10,7 @@ class InstallClass(BaseInstallClass): name = N_("Custom") pixmap = "custom.png" showMinimal = 1 + showLoginChoice = 1 description = N_("Select this installation type to gain complete " "control over the installation process, including " "software package selection and authentication " diff --git a/installclasses/personal_desktop.py b/installclasses/personal_desktop.py index 0ab07eba5..cd07a3818 100644 --- a/installclasses/personal_desktop.py +++ b/installclasses/personal_desktop.py @@ -7,6 +7,7 @@ from autopart import getAutopartitionBoot, autoCreatePartitionRequests from fsset import * class InstallClass(BaseInstallClass): + showLoginChoice = 0 name = N_("Personal Desktop") pixmap = "workstation.png" description = N_("Perfect for personal computers or laptops, select this " diff --git a/installclasses/server.py b/installclasses/server.py index 20c30fbb2..2367acbfa 100644 --- a/installclasses/server.py +++ b/installclasses/server.py @@ -7,6 +7,7 @@ from autopart import getAutopartitionBoot, autoCreatePartitionRequests class InstallClass(BaseInstallClass): + showLoginChoice = 1 name = N_("Server") pixmap = "server.png" description = N_("Select this installation type if you would like to " diff --git a/installclasses/workstation.py b/installclasses/workstation.py index abd93c765..f3d86c4dc 100644 --- a/installclasses/workstation.py +++ b/installclasses/workstation.py @@ -3,6 +3,7 @@ from rhpl.translate import N_ import os class InstallClass(personal_desktop.InstallClass): + showLoginChoice = 0 name = N_("Workstation") pixmap = "workstation.png" description = N_("This option installs a graphical desktop " diff --git a/iw/xconfig_gui.py b/iw/xconfig_gui.py index 016940c4e..2aa37ea06 100644 --- a/iw/xconfig_gui.py +++ b/iw/xconfig_gui.py @@ -69,10 +69,14 @@ class XCustomWindow (InstallWindow): if ENABLE_DESKTOP_CHOICE: self.desktop.setDefaultDesktop (self.newDesktop) - if self.text.get_active (): - rl = 3 - elif self.graphical.get_active (): - rl = 5 + if self.instClass.showLoginChoice: + if self.text.get_active (): + rl = 3 + elif self.graphical.get_active (): + rl = 5 + else: + # default to 5 if we didnt give them a choice + rl = 5 self.desktop.setDefaultRunLevel(rl) @@ -189,12 +193,13 @@ class XCustomWindow (InstallWindow): # XCustomWindow tag="xcustom" def getScreen (self, xsetup, monitor, videocard, desktop, comps, - instPath): + instClass, instPath): self.xsetup = xsetup self.monitor = monitor self.videocard = videocard self.desktop = desktop + self.instClass = instClass if not xsetup.imposed_sane_default: xsetup.xhwstate.choose_sane_default() @@ -350,27 +355,29 @@ class XCustomWindow (InstallWindow): hsep = gtk.HSeparator () self.box.pack_start (hsep) - frame4 = gtk.Frame (_("Please choose your login type:")) - frame4.set_shadow_type (gtk.SHADOW_NONE) - hbox4.pack_start (frame4, gtk.TRUE, gtk.FALSE, 2) - - self.hbox5 = gtk.HBox (gtk.TRUE, 2) - frame4.add (self.hbox5) + # see if we should allow them to choose graphical or text login + if self.instClass.showLoginChoice: + frame4 = gtk.Frame (_("Please choose your login type:")) + frame4.set_shadow_type (gtk.SHADOW_NONE) + hbox4.pack_start (frame4, gtk.TRUE, gtk.FALSE, 2) - self.text = gtk.RadioButton (None, (_("T_ext"))) - self.graphical = gtk.RadioButton (self.text, (_("_Graphical"))) + self.hbox5 = gtk.HBox (gtk.TRUE, 2) + frame4.add (self.hbox5) - self.runLevel = self.desktop.getDefaultRunLevel() + self.text = gtk.RadioButton (None, (_("T_ext"))) + self.graphical = gtk.RadioButton (self.text, (_("_Graphical"))) - if self.runLevel == 3: - self.text.set_active (gtk.TRUE) - elif self.runLevel == 5: - self.graphical.set_active (gtk.TRUE) + self.runLevel = self.desktop.getDefaultRunLevel() - self.hbox5.pack_start (self.graphical, gtk.FALSE, 2) - self.hbox5.pack_start (self.text, gtk.FALSE, 2) - - self.box.pack_start (hbox4, gtk.FALSE, gtk.TRUE, 2) + if self.runLevel == 3: + self.text.set_active (gtk.TRUE) + elif self.runLevel == 5: + self.graphical.set_active (gtk.TRUE) + + self.hbox5.pack_start (self.graphical, gtk.FALSE, 2) + self.hbox5.pack_start (self.text, gtk.FALSE, 2) + + self.box.pack_start (hbox4, gtk.FALSE, gtk.TRUE, 2) return self.box diff --git a/textw/xconfig_text.py b/textw/xconfig_text.py index 184398dea..66e198835 100644 --- a/textw/xconfig_text.py +++ b/textw/xconfig_text.py @@ -87,7 +87,7 @@ class XCustomWindow: def __call__(self, screen, xsetup, monitor, videocard, desktop, comps, - instPath): + instClass, instPath): self.instPath = instPath self.xsetup = xsetup @@ -173,25 +173,31 @@ class XCustomWindow: else: desktopgrid = None - runlevelgrid = Grid(3,2) - label = Label(_("Default Login:")) - runlevelgrid.setField(label, 0, 1, (0, 0, 0, 1), anchorLeft = 1) - self.graphrb = SingleRadioButton(_("Graphical"), None, - (self.selectedRunLevel == 5)) - self.textrb = SingleRadioButton(_("Text"), self.graphrb, - (self.selectedRunLevel == 3)) - self.graphrb.setCallback(self.loginCB, self.graphrb) - self.textrb.setCallback(self.loginCB, self.textrb) - runlevelgrid.setField(self.graphrb, 1, 1, (0, 0, 0, 1), - anchorLeft = 1) - runlevelgrid.setField(self.textrb, 2, 1, (0, 0, 0, 1), - anchorLeft = 1) - + if instClass.showLoginChoice: + runlevelgrid = Grid(3,2) + label = Label(_("Default Login:")) + runlevelgrid.setField(label, 0, 1, (0, 0, 0, 1), anchorLeft = 1) + self.graphrb = SingleRadioButton(_("Graphical"), None, + (self.selectedRunLevel == 5)) + self.textrb = SingleRadioButton(_("Text"), self.graphrb, + (self.selectedRunLevel == 3)) + self.graphrb.setCallback(self.loginCB, self.graphrb) + self.textrb.setCallback(self.loginCB, self.textrb) + runlevelgrid.setField(self.graphrb, 1, 1, (0, 0, 0, 1), + anchorLeft = 1) + runlevelgrid.setField(self.textrb, 2, 1, (0, 0, 0, 1), + anchorLeft = 1) + else: + # if no choice to be given, assume run level of 5 + runlevelgrid = None + self.selectRunLevel = 5 + toplevel.add(TextboxReflowed(55, text), 0, 0, (0, 0, 0, 1)) toplevel.add(customgrid, 0, 1, (0, 0, 0, 0), growx = 1) if desktopgrid: toplevel.add(desktopgrid, 0, 2, (0, 0, 0, 0), growx = 1) - toplevel.add(runlevelgrid, 0, 3, (0, 0, 0, 0), growx = 1) + if runlevelgrid: + toplevel.add(runlevelgrid, 0, 3, (0, 0, 0, 0), growx = 1) toplevel.add(bb, 0, 4, (0, 0, 0, 0), growx = 1) result = toplevel.run () @@ -203,8 +209,6 @@ class XCustomWindow: elif rc == TEXT_OK_CHECK or result == TEXT_F12_CHECK: screen.popWindow() break -# elif rc == "test": -# self.testCB(screen) elif result == depthchangebutton: self.depthchangeCB(screen) elif result == reschangebutton: |