summaryrefslogtreecommitdiffstats
path: root/xf86config.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-05-29 00:24:53 +0000
committerJeremy Katz <katzj@redhat.com>2002-05-29 00:24:53 +0000
commit75c835e6750a63ce59f8422ca948b9b8051cd064 (patch)
tree36e79104c55e20e376b649e6aeda4c39d87c8958 /xf86config.py
parente20588a97889f462c0ceefdf05bca001ac017b3e (diff)
downloadanaconda-75c835e6750a63ce59f8422ca948b9b8051cd064.tar.gz
anaconda-75c835e6750a63ce59f8422ca948b9b8051cd064.tar.xz
anaconda-75c835e6750a63ce59f8422ca948b9b8051cd064.zip
more keyboard related changes. the xconfig object now has a keyboard object
instead of just trying to be updated everytime we change the keyboard object. needs a newer rhpl (0.7 or better)
Diffstat (limited to 'xf86config.py')
-rw-r--r--xf86config.py62
1 files changed, 28 insertions, 34 deletions
diff --git a/xf86config.py b/xf86config.py
index 4726fd1b1..d85ad7ed5 100644
--- a/xf86config.py
+++ b/xf86config.py
@@ -581,7 +581,7 @@ EndSection
"""
class XF86Config:
- def __init__ (self, videocard, monitor, mouse, resolution = None):
+ def __init__ (self, videocard, monitor, mouse, keyboard, resolution = None):
if videocard:
self.setVideoCard(videocard)
@@ -598,6 +598,11 @@ class XF86Config:
else:
raise RuntimeError, "no mouse specified in XF86Config __init__"
+ if keyboard:
+ self.setKeyboard(keyboard)
+ else:
+ raise RuntimeError, "no keyboard specified in XF86Config __init__"
+
self.skip = 0
self.res = resolution
self.manualModes = {}
@@ -637,16 +642,6 @@ class XF86Config:
self.fallbackModes = self.modes
self.device = None
- self.keyRules = "xfree86"
- self.keyModel = "pc101"
- self.keyLayout = "us"
- kbd = Keyboard()
- if kbd.type == 'Sun':
- self.keyRules = "sun"
- self.keyModel = kbd.model
- self.keyLayout = kbd.layout
- self.keyVariant = ""
- self.keyOptions = ""
self.monlist = {}
self.monids = {}
@@ -686,20 +681,19 @@ class XF86Config:
def getForcedDPI(self):
return self.forcedDPI
- def setKeyboard(self, rules, model, layout, variant, options):
- self.keyRules = rules
- self.keyModel = model
- self.keyLayout = layout
- self.keyVariant = variant
- self.keyOptions = options
-
def getKeyboard(self):
- return (self.keyRules, self.keyModel, self.keyLayout,
- self.keyVariant, self.keyOptions)
+ return (self.keyboard["rules"],
+ self.keyboard["model"],
+ self.keyboard["layout"],
+ self.keyboard["variant"],
+ self.keyboard["options"])
def setMouse(self, mouse):
self.mouse = mouse
+ def setKeyboard(self, keyboard):
+ self.keyboard = keyboard
+
def setVideoCard(self, videocard):
self.videocard = videocard
@@ -1161,12 +1155,12 @@ Section "Screen"
"devID" : card.getDevID(),
"mouseProto" : mouseProto,
"mouseDevice" : self.mouse.device,
- "XkbRules" : self.keyRules,
- "XkbModel" : self.keyModel,
- "XkbLayout" : self.keyLayout,
- "XkbVariant" : self.keyVariant,
+ "XkbRules" : self.keyboard["rules"],
+ "XkbModel" : self.keyboard["model"],
+ "XkbLayout" : self.keyboard["layout"],
+ "XkbVariant" : self.keyboard["variant"],
"enableVariant" : "#",
- "XkbOptions" : self.keyOptions,
+ "XkbOptions" : self.keyboard["options"],
"enableOptions" : "#",
"monitorID" : monitor.getMonitorID(),
"monitorHoriz" : monitor.getMonitorHorizSync(),
@@ -1187,9 +1181,9 @@ Section "Screen"
#
# info["fbDepth"] = self.fbDepth
- if self.keyVariant:
+ if self.keyboard["variant"]:
info["enableVariant"] = ""
- if self.keyOptions:
+ if self.keyboard["options"]:
info["enableOptions"] = ""
if self.mouse.get()[1]:
info["emulate3"] = " Emulate3Buttons\n Emulate3Timeout 50"
@@ -1299,12 +1293,12 @@ Section "Screen"
"screenModes" : screens,
"nonSparcMods" : '\n\tLoad "fbdevhw"',
"driMod" : '\n\tLoad "dri"',
- "XkbRules" : self.keyRules,
- "XkbModel" : self.keyModel,
- "XkbLayout" : self.keyLayout,
- "XkbVariant" : self.keyVariant,
+ "XkbRules" : self.keyboard["rules"],
+ "XkbModel" : self.keyboard["model"],
+ "XkbLayout" : self.keyboard["layout"],
+ "XkbVariant" : self.keyboard["variant"],
"enableVariant": "#",
- "XkbOptions" : self.keyOptions,
+ "XkbOptions" : self.keyboard["options"],
"enableOptions": "#",
"defaultDepth" : "",
"emulate3" : emulate3,
@@ -1315,9 +1309,9 @@ Section "Screen"
# see if 16 bpp is available, and if it should be the
# default depth
- if self.keyVariant:
+ if self.keyboard["variant"]:
data["enableVariant"] = ""
- if self.keyOptions:
+ if self.keyboard["options"]:
data["enableOptions"] = ""
if maxdepth > 0: