diff options
author | Mike Fulbright <msf@redhat.com> | 2002-11-12 20:21:47 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2002-11-12 20:21:47 +0000 |
commit | f4b0bc2a437d7198fa41acf1f9d15dd97720270f (patch) | |
tree | 17c06d4cd507f83a095566b4d2872e70291de1a8 /installclass.py | |
parent | 5c586794842e5c04d5ae60355d996c823028cc86 (diff) | |
download | anaconda-f4b0bc2a437d7198fa41acf1f9d15dd97720270f.tar.gz anaconda-f4b0bc2a437d7198fa41acf1f9d15dd97720270f.tar.xz anaconda-f4b0bc2a437d7198fa41acf1f9d15dd97720270f.zip |
fixed to use new xsetup backend
Diffstat (limited to 'installclass.py')
-rw-r--r-- | installclass.py | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/installclass.py b/installclass.py index 0f69f8d6f..d1890192c 100644 --- a/installclass.py +++ b/installclass.py @@ -17,7 +17,7 @@ import os, iutil import string import language -from xf86config import XF86Config + from instdata import InstallData from partitioning import * @@ -335,7 +335,8 @@ class BaseInstallClass: def configureX(self, id, server = None, card = None, videoRam = None, monitorName = None, hsync = None, vsync = None, resolution = None, depth = None, noProbe = 0, startX = 0): import rhpl.videocard as videocard import rhpl.monitor as monitor - + import rhpl.xhwstate as xhwstate + import xsetup # XXX they could have sensitive hardware, but we need this info =\ videohw = videocard.VideoCardInfo() @@ -408,36 +409,44 @@ class BaseInstallClass: else: id.desktop.setDefaultRunLevel(3) - xcfg = XF86Config(id.videocard.primaryCard(), id.monitor, id.mouse, - id.keyboard) -## xkb = id.keyboard.getXKB() -## if xkb: -## apply(xcfg.setKeyboard, xkb) - + xcfg = xhwstate.XF86HardwareState(defcard=id.videocard, defmon=id.monitor) + availableDepths = xcfg.available_color_depths() - available = xcfg.availableModes() - if resolution and depth: - if depth not in id.videocard.possible_depths(): + if depth not in availableDepths: raise RuntimeError, "Invalid depth specified" # XXX should we fallback to our "best possible" here? - if resolution not in available[depth]: - raise RuntimeError, "Selected resolution and bitdepth not possible with video ram detected. Perhaps you need to specify video ram" + + xcfg.set_colordepth(depth) + availableRes = xcfg.available_resolutions() + + if resolution not in availableRes: + fbres = availableRes[-1] + log(_("Resolution requested %s is not supported."),resolution) + log(_("Falling back to %s."), fbres) + log(_("To avoid this you may need to specify the videocard and ")) + log(_("monitor specs on the xconfig ks directive if they were ")) + log(_("not probed correctly.")) + resolution = fbres else: - if len(available) == 1: - depth = "8" - elif len(available) >= 2: - depth = "16" + if len(availableDepths) == 1: + depth = 8 + elif len(availableDepths) >= 2: + depth = 16 + + xcfg.set_colordepth(depth) + availableRes = xcfg.available_resolutions() - if "1024x768" in available[depth]: + if "1024x768" in availableRes: resolution = "1024x768" - elif "800x600" in available[depth]: + elif "800x600" in availableRes: resolution = "800x600" else: resolution = "640x480" - xcfg.setManualModes( { depth: [ resolution ] } ) - id.setXconfig(xcfg) + xcfg.set_resolution(resolution) + xsetup = xsetup.XSetup(xcfg) + id.setXSetup(xsetup) def setMouse(self, id, mouseType, device = None, emulThree = -1): |