diff options
-rw-r--r-- | iw/xconfig.py | 17 | ||||
-rw-r--r-- | xf86config.py | 30 |
2 files changed, 38 insertions, 9 deletions
diff --git a/iw/xconfig.py b/iw/xconfig.py index 6046192bb..e7dab6601 100644 --- a/iw/xconfig.py +++ b/iw/xconfig.py @@ -27,7 +27,7 @@ class XCustomWindow (InstallWindow): def getNext (self): newmodes = {} - + for depth in self.toggles.keys (): newmodes[depth] = [] for (res, button) in self.toggles[depth]: @@ -44,7 +44,16 @@ class XCustomWindow (InstallWindow): pass else: self.didTest = 1 - + + def numCompare (self, first, second): + first = string.atoi (first) + second = string.atoi (second) + if first > second: + return 1 + elif first < second: + return -1 + return 0 + def getScreen (self): box = GtkVBox (FALSE, 5) box.set_border_width (5) @@ -52,7 +61,7 @@ class XCustomWindow (InstallWindow): hbox = GtkHBox (FALSE, 5) depths = self.todo.x.modes.keys () - depths.sort () + depths.sort (self.numCompare) self.toggles = {} for depth in depths: @@ -160,7 +169,7 @@ class XConfigWindow (InstallWindow): self.autoBox.pack_start (result, FALSE) self.monlist = None - if not self.todo.x.monID: + if self.todo.x.monID == "My Monitor": label = GtkLabel (_("Your monitor could not be " "autodetected. Please choose it " "from the list below:")) diff --git a/xf86config.py b/xf86config.py index b7f554d5e..acec276cc 100644 --- a/xf86config.py +++ b/xf86config.py @@ -50,6 +50,21 @@ class XF86Config: self.mouse = { "mouseDev" : "/dev/mouse", "mouseProto" : "PS/2" } + def areaCompare (self, first, second): + (sx1, sy1) = string.split (first, 'x') + (sx2, sy2) = string.split (second, 'x') + + x1 = string.atoi (sx1) + y1 = string.atoi (sy1) + x2 = string.atoi (sx2) + y2 = string.atoi (sy2) + + if ((x1 * y1) > (x2 * y2)): + return -1 + elif ((x1 * y1) < (x2 * y2)): + return 1 + return 0 + def filterModesByMemory (self): if not self.vidRam: return @@ -710,6 +725,10 @@ Section "Device" def screenSection (self): info = { "DEVICE" : self.devID, "MONITOR" : self.monID } + + for (depth, modes) in self.modes.items (): + modes.sort (self.areaCompare) + section = """ # ********************************************************************** # Screen section @@ -776,14 +795,15 @@ if __name__ == "__main__": sys.path.append ("kudzu") x = XF86Config () print x.cards ("ATI Mach64 3D RAGE II") -# x.probe () - sys.exit (0) + x.probe () +# sys.exit (0) + x.filterModesByMemory () print x.preludeSection () print x.keyboardSection () print x.mouseSection () print x.monitorSection () print x.deviceSection () - x.modes["8"] = [ "640x480" ] - x.modes["16"] = [ "640x480" ] - x.modes["32"] = [ "640x480" ] +# x.modes["8"] = [ "640x480" ] +# x.modes["16"] = [ "640x480" ] +# x.modes["32"] = [ "640x480" ] print x.screenSection () |