[yast-commit] r58229 - in /trunk/x11: ./ package/ scripts/ src/ src/autoyast/dialog/ src/autoyast/modules/ src/autoyast/proposal/ src/config/ src/dialog/ src/proposal/

Author: jdsn Date: Thu Jul 30 21:46:55 2009 New Revision: 58229 URL: http://svn.opensuse.org/viewcvs/yast?rev=58229&view=rev Log: disabled yast2-x11, but keep API, no longer create an xorg.conf (bnc#441404) 2.18.0 Removed: trunk/x11/src/autoyast/modules/monitors.ycp Modified: trunk/x11/VERSION trunk/x11/package/yast2-x11.changes trunk/x11/scripts/update_xf86config trunk/x11/scripts/xmigrate.pl trunk/x11/src/XLib.pm trunk/x11/src/XMain.ycp trunk/x11/src/autoyast/dialog/autoDialog.ycp trunk/x11/src/autoyast/modules/AutoinstX11.ycp trunk/x11/src/autoyast/modules/Makefile.am trunk/x11/src/autoyast/proposal/x11_auto.ycp trunk/x11/src/config/Makefile.am trunk/x11/src/dialog/x11Dialog.ycp trunk/x11/src/proposal/x11_proposal.ycp trunk/x11/src/proposal/x11_test.sh trunk/x11/src/x11.ycp trunk/x11/yast2-x11.spec.in Modified: trunk/x11/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/VERSION?rev=58229&r1=58228&r2... ============================================================================== --- trunk/x11/VERSION (original) +++ trunk/x11/VERSION Thu Jul 30 21:46:55 2009 @@ -1 +1 @@ -2.17.10 +2.18.0 Modified: trunk/x11/package/yast2-x11.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/package/yast2-x11.changes?rev... ============================================================================== --- trunk/x11/package/yast2-x11.changes (original) +++ trunk/x11/package/yast2-x11.changes Thu Jul 30 21:46:55 2009 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Jul 30 15:05:58 CEST 2009 - jdsn@suse.de + +- disabled yast2-x11, but keep API + no longer create an xorg.conf (bnc#441404) +- 2.18.0 + +------------------------------------------------------------------- Mon Jan 26 17:58:31 CET 2009 - jdsn@suse.de - no X server start via display manager without a graphics Modified: trunk/x11/scripts/update_xf86config URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/scripts/update_xf86config?rev... ============================================================================== --- trunk/x11/scripts/update_xf86config (original) +++ trunk/x11/scripts/update_xf86config Thu Jul 30 21:46:55 2009 @@ -5,97 +5,5 @@ # Authors: # -------- # Marcus Schaefer <ms@suse.de> -# -#=================================== -# check given device if it`s a link -#----------------------------------- -function readLink { - local realDevice - if [ -L "$1" ];then - realDevice=`ls -l $1 2>/dev/null | cut -f2 -d\>` - realDevice=`echo $realDevice` - else - realDevice=$1 - fi - echo $realDevice -} -#=================================== -# get mouse device:protocol X 4.x -#----------------------------------- -function getMouseX4 { - local configFile=$1 - local protocol=`cat $configFile | \ - grep -i "Driver.*mouse" -A5 | \ - grep -i "Protocol.*" | cut -f4 -d\" \ - 2>/dev/null` - local device=`cat $configFile | \ - grep -i "Driver.*mouse" -A4 | \ - grep -i "Device.*" | cut -f4 -d\" \ - 2>/dev/null` - device=`readLink $device` - echo "$device:$protocol" | tr [:upper:] [:lower:] -} - -#=================================== -# get mouse device:protocol X 3.x -#----------------------------------- -function getMouseX3 { - local configFile - configFile="/etc/XF86Config" - local protocol=`cat $configFile | \ - grep -i "Section.*Pointer" -A4 | \ - grep -i "Protocol.*" | cut -f2 -d\" \ - 2>/dev/null` - local device=`cat $configFile | \ - grep -i "Section.*Pointer" -A4 | \ - grep -i "Device.*" | cut -f2 -d\" \ - 2>/dev/null` - device=`readLink $device` - echo "$device:$protocol" | tr [:upper:] [:lower:] -} - -#=================================== -# update config file -#----------------------------------- -function updateMouse { - local configFile=$1 - local mouseData=$2 - local device=`echo $mouseData | cut -f1 -d:` - if [ "$device" = "/dev/psaux" ] || [ "$device" = "/dev/mouse" ];then - local protocol=`echo $mouseData | cut -f2 -d:` - if [ ! -z "$protocol" ]; then - cat $configFile | sed -e s"@$protocol@explorerps/2@" \ - -e s"@$device@/dev/input/mice@" \ - > "$configFile.tmp$$" - mv $configFile $configFile.before_update - mv $configFile.tmp$$ $configFile - fi - fi -} - -# /.../ -# main part below -# --- -#==================================== -# handle XOrg 4.x case -#------------------------------------ -configFile="/etc/X11/XF86Config" -if [ -f "$configFile" ];then - mouseData=`getMouseX4 $configFile` - updateMouse $configFile $mouseData -fi -configFile="/etc/X11/xorg.conf" -if [ -f "$configFile" ];then - mouseData=`getMouseX4 $configFile` - updateMouse $configFile $mouseData -fi - -#==================================== -# handle XFree86 3.x case -#------------------------------------ -configFile="/etc/XF86Config" -if [ -f "$configFile" ];then - mouseData=`getMouseX3` - updateMouse $configFile $mouseData -fi +exit 0 Modified: trunk/x11/scripts/xmigrate.pl URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/scripts/xmigrate.pl?rev=58229... ============================================================================== Binary files - no diff available. Modified: trunk/x11/src/XLib.pm URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/XLib.pm?rev=58229&r1=5822... ============================================================================== --- trunk/x11/src/XLib.pm (original) +++ trunk/x11/src/XLib.pm Thu Jul 30 21:46:55 2009 @@ -13,11 +13,11 @@ use strict; use YaST::YCP qw(:LOGGING Boolean sformat);; use YaPI; -use Data::Dumper; -use Time::localtime; -use SaX; -use FBSet; -use Env; +#use Data::Dumper; +#use Time::localtime; +#use SaX; +#use FBSet; +#use Env; textdomain("x11"); @@ -26,32 +26,17 @@ use strict; use Errno qw(ENOENT); -#========================================== -# Globals -#------------------------------------------ -my %profileDriverOptions = (); -my $init = 0; -my $fbdev= 0; -my %section; -my $config; -my %cdb; -my %tabletCDB; - -#========================================== -# GetFbColor -#------------------------------------------ -sub GetFbColor { - my $data = FBSet::FbGetData(); - my $cols = $data->swig_depth_get(); - return $cols; -} +# +# keeping compatible API but just return dummy data +# + #========================================== # isInitialized #------------------------------------------ BEGIN{ $TYPEINFO{isInitialized} = ["function","boolean"]; } sub isInitialized { - return $init; + return 1; } #========================================== @@ -59,79 +44,37 @@ #------------------------------------------ BEGIN{ $TYPEINFO{loadApplication} = ["function","void"]; } sub loadApplication { - my $class = shift; - my $sinit = new SaX::SaXInit; - $ENV{HW_UPDATE} = 1; - # prevent sax to switch to interactive mode if sax2-gui is missing (bnc#430600) - $ENV{IGNORE_GUI_CHECK} = 1; - - # do not set busid parameter in single chip mode, therefore try to set the primary chip (bnc#381644) - # setPrimaryChip was reenabled due to (bnc#427371) after it got temporarily disabled - $sinit -> setPrimaryChip(); - $sinit -> doInit(); - my @importID = ( - $SaX::SAX_CARD, - $SaX::SAX_DESKTOP, - $SaX::SAX_POINTERS, - $SaX::SAX_KEYBOARD, - $SaX::SAX_LAYOUT, - $SaX::SAX_PATH, - $SaX::SAX_EXTENSIONS - ); - $config = new SaX::SaXConfig; - foreach my $id (@importID) { - my $import = new SaX::SaXImport ( $id ); - $import->setSource ( $SaX::SAX_AUTO_PROBE ); - $import->doImport(); - $config->addImport ( $import ); - my $name = $import->getSectionName(); - $section{$name} = $import; - } - if (isExternalVGANoteBook()) { - activateExternalVGA(); - } - $fbdev= isFbdevBased(); - $init = 1; + +# LOADING OF SaX disabled +return; + } #========================================== # getKernelFrameBufferMode #------------------------------------------ BEGIN{ $TYPEINFO{getKernelFrameBufferMode} = ["function", "integer"]; } sub getKernelFrameBufferMode { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - my $mode = $mDesktop -> getFBKernelMode ( - getActiveResolution(),getActiveColorDepth() - ); - return $mode; + +return 0; + } #========================================== # setKernelFrameBufferMode #------------------------------------------ BEGIN{ $TYPEINFO{setKernelFrameBufferMode} = ["function","boolean","integer"]; } sub setKernelFrameBufferMode { - my $class = shift; - my $mode = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - if (! $mDesktop -> setFBKernelMode ( $mode )) { - return 0; - } - return 1; + +return 1; + } #========================================== # writeConfiguration #------------------------------------------ BEGIN{ $TYPEINFO{writeConfiguration} = ["function","boolean"]; } sub writeConfiguration { - my $class = shift; - $config->setMode ($SaX::SAX_NEW); - my $status = $config->createConfiguration(); - $config->commitConfiguration(); - return $status; + +return 1; + } #========================================== # setPreferredMode @@ -139,683 +82,320 @@ #------------------------------------------ BEGIN{ $TYPEINFO{setPreferredMode} = ["function", "boolean", "string", "string"]; } sub setPreferredMode { - my $class = shift; - my $resolution = shift; - my $colorDepth = shift; - my $mCard = new SaX::SaXManipulateCard ( $section{Card} ); - $mCard->selectCard(0); - - # if card driver is fbdev do not set preferred mode - if ( $mCard->getCardDriver() eq "fbdev" ) - { return 0; } - - # check if the values are valid - if ( $resolution !~ /^\d+x\d+$/ || - $colorDepth !~ /^\d+$/ ) - { return 0; } - - # really set the preferred mode - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->selectDesktop(0); - $mDesktop->setPreferredMode( $resolution ); - $mDesktop->setColorDepth( $colorDepth ); - return 1; +return 1; + } #========================================== # testConfiguration #------------------------------------------ BEGIN{ $TYPEINFO{testConfiguration} = ["function","boolean"]; } sub testConfiguration { - my $ok = 1; - $config->setMode ($SaX::SAX_NEW); - my $status = $config->testConfiguration(); - if ($status == -1) { - $ok = 0; - } - if ($status == 0) { - $ok = writeConfiguration(); - } - return $ok; + +return 1; + } #========================================== # isExternalVGANoteBook #------------------------------------------ BEGIN{ $TYPEINFO{isExternalVGANoteBook} = ["function","boolean"]; } sub isExternalVGANoteBook { - my $ok = 0; - my $saxCard = new SaX::SaXManipulateCard ( - $section{Card} - ); - my $saxDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - if ($saxCard->isNoteBook()) { - my $profile = $saxDesktop->getDualHeadProfile(); - if (defined $profile) { - if ($profile ne "") { - $ok = 1; - } - } - } - return $ok; + +return 1; + } #========================================== # isNoteBookHardware #------------------------------------------ BEGIN{ $TYPEINFO{isNoteBookHardware} = ["function","boolean"]; } sub isNoteBookHardware { - my $saxCard = new SaX::SaXManipulateCard ( - $section{Card} - ); - if ($saxCard->isNoteBook()) { - return 1; - } - return 0; + +return 1; + } #========================================== # isExternalVGAactive #------------------------------------------ BEGIN{ $TYPEINFO{isExternalVGAactive} = ["function","boolean"]; } sub isExternalVGAactive { - my $ok = 0; - my $saxCard = new SaX::SaXManipulateCard ( $section{Card} ); - my %options = %{$saxCard->getOptions()}; - if (defined $options{SaXDualHead}) { - $ok = 1; - } - return $ok; + +return 1; + } #========================================== # activateExternalVGA #------------------------------------------ BEGIN{ $TYPEINFO{activateExternalVGA} = ["function", "void"]; } sub activateExternalVGA { - my $class = shift; - my $saxCard = new SaX::SaXManipulateCard ( $section{Card} ); - if ((keys %profileDriverOptions) == 0) { - %profileDriverOptions = readProfile(); - } - foreach my $key (sort keys %profileDriverOptions) { - $saxCard->removeCardOption ( $key ); - } - foreach my $key (sort keys %profileDriverOptions) { - $saxCard->addCardOption ( $key,$profileDriverOptions{$key} ); - } + +return; + } #========================================== # deactivateExternalVGA #------------------------------------------ BEGIN{ $TYPEINFO{deactivateExternalVGA} = ["function", "void"]; } sub deactivateExternalVGA { - my $class = shift; - my $saxCard = new SaX::SaXManipulateCard ( $section{Card} ); - if ((keys %profileDriverOptions) == 0) { - %profileDriverOptions = readProfile(); - } - foreach my $key (sort keys %profileDriverOptions) { - $saxCard->removeCardOption ( $key ); - } + +return; + } #========================================== # setDisplaySize #------------------------------------------ BEGIN{ $TYPEINFO{setDisplaySize} = ["function","void",["list","string"]]; } sub setDisplaySize { - my $class = shift; - my @list = @{+shift}; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - my $traversal = $list[0]; - my @ratios = split (/\//,$list[1]); - my $aspect = $ratios[0]; - my $ratio = $ratios[1]; - - # (#288730) check for validity of parameters - if ($traversal !~ /^\d+(\.\d+)?$/ ) {$traversal="15"; } - if ($aspect !~ /^\d+$/ ) {$aspect="4"; } - if ($ratio !~ /^\d+$/ ) {$ratio="3"; } - - $mDesktop->setDisplayRatioAndTraversal ( - $traversal,$aspect,$ratio - ); + +return; + } #========================================== # getDisplaySize #------------------------------------------ BEGIN{ $TYPEINFO{getDisplaySize} = ["function", ["list","string"]]; } sub getDisplaySize { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - my @result = ("undef"); - my $traversal = $mDesktop->getDisplayTraversal(); - my @ratio = @{$mDesktop->getDisplayRatio()}; - if (defined $traversal) { - # if traversal is empty or not a numeric, set it to undef and do not operate on it (bnc#388259) - if ($traversal eq "" || $traversal !~ /^\d+\.?\d*$/) - { $traversal = "undef"; } - else - # just round the computed (real) traversal to a tenth - { $traversal = sprintf ("%.1f", $traversal); } - - @result = ($traversal,@ratio); - } - return \@result; + +my @res = (); +return \@res; + } #========================================== # setResolution #------------------------------------------ BEGIN{ $TYPEINFO{setResolution} = ["function", "void", "string"]; } sub setResolution { - my $class = shift; - my $resolution = $_[0]; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - my @resList = (); - my $basePixels = 0; - my $basePixelsX = 0; - my $basePixelsY = 0; - my %resDict = %{getAvailableResolutions()}; - foreach (keys %resDict) { - if ($resDict{$_} eq $resolution) { - if ($_ =~ /(.*)x(.*)/) { - $basePixelsX = $1; - $basePixelsY = $2; - $basePixels = $basePixelsX * $basePixelsY; - push (@resList,$_); - } - } - } - if ($basePixels == 0) { - return; - } - foreach (keys %resDict) { - if ($_ =~ /(.*)x(.*)/) { - my $x = $1; - my $y = $2; - my $pixelSpace = $x * $y; - if (($pixelSpace < $basePixels) && - ($x<=$basePixelsX) && ($y<=$basePixelsY) - ) { - push (@resList,$_); - } - } - } - my @colors = (8,15,16,24,32); - foreach my $color ( @colors ) { - $section{Desktop}->removeEntry ("Modes:$color"); - foreach my $ritem ( sortResolution (@resList)) { - if ($ritem =~ /(.*)x(.*)/) { - $mDesktop->addResolution ($color,$1,$2); - } - } - } - setupMetaModes ($resList[0]); + +return; + } #========================================== # setDefaultColorDepth #------------------------------------------ BEGIN{ $TYPEINFO{setDefaultColorDepth} = ["function", "void","string"]; } sub setDefaultColorDepth { - my $class = shift; - my $color = $_[0]; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->setColorDepth ( $color ); + +return; + } #========================================== # activate3D #------------------------------------------ BEGIN{ $TYPEINFO{activate3D} = ["function", "void"]; } sub activate3D { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->selectDesktop (0); - $mDesktop->enable3D(); + +return; + } #========================================== # deactivate3D #------------------------------------------ BEGIN{ $TYPEINFO{deactivate3D} = ["function", "void"]; } sub deactivate3D { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->selectDesktop (0); - $mDesktop->disable3D(); + +return; + } #========================================== # hasOpenGLFeatures #------------------------------------------ BEGIN{ $TYPEINFO{hasOpenGLFeatures} = ["function", "boolean"]; } sub hasOpenGLFeatures { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->selectDesktop (0); - if ($mDesktop->is3DEnabled()) { - return 1; - } - return 0; + +return 0; + } #========================================== # has3DCapabilities #------------------------------------------ BEGIN{ $TYPEINFO{has3DCapabilities} = ["function", "boolean"]; } sub has3DCapabilities { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - my $mCard = new SaX::SaXManipulateCard ( - $section{Card} - ); - $mDesktop->selectDesktop (0); - my $has3DCapabilities = $mDesktop->is3DCard(); - my $isMultiheaded = $mCard->getDevices(); - if ((! $has3DCapabilities) || ($isMultiheaded > 1)) { - return 0; - } - return 1; + +return 0; + } #========================================== # isFbdevBased #------------------------------------------ BEGIN{ $TYPEINFO{isFbdevBased} = ["function", "boolean"]; } sub isFbdevBased { - my $class = shift; - my $mCard = new SaX::SaXManipulateCard ( - $section{Card} - ); - if ($mCard -> getCardDriver() eq "fbdev") { - return 1; - } - return 0; + +return 0; + } #========================================== # getCardName #------------------------------------------ BEGIN{ $TYPEINFO{getCardName} = ["function", "string"]; } sub getCardName { - my $class = shift; - my $mCard = new SaX::SaXManipulateCard ( - $section{Card} - ); - $mCard->selectCard (0); - my $vendor = $mCard->getCardVendor(); - my $model = $mCard->getCardModel(); - my $result = $vendor." ".$model; - return $result; + +return "SAX AND YAST2-X11 ARE DISABLED"; + } #========================================== # getMonitorName #------------------------------------------ BEGIN{ $TYPEINFO{getMonitorName} = ["function", "string"]; } sub getMonitorName { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->selectDesktop (0); - my $vendor = $mDesktop->getMonitorVendor(); - if ($vendor =~ /Unknown/i) { - return "undef"; - } - my $model = $mDesktop->getMonitorName(); - my $result = $vendor." ".$model; - return $result; + +return "SAX AND YAST2-X11 ARE DISABLED"; + } #========================================== # getMonitorVendor #------------------------------------------ BEGIN{ $TYPEINFO{getMonitorVendor} = ["function", "string"]; } sub getMonitorVendor { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->selectDesktop (0); - my $vendor = $mDesktop->getMonitorVendor(); - if ($vendor =~ /Unknonw/i) { - return "undef"; - } - return $vendor; + +return "SAX AND YAST2-X11 ARE DISABLED"; + } #========================================== # getMonitorModel #------------------------------------------ BEGIN{ $TYPEINFO{getMonitorModel} = ["function", "string"]; } sub getMonitorModel { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->selectDesktop (0); - my $model = $mDesktop->getMonitorName(); - if ($model =~ /Unknonw/i) { - return "undef"; - } - return $model; + +return "SAX AND YAST2-X11 ARE DISABLED"; + } #========================================== # getActiveResolution #------------------------------------------ BEGIN{ $TYPEINFO{getActiveResolution} = ["function", "string"]; } sub getActiveResolution { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->selectDesktop (0); - my $color = $mDesktop->getColorDepth(); - if (! $color) { - $color = GetFbColor(); - } - my @list = @{$mDesktop->getResolutions($color)}; - if (! @list) { - push (@list,"800x600"); - } - my $result = shift (@list); - return $result; + +return "SAX AND YAST2-X11 ARE DISABLED"; + } #========================================== # getActiveResolutionString #------------------------------------------ BEGIN{ $TYPEINFO{getActiveResolutionString} = ["function", "string"]; } sub getActiveResolutionString { - my $resolution = getActiveResolution(); - my @reslist = @{getAvailableResolutionNames()}; - foreach (@reslist) { - if ($_ =~ /$resolution/) { - return $_; - } - } - return $resolution; + +return "SAX AND YAST2-X11 ARE DISABLED"; + } #========================================== # getActiveColorDepth #------------------------------------------ BEGIN{ $TYPEINFO{getActiveColorDepth} = ["function", "string"]; } sub getActiveColorDepth { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->selectDesktop (0); - my $color = $mDesktop->getColorDepth(); - if (! $color) { - $color = GetFbColor(); - } - return $color; + +return "SAX AND YAST2-X11 ARE DISABLED"; + } #========================================== # getHsyncMin #------------------------------------------ BEGIN{ $TYPEINFO{getHsyncMin} = ["function", "string"]; } sub getHsyncMin { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - my @hrange = @{$mDesktop->getHsyncRange()}; - return $hrange[0]; + +return "SAX AND YAST2-X11 ARE DISABLED"; + } #========================================== # getHsyncMax #------------------------------------------ BEGIN{ $TYPEINFO{getHsyncMax} = ["function", "string"]; } sub getHsyncMax { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - my @hrange = @{$mDesktop->getHsyncRange()}; - return $hrange[1]; + +return "SAX AND YAST2-X11 ARE DISABLED"; + } #========================================== # getVsyncMin #------------------------------------------ BEGIN{ $TYPEINFO{getVsyncMin} = ["function", "string"]; } sub getVsyncMin { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - my @vrange = @{$mDesktop->getVsyncRange()}; - return $vrange[0]; + +return "SAX AND YAST2-X11 ARE DISABLED"; + } #========================================== # getVsyncMax #------------------------------------------ BEGIN{ $TYPEINFO{getVsyncMax} = ["function", "string"]; } sub getVsyncMax { - my $class = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - my @vrange = @{$mDesktop->getVsyncRange()}; - return $vrange[1]; + +return "SAX AND YAST2-X11 ARE DISABLED"; + } #========================================== # setHsyncRange #------------------------------------------ BEGIN{ $TYPEINFO{setHsyncRange} = ["function", "void","integer","integer"]; } sub setHsyncRange { - my $class = shift; - my $start = shift; - my $stop = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->setHsyncRange ($start,$stop); + +return; + } #========================================== # setVsyncRange #------------------------------------------ BEGIN{ $TYPEINFO{setVsyncRange} = ["function", "void","integer","integer"]; } sub setVsyncRange { - my $class = shift; - my $start = shift; - my $stop = shift; - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->setVsyncRange ($start,$stop); + +return; + } #========================================== # getMonitorCDB #------------------------------------------ BEGIN{ $TYPEINFO{getMonitorCDB} = ["function",["map","string",["list","string"]]]; } sub getMonitorCDB { - my $class = shift; - my $size = keys %cdb; - if ($size > 0) { - return \%cdb; - } - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->selectDesktop (0); - my @vendorList = @{$mDesktop->getCDBMonitorVendorList()}; - foreach my $vendor (@vendorList) { - my $modelList = $mDesktop->getCDBMonitorModelList ($vendor); - $cdb{$vendor} = $modelList; - } - return \%cdb; + +my %res = (); +return \%res; + } #========================================== # setMonitorCDB #------------------------------------------ BEGIN{ $TYPEINFO{setMonitorCDB} = ["function","void",["list","string"]]; } sub setMonitorCDB { - my $class = shift; - my @list = @{+shift}; - my $group = join (":",@list); - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->selectDesktop (0); - $mDesktop->setCDBMonitor ($group); + +return; + } #========================================== # hasValidColorResolutionSetup #------------------------------------------ BEGIN{ $TYPEINFO{hasValidColorResolutionSetup} = ["function", "boolean","string","string"]; } sub hasValidColorResolutionSetup { - my $class = shift; - my $color = shift; - my $res = shift; - if (! $fbdev) { - return 1; - } - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - if ($color =~ /\[ (.*) Bit \]/i) { - $color = $1; - } - if ($res =~ /(.*x.*) \(/) { - $res = $1; - } - my $mode = $mDesktop -> getFBKernelMode ($res,$color); - if ($mode > 0) { - return 1; - } - return 0; + +return 1; + } #========================================== # getAvailableResolutions #------------------------------------------ BEGIN{ $TYPEINFO{getAvailableResolutions} = ["function",["map","string","string"]]; } sub getAvailableResolutions { - my $class = shift; - my $file = "/usr/share/sax/api/data/MonitorResolution"; - if (! open (FD,$file)) { - return; - } - my %resList; - while (<FD>) { - if ($_ =~ /(.*)=(.*)/) { - $resList{$1} = $2; - } - } - close (FD); - return \%resList; + +my %res = (); +return \%res; + } #========================================== # getAvailableResolutionNames #------------------------------------------ BEGIN{ $TYPEINFO{getAvailableResolutionNames} = ["function",["list","string"]]; } sub getAvailableResolutionNames { - my $class = shift; - my $file = "/usr/share/sax/api/data/MonitorResolution"; - my @result = (); - if (! open (FD,$file)) { - return \@result; - } - while (<FD>) { - if ($_ =~ /(.*)=(.*)/) { - push (@result,$2); - } - } - close (FD); - if ($fbdev) { - my @fbresult = (); - my $mDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - $mDesktop->selectDesktop (0); - my @fblist = @{$mDesktop->getResolutionsFromFrameBuffer()}; - foreach my $resstring (@result) { - foreach my $res (@fblist) { - if ($resstring =~ /$res/) { - push (@fbresult,$resstring); last; - } - } - } - return \@fbresult; - } - return \@result; -} -#========================================== -# sortResolution -#------------------------------------------ -sub sortResolution { - my @list = @_; # list of resolutions - my %index; # index hash - foreach my $i (@list) { - my @res = split(/x/,$i); - my $pixel = $res[0] * $res[1]; - $index{$pixel} = $i; - } - @list = (); - sub numerisch { $b <=> $a; } - foreach my $i (sort numerisch keys %index) { - push(@list,$index{$i}); - } - return @list; -} -#========================================== -# readProfile -#------------------------------------------ -sub readProfile { - my $saxDesktop = new SaX::SaXManipulateDesktop ( - $section{Desktop},$section{Card},$section{Path} - ); - my %result = (); - my $profile = $saxDesktop->getDualHeadProfile(); - if ($profile ne "") { - my $pProfile = new SaX::SaXImportProfile ( $profile ); - $pProfile -> doImport(); - my $mImport = $pProfile -> getImport ( $SaX::SAX_CARD ); - if (defined $mImport) { - my $saxProfileCard = new SaX::SaXManipulateCard ( $mImport ); - %result = %{$saxProfileCard->getOptions()}; - } - } - return %result; -} -#========================================== -# setupMetaModes -#------------------------------------------ -sub setupMetaModes { - my $resolution = $_[0]; - my $mCard = new SaX::SaXManipulateCard ( - $section{Card} - ); - my %options = %{$mCard->getOptions()}; - if (defined $options{MetaModes}) { - my @metaList = split (/,/,$options{MetaModes}); - $metaList[0] = $resolution; - my $value = join (",",@metaList); - $mCard->removeCardOption ("MetaModes"); - $mCard->addCardOption ("MetaModes",$value); - } -} + +my @res; +return \@res; + +} #========================================== # return current Keyboard layout #------------------------------------------ BEGIN{ $TYPEINFO{getXkbLayout} = ["function", "string"]; } sub getXkbLayout { - my $class = shift; - my $mKeyboard = new SaX::SaXManipulateKeyboard ( - $section{Keyboard} - ); - my @list = @{$mKeyboard->getXKBLayout()}; - my $result = shift (@list); - return $result; + +return "SAX AND YAST2-X11 ARE DISABLED"; + } #========================================== @@ -823,11 +403,9 @@ #------------------------------------------ BEGIN{ $TYPEINFO{setXkbLayout} = ["function", "void", "string"]; } sub setXkbLayout { - my ($class, $layout) = @_; - my $mKeyboard = new SaX::SaXManipulateKeyboard ( - $section{Keyboard} - ); - $mKeyboard->setXKBLayout ($layout); + +return; + } #========================================== @@ -835,11 +413,9 @@ #------------------------------------------ BEGIN{ $TYPEINFO{setXkbModel} = ["function", "void", "string"]; } sub setXkbModel { - my ($class, $model) = @_; - my $mKeyboard = new SaX::SaXManipulateKeyboard ( - $section{Keyboard} - ); - $mKeyboard->setXKBModel ($model); + +return; + } #========================================== @@ -847,11 +423,9 @@ #------------------------------------------ BEGIN{ $TYPEINFO{setXkbVariant} = ["function", "void", "string", "string"]; } sub setXkbVariant { - my ($class, $layout, $variant) = @_; - my $mKeyboard = new SaX::SaXManipulateKeyboard ( - $section{Keyboard} - ); - $mKeyboard->setXKBVariant ($layout, $variant); + +return; + } #========================================== @@ -859,20 +433,9 @@ #------------------------------------------ BEGIN{ $TYPEINFO{setXkbMappings} = ["function","void", ["map","string","string"]];} sub setXkbMappings { - # ... - # set mapping for the special keys (Left/Right-Alt Scroll-Lock - # and Right Ctrl) parameter is map with pairs of type - # { SaX::XKB_LEFT_ALT => SaX::XKB_MAP_META } - # --- - my ($class, $mappings) = @_; - my $mKeyboard = new SaX::SaXManipulateKeyboard ( - $section{Keyboard} - ); - return if (ref ($mappings) ne "HASH" || ! %{$mappings}); - while (my ($type, $mapping) = each %{$mappings}) { - next if !$mapping; - $mKeyboard->setXKBMapping ($type, $mapping); - } + +return; + } #========================================== @@ -880,20 +443,9 @@ #------------------------------------------ BEGIN{ $TYPEINFO{setXkbOptions} = ["function","void", ["list","string"]];} sub setXkbOptions { - # ... - # resets the current list of options and adds the new ones - # parameter is list of options - # --- - my ($class, $options) = @_; - return if (!defined $options || ref ($options) ne "ARRAY"); - my $mKeyboard = new SaX::SaXManipulateKeyboard ( - $section{Keyboard} - ); - my @opt = @{$options}; - $mKeyboard->setXKBOption (shift @opt); - foreach my $option (@opt) { - $mKeyboard->addXKBOption ($option); - } + +return; + } #========================================== @@ -901,122 +453,46 @@ #------------------------------------------ BEGIN{ $TYPEINFO{getTabletCDB} = ["function",["map","string",["list","string"]]]; } sub getTabletCDB { - my $class = shift; - my $size = keys %tabletCDB; - if ($size > 0) { - return \%tabletCDB; - } - my $mTablet = new SaX::SaXManipulateTablets ( - $section{Pointers},$section{Layout} - ); - my @vendorList = @{$mTablet->getTabletVendorList()}; - foreach my $vendor (@vendorList) { - my $modelList = $mTablet->getTabletModelList ($vendor); - $tabletCDB{$vendor} = $modelList; - } - return \%tabletCDB; + +my %res = (); +return \%res; + } #========================================== # getTabletVendor #------------------------------------------ BEGIN{ $TYPEINFO{getTabletVendor} = ["function", "string"]; } sub getTabletVendor { - my $class = shift; - my $mTablet = new SaX::SaXManipulateTablets ( - $section{Pointers},$section{Layout} - ); - my $vendor = $mTablet->getVendor(); - if ($vendor =~ /Unknown/i) { - return "undef"; - } - return $vendor; + +return "SAX AND YAST2-X11 ARE DISABLED"; + } #========================================== # getTabletModel #------------------------------------------ BEGIN{ $TYPEINFO{getTabletModel} = ["function", "string"]; } sub getTabletModel { - my $class = shift; - my $mTablet = new SaX::SaXManipulateTablets ( - $section{Pointers},$section{Layout} - ); - my $model = $mTablet->getName(); - if ($model =~ /Unknown/i) { - return "undef"; - } - return $model; + +return "SAX AND YAST2-X11 ARE DISABLED"; + } #========================================== # getTabletID #------------------------------------------ BEGIN{ $TYPEINFO{getTabletID} = ["function", "integer"]; } sub getTabletID { - my $mTablet = new SaX::SaXManipulateTablets ( - $section{Pointers},$section{Layout} - ); - my $tabletID = 0; - for ( my $i = $SaX::SAX_CORE_POINTER ; $i < $section{Pointers}->getCount() ; $i += 2 ) { - if ($mTablet->selectPointer($i)) { - if ($mTablet->isTablet()) { - $tabletID = $i; - } - } - } - if ( $tabletID == 0 ) { - return 0; - } - $mTablet->selectPointer( $tabletID ); - return $tabletID; + +return 0; + } #========================================== # setTablet #------------------------------------------ BEGIN{ $TYPEINFO{setTablet} = ["function","void",["list","string"]]; } sub setTablet { - my $vendor = shift; - my $model = shift; - my $mTablet = new SaX::SaXManipulateTablets ( - $section{Pointers},$section{Layout} - ); - # only call the wrapper function of the sax api (bnc#445422) - $mTablet->setTablet("$vendor:$model"); -} +return; -#========================================== -# test code -#------------------------------------------ -if (0) { - loadApplication(); - - my $c = hasValidColorResolutionSetup (undef,"24","1024x768"); - printf ("___$c\n"); - exit (0); - - my @a = @{getAvailableResolutionNames()}; - print "@a\n"; - exit (0); - - my @list = @{getDisplaySize()}; - print "@list\n"; - @list = (12.2,"5/4"); - setDisplaySize ("class",\@list); - @list = @{getDisplaySize()}; - print "@list\n"; - exit; - - print "HW_UPDATE=$ENV{HW_UPDATE}\n"; - my $resolution = getActiveResolution (); - my $colordepth = getActiveColorDepth (); - my $cardname = getCardName(); - my $monitorname= getMonitorName(); - my $status3D = hasOpenGLFeatures(); - my $statusCard = has3DCapabilities(); - my $resstring = getActiveResolutionString(); - print "$resolution: $colordepth: $cardname: $monitorname\n"; - print "3D enabled: $status3D\n"; - print "3D capable: $statusCard\n"; - print "$resstring\n"; } 1; Modified: trunk/x11/src/XMain.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/XMain.ycp?rev=58229&r1=58... ============================================================================== --- trunk/x11/src/XMain.ycp (original) +++ trunk/x11/src/XMain.ycp Thu Jul 30 21:46:55 2009 @@ -37,17 +37,19 @@ //========================================== // Start SaX2 in normal mode... //------------------------------------------ -integer status = (integer)SCR::Execute ( .target.bash, - "/usr/sbin/sax2" -); +//integer status = (integer)SCR::Execute ( .target.bash, +// "/usr/sbin/sax2" +//); //========================================== // exit module... //------------------------------------------ -y2milestone ("SaX finished with exit code: <%1>",status); -if (status == 0) { - return `next; -} -return `nil; +//y2milestone ("SaX finished with exit code: <%1>",status); +y2error("SaX has been called via yast2-x11. This should not happen as X will be configured automatically. Exiting now."); +return `next; +//if (status == 0) { +// return `next; +//} +//return `nil; } // end Modified: trunk/x11/src/autoyast/dialog/autoDialog.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/autoyast/dialog/autoDialo... ============================================================================== --- trunk/x11/src/autoyast/dialog/autoDialog.ycp (original) +++ trunk/x11/src/autoyast/dialog/autoDialog.ycp Thu Jul 30 21:46:55 2009 @@ -7,879 +7,7 @@ */ { textdomain "x11"; - include "wizard/sequencer.ycp"; - import "Label"; - import "AutoinstX11"; - import "Wizard"; - import "Popup"; - import "XMessages"; - /** - * Build main Dialog - * @return term - */ - define term updateContents() - { - map x11 = AutoinstX11::x11; - list resolutions = []; - list<string> resolutions_list = [ - "640x480 (VGA)", - "768x576 (PAL)", - "800x600 (SVGA)", - "1024x768 (XGA)", - "1152x864 (XGA)", - "1280x768 (WXGA)", - "1280x800 (WXGA)", - "1280x960 (QVGA)", - "1280x1024 (SXGA)", - "1440x900 (WXGA)", - "1400x1050 (SXGA+)", - "1600x1000", - "1600x1024 (WSXGA)", - "1600x1200 (UXGA)", - "1680x1050 (WSXGA+)", - "1900x1200", - "1920x1200 (WUXGA)", - "2048x1536 (QXGA)", - "2560x2048 (QSXGA)", - "2800x2100 (QSXGA+)", - "3200x2400 (QUXGA)" - ]; - - // made color depth list consistent and removed the 32bit special settings (bnc#405797) - list<map> depths_list = [ - $[ "desc" : XMessages::color8bit, - "depth" : 8 ], - $[ "desc" : XMessages::color15bit, - "depth" : 15 ], - $[ "desc" : XMessages::color16bit, - "depth" : 16 ], - $[ "desc" : XMessages::color24bit, - "depth" : 24 ] - ]; - - - foreach(string res, resolutions_list , ``{ - resolutions=add(resolutions, `item( `id(res), res, (res == x11["resolution"]:"1024x768"))); - }); - list color_depths = []; - - foreach(map d, depths_list , ``{ - color_depths=add(color_depths, - `item( `id(d["depth"]:16), d["desc"]:XMessages::color16bit, - ( d["depth"]:16 == x11["color_depth"]:16))); - }); - list displaymanager = - [ - `item(`id ("kdm"), _("KDM"), - (x11["display_manager"]:"kdm" == "kdm")), - `item(`id("gdm"), _("GDM"), ( - x11["display_manager"]:"kdm" == "gdm")), - `item(`id("xdm"), _("XDM"), ( - x11["display_manager"]:"kdm" == "xdm")) - ]; - - list windowmanager = - [ - `item(`id ("kde"), _("KDE"), - (x11["window_manager"]:"kde" == "kde")), - `item(`id("gnome"), _("GNOME"), ( - x11["window_manager"]:"kde" == "gnome")), - `item(`id("twm"), _("TWM"), ( - x11["window_manager"]:"kde" == "twm")), - `item(`id("fvwm"), _("FVWM"), ( - x11["window_manager"]:"kde" == "fvwm")) - ]; - boolean xgl_opts_enabled = false; - if (x11["xgl_custom_options"]:"" != "" ) - { - xgl_opts_enabled = true; - } - // translators: this string is used in the context of fetching a configuration setting from the system - string fetch_xgl_opts = _("Fetch from system"); - term contents = - `Top( - `VBox( - `Frame( _("&General Options:"), - `VBox( - `Left( - `CheckBox( - `id(`enable_3d), - _("&Enable 3D Support if possible"), - x11["enable_3d"]:false) - ), - `Left( - `CheckBox( - `id(`enable_xgl), - _("Enable &Xgl if possible"), - x11["enable_xgl"]:false) - ), - `Left( - `HBox( `CheckBox( `id(`xgl_options), `opt(`notify), _("&Custom Xgl options"), xgl_opts_enabled), - `HBox( `id(`xgl_opts_hbox), - `TextEntry(`id(`xgl_options_string), "", x11["xgl_custom_options"]:"") //, - // `PushButton(`id(`fetch_xgl_options), fetch_xgl_opts) - ) - )), - `VSpacing(1), - `HBox( - `HWeight(50, - `ComboBox(`id(`depth), - _("Co&lor Depth"), - color_depths - )), - `HSpacing(1), - `HWeight(50,`ComboBox(`id(`resolution), _("Resol&ution"), - resolutions - ) - ) - ) - ) - ), - `Frame( _("Desktop:"), - `VBox( - `HBox( - `HWeight(30, `ComboBox(`id(`dm), _("&Display Manager"), - displaymanager - )), - `HWeight(70,`Empty()) - ), - `HBox( - `HWeight(30, `ComboBox(`id(`wm), - _("&Window Manager"), - windowmanager - )), - `HWeight(70,`Empty()) - ) - ) - ) - ) - ); - return contents; - } - - - /** - * Main X11 Options - * @return symbol - */ - define symbol x11Options() - { - - - string caption = _("X11 Configuration"); - - - - // x11 help 1/3 - string help = _("<p>Use this dialog to configure the X11 system and the -display attached to the computer to install.</P> -"); - // x11 help 2/3 - help = help + _("<P>Additionally, configure if the X11 system should -be started at boot time and what display manager should be used.</p> -"); - - Wizard::SetContents(caption, - updateContents(), help, true, true); - - UI::ChangeWidget(`id(`xgl_opts_hbox), `Enabled, (boolean)UI::QueryWidget(`id(`xgl_options), `Value)); - - any ret = nil; - repeat { - ret = UI::UserInput(); - - if ( ret ==`next ) - { - integer depth = (integer)UI::QueryWidget(`id(`depth), `Value); - AutoinstX11::x11["color_depth"] = depth ; - - string resol = (string)UI::QueryWidget(`id(`resolution), `Value); - AutoinstX11::x11["resolution"] = resol; - - string default_dm = (string)UI::QueryWidget(`id(`dm), `Value); - AutoinstX11::x11["display_manager"] = default_dm; - - string default_wm = (string)UI::QueryWidget(`id(`wm), `Value); - AutoinstX11::x11["window_manager"] = default_wm; - - boolean enable_3d = (boolean)UI::QueryWidget(`id(`enable_3d), `Value); - AutoinstX11::x11["enable_3d"] = enable_3d; - - boolean enable_xgl = (boolean)UI::QueryWidget(`id(`enable_xgl), `Value); - AutoinstX11::x11["enable_xgl"] = enable_xgl; - - if (enable_xgl && (boolean)UI::QueryWidget(`id(`xgl_options), `Value) ) - { - AutoinstX11::x11["xgl_custom_options"] = (string)UI::QueryWidget(`id(`xgl_options_string), `Value); - } - else - { - AutoinstX11::x11["xgl_custom_options"] = ""; - } - } - - UI::ChangeWidget(`id(`xgl_opts_hbox), `Enabled, (boolean)UI::QueryWidget(`id(`xgl_options), `Value)); - - } until ( ret ==`next || ret ==`back || ret == `abort || ret == `cancel ); - - - return (symbol)ret; - } - - - - /* - * Create dialog for monitor selection - * @param list of vendors and models (each a list of strings) - * @return term dialog as term to be put into Wizard::SetContents() - */ - define term X11VideoDataDialog( list vendors, list models ) - { - - term x11_video_data_dialog = - `VBox( - `HBox( - `ReplacePoint( `id(`replace_point_vendors), - `SelectionBox( `id(`vendors), `opt(`notify), - // Headline for monitor vendor selection box - _("&Vendor"), - vendors - ) - ), - `ReplacePoint( `id(`replace_point_models), - `SelectionBox( `id(`models), `opt(`notify), - // Headline for monitor model selection box - _("M&odel"), - models - ) - ) - ), - `VSpacing(0.2), - `VSquash( - `HBox( - `HWeight( 1, - `Frame( - // Frame title for horizontal frequency input fields - _("Horizontal frequency"), - `HBox( - `HWeight( 35, `TextEntry( `id(`min_hsync ), `opt(`shrinkable), _("&min") ) ), - - // Separator between min and max frequency fields - `HWeight( 10, `Bottom(`Label( _("-") ) ) ), - `HWeight( 35, `TextEntry( `id(`max_hsync ), `opt(`shrinkable), _("m&ax") ) ), - - // Unit for horizontal frequency - `HWeight( 17, `Bottom(`Label( _("kHz") ) ) ) - ) - ) - ), - `HSpacing(0.8), - `HWeight( 1, - `Frame( - // Frame title for vertical frequency input fields - _("Vertical frequency"), - `HBox( - `HWeight( 35, `TextEntry( `id(`min_vsync ), `opt(`shrinkable), _("m&in") ) ), - - // Separator between min and max frequency fields - `HWeight( 10, `Bottom(`Label( _("-") ) ) ), - `HWeight( 35, `TextEntry( `id(`max_vsync ), `opt(`shrinkable), _("ma&x") ) ), - - // Unit for horizontal frequency - `HWeight( 17, `Bottom( `Label( _("Hz") ) ) ) - ) - ) - ) - ) - ) - ); - - return x11_video_data_dialog; - }; - - - /** - * Get the `Value property of an arbitrary widget - * @param widget_id ID of the widget, e.g. `resolution - * @return the widget's `Value property - */ - define any GetValue( symbol widget_id ) - { - return UI::QueryWidget(`id( widget_id ), `Value ); - }; - - - /** - * Set the `Value property of an arbitrary widget - * @param widget_id ID of the widget, e.g. `resolution - * @param new_value the new value - */ - define void SetValue( symbol widget_id, - any new_value ) - { - UI::ChangeWidget(`id( widget_id ), `Value, new_value ); - return; - }; - - - /** - * Get help text for video data dialog - * @return string multi line help text in RichText (HTML like) format - */ - define string X11VideoDataDialogHelpText() - { - /* - * Help text (HTML like) for X11 video data dialog - */ - - // help part 1 of 8 - string helptext = _("<p> -Please select your monitor's <b>vendor</b> and <b>model</b>. -</p> -"); - - // help part 2 of 8 - helptext = helptext + _("<p> -If your monitor is not listed here, use <b>VESA</b>. -Most monitors comply with this standard. -</p> -"); - - - // help part 5 of 8 - helptext = helptext + _("<p> -Modify the monitor's frequencies in the respective input -fields below the selection boxes. -Refer to your monitor manual for your monitor's maximum -frequencies. <b><i>Do not exceed</i></b> the values specified there. -Otherwise, there is a serious risk of <b><i>damaging your monitor</i></b>. -</p> -"); - - // help part 6 of 8 - helptext = helptext + _("<p> -The <b>horizontal frequency</b> (in kHz) specifies how many times -per second the monitor can write a horizontal scan line. This is a -hard limit of the monitor, independent of the screen resolution. -</p> -"); - - // help part 7 of 8 - helptext = helptext + _("<p> -The <b>vertical frequency</b> (in Hz) specifies how many times per -second the image on the screen is refreshed. This value depends on the -screen resolution and the monitor's maximum horizontal frequency. -</p> -"); - - // help part 8 of 8 - helptext = helptext + _("<p> -If you experience a constant high frequency beep from your monitor, -you might wish to use slightly lower frequency values than the maximum -specified in your monitor's manual. This usually helps a lot to reduce -the noise. -</p> -"); - - return helptext; - - }; - - - // get the sync values --> string - // - define string GetMinHsync() ``{ return (string)GetValue(`min_hsync ); }; - define string GetMaxHsync() ``{ return (string)GetValue(`max_hsync ); }; - define string GetMinVsync() ``{ return (string)GetValue(`min_vsync ); }; - define string GetMaxVsync() ``{ return (string)GetValue(`max_vsync ); }; - - // set the sync values (every single value) - // - define void SetMinHsync( string new_value ) ``{ SetValue(`min_hsync, new_value ); }; - define void SetMaxHsync( string new_value ) ``{ SetValue(`max_hsync, new_value ); }; - define void SetMinVsync( string new_value ) ``{ SetValue(`min_vsync, new_value ); }; - define void SetMaxVsync( string new_value ) ``{ SetValue(`max_vsync, new_value ); }; - - // set the focus to the input fields - // - define void SetFocusMinHsync() ``{ UI::SetFocus(`id(`min_hsync)); } - define void SetFocusMaxHsync() ``{ UI::SetFocus(`id(`max_hsync)); } - define void SetFocusMinVsync() ``{ UI::SetFocus(`id(`min_vsync)); } - define void SetFocusMaxVsync() ``{ UI::SetFocus(`id(`max_vsync)); } - - // get the current vendor and model --> string - // - define string GetCurrentVendor() ``{ return (string)UI::QueryWidget(`id(`vendors), `CurrentItem); } - define string GetCurrentModel () ``{ return (string)UI::QueryWidget(`id(`models), `CurrentItem); } - - // set the current vendor and model - // - define void SetCurrentVendor( string new_item ) ``{ UI::ChangeWidget(`id(`vendors), `CurrentItem, new_item ); } - define void SetCurrentModel ( string new_item ) ``{ UI::ChangeWidget(`id(`models), `CurrentItem, new_item ); } - - // replace the vendor list - // - define void ReplaceVendors( list new_value ) ``{ - UI::ReplaceWidget( `id( `replace_point_vendors), - `SelectionBox( `id(`vendors), `opt(`notify), - // Headline for monitor vendor selection box - _("Vendor"), - new_value - ) - ); - return; - } - - /** - * Replace the model list - * @return void - */ - define void ReplaceModels( list new_value ) - { - - UI::ReplaceWidget( `id( `replace_point_models), - `SelectionBox( `id( `models), - `opt( `notify ), - // Headline for monitor model selection box - _("Model"), - new_value - ) - ); - return; - } - - // Handle `back button - // - define void SetBackState( boolean new_value ) - { - if ( new_value ) - Wizard::EnableBackButton(); - else - Wizard::DisableBackButton(); - } - - // CAUTION: This no longer works with the new wizard - no way to query that value! - define boolean GetBackState() - { - return (boolean)UI::QueryWidget(`id(`back), `Enabled ); - } - - - - - - /** - * round up a value given as integer or float to the next integer (ceiling). - */ - define integer ceiling( any value ) - { - if ( is( value, integer ) ) return (integer) value; // already integer - - if ( is( value, float ) ) // is float - { - if ( tofloat( tointeger( value ) ) == value ) // is whole-numbered - return( tointeger( value ) ); // return as is - else // not whole-numbered - return( tointeger( value ) + 1 ); // round up - } - else - { - y2error( "ceiling(): parameter error: <%1> (only integer and float allowed)", value ); - return( nil ); - } - } - - - /** - * Round down a value given as integer or float to the prev. integer (floor). - **/ - define integer floor( any value ) - { - if ( is( value, integer ) ) return (integer) value; // already integer - - if ( is( value, float ) ) // is float - { - return( tointeger( value ) ); // round down - } - else - { - y2error( "floor(): parameter error: <%1> (only integer and float allowed)", value ); - return( nil ); - } - } - /* - * Check if the number is in the format [+]<number>[kKmMgGtT] - * @return boolean true or false - */ - define boolean IsNumber( string input ) - { - integer n = 0; - while ( n < size( input ) ) - { - string erg = filterchars( substring( input, n,1 ), "0123456789." ); - - if ( size( erg ) != 1 ) - { - y2milestone("%1", n); - return( false ); - } - - n = n + 1; - } - - return( true ); - }; - - - /** - * Get a list of all monitor models for a specified vendor from the monitor database. - * @return list - */ - define list get_models_for_vendor( string vendor, list<map> monitor_db ) - { - list<map> vendor_monitors = filter( map monitor, monitor_db, ``( - monitor["vendor"]:"" == vendor )); - return toset( maplist( map monitor, vendor_monitors, ``( monitor["model"]:"")) ); - }; - - /** - * Automagically update the frequency values for a specified model. - */ - define void update_frequency_for_model( string vendor, string model) - { - // Get the data record for this monitor - // - map monitor = (map)find( map m, AutoinstX11::all_monitors, - ``(( m["vendor"]:"" == vendor) - && (m["model"]:"" == model)) ); - - - // Set all the input fields according to this monitor's data - // first, assign the value to a float. the monitor data may contain - // integer values, but tostring expects a float. - - float fsyncval = tofloat( monitor["min_hsync"]:0 ); - SetMinHsync (tostring( fsyncval, 1 )); - - fsyncval = tofloat( monitor["max_hsync"]:0 ); - SetMaxHsync (tostring( fsyncval, 1 )); - - fsyncval = tofloat( monitor["min_vsync"]:0 ); - SetMinVsync (tostring( fsyncval, 1 )); - - fsyncval = tofloat( monitor["max_vsync"]:0 ); - SetMaxVsync (tostring( fsyncval, 1 )); - - - return; - } - - /* - * Automagically update the models list for a specified vendor. - * Select default first entry if unknown and update its sync values. - * Honor the special "No X11" entry. - * It is assumed that the given vendor is known i.e. is a member of the given monitor_db. - */ - define void change_vendor( string vendor, list<map> monitor_db ) - { - if ( vendor == "No X11" ) - { - ReplaceModels( [] ); - - SetMinHsync( "" ); - SetMaxHsync( "" ); - SetMinVsync( "" ); - SetMaxVsync( "" ); - - AutoinstX11::current_model = ""; - } - else - { - list models = get_models_for_vendor( vendor, monitor_db ); - ReplaceModels( models ); - - if ( models != [] ) - { - if ( ! contains( models, AutoinstX11::current_model ) ) - AutoinstX11::current_model = models[0]:""; - - SetCurrentModel( AutoinstX11::current_model ); - update_frequency_for_model( vendor, AutoinstX11::current_model ); - } - else - { - SetMinHsync( "" ); - SetMaxHsync( "" ); - SetMinVsync( "" ); - SetMaxVsync( "" ); - - AutoinstX11::current_model = ""; - } - } - return; - } - - /** - * Read the monitor db and get vendors and models lists. - * Optionally extend db with probed monitor. - */ - define void get_vendors_and_models() - { - if ( AutoinstX11::monitor["monitor_vendor"]: "" == "" ) - { - // monitor vendor not known - AutoinstX11::current_vendor = _("unknown vendor"); - AutoinstX11::monitor["monitor_vendor"] = AutoinstX11::current_vendor ; - } - - if ( AutoinstX11::monitor["monitor_device"]:"" == "" ) - { - // monitor model not known - AutoinstX11::current_model = _("unknown model"); - AutoinstX11::monitor["monitor_device"] = AutoinstX11::current_model; - } - } - - /** - * Display current vendor, model and associated values if possible. - * @return void - */ - define void display_models_and_values() - { - if ( contains( AutoinstX11::vendors, AutoinstX11::current_vendor ) ) - { - SetCurrentVendor( AutoinstX11::current_vendor ); - change_vendor( AutoinstX11::current_vendor, AutoinstX11::all_monitors ); - } - else - { - AutoinstX11::current_vendor = (string) AutoinstX11::vendors[0]:""; - SetCurrentVendor( AutoinstX11::current_vendor ); - change_vendor( AutoinstX11::current_vendor, AutoinstX11::all_monitors ); - } - return; - } - - // Parse the given string assuming it is a "model" string containing VESA - // information formatted as e.g. "1024X768@75HZ". The values for width, - // height, and refresh are extracted and assigned to the X11 user_data struct - // along with a constant color depth of 8 bit (VESA) or 16 bit (LCD). - // - define void store_VESA_LCD( string model, boolean is_VESA ) - { - integer currentWidth = 0; - integer currentHeight = 0; - integer currentFrequency = 0; - - - // First find resolution string within model string. - // E.g. "PANORAMIC SUPERWIDE 1024X768@75HZ" --> "1024X768@75HZ" - // - list<string> res_list = splitstring( model, " " ); - - if ( size( res_list ) > 0 ) - { - string resolution = find(string res, res_list, ``( issubstring( res, "@") )); - - // 1. "1024X768@75HZ" --> "1024" and "768@75HZ" - // - list first = splitstring( resolution, "X"); - - if ( size( first ) > 0 ) - { - currentWidth = tointeger( first[0]:"" ); - - // 2. "768@75HZ" --> "768" and "75HZ" - // - list second = splitstring( first[1]: "" , "@" ); - - if ( size( second ) > 0 ) - { - currentHeight = tointeger( second[0]: "" ); - currentFrequency = tointeger( second[1]: "" ); - } - } - } - - // store the new values into the X11 user_data struct - // - AutoinstX11::display = AutoinstX11::display; - return; - } - - - - - /** - * Main Monitor Dialog - * @return symbol - */ - define symbol monitorDialog() - { - AutoinstX11::readMonitorDB(); - - map display = AutoinstX11::display; - integer min_hsync = ceiling( display["min_hsync"]:0 ); - integer max_hsync = floor ( display["max_hsync"]:0 ); - integer min_vsync = ceiling( display["min_vsync"]:0 ); - integer max_vsync = floor ( display["max_vsync"]:0 ); - - get_vendors_and_models(); - - - string help_text = X11VideoDataDialogHelpText(); - - term contents = X11VideoDataDialog( AutoinstX11::vendors, [] ); - - Wizard::SetContents( - _("Configure Monitor"), - contents, - help_text, - true , true); - - display_models_and_values(); - - // Monitor - - string min_hsync_string = ""; - string max_hsync_string = ""; - string min_vsync_string = ""; - string max_vsync_string = ""; - - symbol ret = `none; - repeat { - ret = (symbol) UI::UserInput(); - - if ( ret == `vendors ) - { - string new_vendor = GetCurrentVendor(); - - if ( new_vendor != AutoinstX11::current_vendor ) - { - AutoinstX11::current_vendor = new_vendor; - change_vendor( AutoinstX11::current_vendor, AutoinstX11::all_monitors ); - } - } - else if ( ret == `models ) - { - string new_model = GetCurrentModel(); - - if ( new_model != AutoinstX11::current_model ) - { - AutoinstX11::current_model = new_model; - update_frequency_for_model( AutoinstX11::current_vendor, - AutoinstX11::current_model ); - } - } - else if ( ret == `next ) - { - min_hsync_string = GetMinHsync(); - max_hsync_string = GetMaxHsync(); - min_vsync_string = GetMinVsync(); - max_vsync_string = GetMaxVsync(); - - // Check the content in the input fields. All input must be valid. - // - if ( ! IsNumber( min_hsync_string ) || size( min_hsync_string ) <= 0 ) - { - // A frequency value is not of type numerical. User must correct this. - Popup::Message(_("The minimum horizontal frequency is not a numerical value. -Try again. -")); - SetFocusMinHsync(); - ret = `again; - continue; - } - - if ( ! IsNumber( max_hsync_string ) || size( max_hsync_string ) <= 0 ) - { - // A frequency value is not of type numerical. User must correct this. - Popup::Message(_("Maximum horizontal frequency is not a numerical value.\nPlease try again.")); - SetFocusMaxHsync(); - ret = `again; - continue; - } - - if ( ! IsNumber( min_vsync_string ) || size( min_vsync_string ) <= 0 ) - { - // A frequency value is not of type numerical. User must correct this. - Popup::Message(_("The minimum vertical frequency is not a numerical value. -Try again. -")); - SetFocusMinVsync(); - ret = `again; - continue; - } - - if ( ! IsNumber( max_vsync_string ) || size( max_vsync_string ) <= 0 ) - { - // A frequency value is not of type numerical. User must correct this. - Popup::Message(_("Maximum vertical frequency is not a numerical value.\nPlease try again.")); - SetFocusMaxVsync(); - ret = `again; - continue; - } - - min_hsync = ceiling( tofloat( min_hsync_string ) ); - max_hsync = floor ( tofloat( max_hsync_string ) ); - min_vsync = ceiling( tofloat( min_vsync_string ) ); - max_vsync = floor ( tofloat( max_vsync_string ) ); - - AutoinstX11::display["min_hsync"] = min_hsync ; - AutoinstX11::display["max_hsync"] = max_hsync ; - AutoinstX11::display["max_vsync"] = max_vsync ; - AutoinstX11::display["min_vsync"] = min_vsync ; - - if ( AutoinstX11::current_vendor == " VESA" ) - { - store_VESA_LCD( AutoinstX11::current_model, true ); - - } - else if ( AutoinstX11::current_vendor == " LCD" ) - { - store_VESA_LCD( AutoinstX11::current_model, false ); - - } - } - } until ( ret == `next || ret == `back || ret == `abort || ret == `cancel ); - - return ret; - } - - - - /** - * Sequencer - */ - define symbol X11AutoSequence () ``{ - - map dialogs = $[ - "x11" : ``( x11Options() ), - "monitor" : ``( monitorDialog() ) - - ]; - - map sequence = $[ - "ws_start" : "x11", - "x11" : - $[ - `abort : `abort, - `next : "monitor" - ], - "monitor": - $[ - `abort : `abort, - `next : `next - ] - ]; - - Wizard::CreateDialog (); - Wizard::SetDesktopIcon("x11"); - symbol ret = WizardSequencer (dialogs, sequence); - UI::CloseDialog (); - - return ret; - } +return `auto; } Modified: trunk/x11/src/autoyast/modules/AutoinstX11.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/autoyast/modules/Autoinst... ============================================================================== --- trunk/x11/src/autoyast/modules/AutoinstX11.ycp (original) +++ trunk/x11/src/autoyast/modules/AutoinstX11.ycp Thu Jul 30 21:46:55 2009 @@ -38,15 +38,16 @@ global boolean autoyastX11Allowed () { // on Itanium during installation/update/repair/live_installation no X11 cloning should be performed (bnc#439612) (bnc#449147) - if ( Arch::ia64() && ! contains(["installation", "update", "repair", "live_installation"], Mode::mode()) ) - { - y2warning("On Itanium (ia64) during installation no cloning of the X11 configuration is supported."); - y2warning("X11 will return an empty configuration now."); - y2warning("You can however create a clone config including X11 within the running system."); - return false; - } +// if ( Arch::ia64() && ! contains(["installation", "update", "repair", "live_installation"], Mode::mode()) ) +// { +// y2warning("On Itanium (ia64) during installation no cloning of the X11 configuration is supported."); +// y2warning("X11 will return an empty configuration now."); +// y2warning("You can however create a clone config including X11 within the running system."); +// return false; +// } - return true; +// return true; + return false; } @@ -54,25 +55,27 @@ // SetModified //--------------------------------------- global define void SetModified () { - modified = true; +// modified = true; + modified = false; } //======================================= // GetModified //--------------------------------------- global define boolean GetModified () { - return modified; +// return modified; + return false; } //======================================= // Import //--------------------------------------- global define boolean Import (map settings) { - x11 = settings; - monitor = x11["monitor"]:$[]; - display = monitor["display"]:$[]; - current_vendor = monitor["monitor_vendor"]:"" ; - current_model = monitor["monitor_device"]:"" ; +// x11 = settings; +// monitor = x11["monitor"]:$[]; +// display = monitor["display"]:$[]; +// current_vendor = monitor["monitor_vendor"]:"" ; +// current_model = monitor["monitor_device"]:"" ; return true; } @@ -80,102 +83,105 @@ // Export //--------------------------------------- global define map Export () { - if ( ! autoyastX11Allowed() ) { return $[]; } - - monitor["display"] = display; - monitor["monitor_device"] = current_model; - monitor["monitor_vendor"] = current_vendor; - x11["monitor"] = monitor; - return x11; +// if ( ! autoyastX11Allowed() ) { return $[]; } +// +// monitor["display"] = display; +// monitor["monitor_device"] = current_model; +// monitor["monitor_vendor"] = current_vendor; +// x11["monitor"] = monitor; +// return x11; + return $[]; } //======================================= // Summary //--------------------------------------- global define string Summary() { - string summary = ""; - map m = x11["monitor"]:$[]; - map d = m["display"]:$[]; - string my_current_vendor = m["monitor_vendor"]:""; - string my_current_model = m["monitor_device"]:""; - string my_monitor = Summary::NotConfigured(); - if (size(my_current_vendor) > 0) { - my_monitor = sformat("%1 %2", my_current_vendor, my_current_model); - } - string horizontal = sformat("%1 - %2",d["min_hsync"]:0 , d["max_hsync"]:0); - string vertical = sformat("%1 - %2", d["min_vsync"]:0 , d["max_vsync"]:0); - string nc = Summary::NotConfigured (); - string depth = sformat ("%1", - (x11["color_depth"]:-1 != -1) ? x11["color_depth"]:-1 : nc - ); - summary = Summary::AddHeader (summary, _("Enable 3D Support If Possible")); - summary = Summary::AddLine (summary, - (x11["enable_3d"]:false) ? _("Yes") : nc - ); - summary = Summary::AddHeader (summary, _("Enable Xgl if possible")); - summary = Summary::AddLine (summary, ((boolean)x11["enable_xgl"]:false) ? _("Yes") : nc); - summary = Summary::AddHeader (summary, _("Color Depth")); - summary = Summary::AddLine (summary, depth ); - summary = Summary::AddHeader (summary, _("Resolution")); - summary = Summary::AddLine (summary, - (x11["resolution"]:"" != "") ? x11["resolution"]:"" : nc - ); - summary = Summary::AddHeader (summary, _("Display Manager")); - summary = Summary::AddLine (summary, - (x11["display_manager"]:"" != "") ? x11["display_manager"]:"" : nc - ); - summary = Summary::AddHeader (summary, _("Window Manager")); - summary = Summary::AddLine (summary, - (x11["window_manager"]:"" != "") ? x11["window_manager"]:"" : nc - ); - summary = Summary::AddHeader (summary, _("Monitor")); - summary = Summary::AddLine (summary, my_monitor); - summary = Summary::AddHeader (summary, _("Horizontal frequency")); - summary = Summary::AddLine (summary, horizontal); - summary = Summary::AddHeader (summary, _("Vertical frequency")); - summary = Summary::AddLine (summary, vertical); - - return summary; +// string summary = ""; +// map m = x11["monitor"]:$[]; +// map d = m["display"]:$[]; +// string my_current_vendor = m["monitor_vendor"]:""; +// string my_current_model = m["monitor_device"]:""; +// string my_monitor = Summary::NotConfigured(); +// if (size(my_current_vendor) > 0) { +// my_monitor = sformat("%1 %2", my_current_vendor, my_current_model); +// } +// string horizontal = sformat("%1 - %2",d["min_hsync"]:0 , d["max_hsync"]:0); +// string vertical = sformat("%1 - %2", d["min_vsync"]:0 , d["max_vsync"]:0); +// string nc = Summary::NotConfigured (); +// string depth = sformat ("%1", +// (x11["color_depth"]:-1 != -1) ? x11["color_depth"]:-1 : nc +// ); +// summary = Summary::AddHeader (summary, _("Enable 3D Support If Possible")); +// summary = Summary::AddLine (summary, +// (x11["enable_3d"]:false) ? _("Yes") : nc +// ); +// summary = Summary::AddHeader (summary, _("Enable Xgl if possible")); +// summary = Summary::AddLine (summary, ((boolean)x11["enable_xgl"]:false) ? _("Yes") : nc); +// summary = Summary::AddHeader (summary, _("Color Depth")); +// summary = Summary::AddLine (summary, depth ); +// summary = Summary::AddHeader (summary, _("Resolution")); +// summary = Summary::AddLine (summary, +// (x11["resolution"]:"" != "") ? x11["resolution"]:"" : nc +// ); +// summary = Summary::AddHeader (summary, _("Display Manager")); +// summary = Summary::AddLine (summary, +// (x11["display_manager"]:"" != "") ? x11["display_manager"]:"" : nc +// ); +// summary = Summary::AddHeader (summary, _("Window Manager")); +// summary = Summary::AddLine (summary, +// (x11["window_manager"]:"" != "") ? x11["window_manager"]:"" : nc +// ); +// summary = Summary::AddHeader (summary, _("Monitor")); +// summary = Summary::AddLine (summary, my_monitor); +// summary = Summary::AddHeader (summary, _("Horizontal frequency")); +// summary = Summary::AddLine (summary, horizontal); +// summary = Summary::AddHeader (summary, _("Vertical frequency")); +// summary = Summary::AddLine (summary, vertical); +// +// return summary; + return ""; } //======================================= // readMonitorDB //--------------------------------------- global define void readMonitorDB() { - string static_monitors = Directory::datadir + "/monitors.ycp"; - all_monitors = (list<map>)SCR::Read( .target.ycp, [ static_monitors, [] ]); - vendors = toset( - maplist( map monitor, all_monitors,``( monitor["vendor"]:"" )) - ); +// string static_monitors = Directory::datadir + "/monitors.ycp"; +// all_monitors = (list<map>)SCR::Read( .target.ycp, [ static_monitors, [] ]); +// vendors = toset( +// maplist( map monitor, all_monitors,``( monitor["vendor"]:"" )) +// ); + vendors = []; } //======================================= // Read //--------------------------------------- global define boolean Read() { - if ( ! autoyastX11Allowed() ) { return true; } - - x11["display_manager"] = (string) eval (SCR::Read( - .sysconfig.displaymanager.DISPLAYMANAGER - )); - x11["window_manager"] = (string) eval (SCR::Read( - .sysconfig.windowmanager.DEFAULT_WM - )); - x11["enable_3d"] = false; - if (! (boolean)XLib::isInitialized()) { - y2milestone ("X11-Auto: Loading library cache..."); - XLib::loadApplication(); - } - current_vendor = (string) XLib::getMonitorVendor(); - current_model = (string) XLib::getMonitorModel(); +// if ( ! autoyastX11Allowed() ) { return true; } +// +// x11["display_manager"] = (string) eval (SCR::Read( +// .sysconfig.displaymanager.DISPLAYMANAGER +// )); +// x11["window_manager"] = (string) eval (SCR::Read( +// .sysconfig.windowmanager.DEFAULT_WM +// )); +// x11["enable_3d"] = false; +// if (! (boolean)XLib::isInitialized()) { +// y2milestone ("X11-Auto: Loading library cache..."); +// XLib::loadApplication(); +// } +// current_vendor = (string) XLib::getMonitorVendor(); +// current_model = (string) XLib::getMonitorModel(); // store this value with type integer in the map so it gets exported // correctly to the autoyast profile (bnc#418648). - x11["color_depth"] = tointeger(XLib::getActiveColorDepth()); - x11["resolution"] = (string) XLib::getActiveResolutionString(); - display["min_hsync"] = tointeger(XLib::getHsyncMin()); - display["max_hsync"] = tointeger(XLib::getHsyncMax()); - display["min_vsync"] = tointeger(XLib::getVsyncMin()); - display["max_vsync"] = tointeger(XLib::getVsyncMax()); +// x11["color_depth"] = tointeger(XLib::getActiveColorDepth()); +// x11["resolution"] = (string) XLib::getActiveResolutionString(); +// display["min_hsync"] = tointeger(XLib::getHsyncMin()); +// display["max_hsync"] = tointeger(XLib::getHsyncMax()); +// display["min_vsync"] = tointeger(XLib::getVsyncMin()); +// display["max_vsync"] = tointeger(XLib::getVsyncMax()); return true; } @@ -183,75 +189,76 @@ // Write //--------------------------------------- global define boolean Write() { - if (! (boolean)XLib::isInitialized()) { - y2milestone ("X11-Auto: Loading library cache..."); - XLib::loadApplication(); - } - string displayManager = x11["display_manager"]:""; - string windowManager = x11["window_manager"]:""; - if (size(displayManager) > 0) { - y2milestone("X11-Auto: setup display manager <%1>",displayManager); - SCR::Write (.sysconfig.displaymanager.DISPLAYMANAGER, displayManager); - SCR::Write (.sysconfig.displaymanager, nil); - } - if (size(windowManager) > 0) { - y2milestone("X11-Auto: setup window manager <%1>",windowManager); - SCR::Write (.sysconfig.windowmanager.DEFAULT_WM, windowManager); - SCR::Write (.sysconfig.windowmanager, nil); - } - integer hstart = tointeger(display["min_hsync"]:30); - integer hstop = tointeger(display["max_hsync"]:60); - integer vstart = tointeger(display["min_vsync"]:60); - integer vstop = tointeger(display["max_vsync"]:75); - y2milestone("X11-Auto: setup monitor <%1:%2>",current_vendor,current_model); - XLib::setMonitorCDB ( [current_vendor,current_model] ); - XLib::setHsyncRange (hstart,hstop); - XLib::setVsyncRange (vstart,vstop); - - string resolution = x11["resolution"]:"800x600 (SVGA)"; - y2milestone("X11-Auto: setup resolution <%1>",resolution); - XLib::setResolution ( resolution ); - - // convert value to integer (bnc#307967) - // made obsolete by fix for (bnc#418648), cast the value to be sure it is integer - integer colors = (integer) x11["color_depth"]:16; - y2milestone("X11-Auto: setup color depth <%1>",colors); - XLib::setDefaultColorDepth ( tostring(colors) ); - - boolean enable3D = x11["enable_3d"]:false; - boolean enableXGL = x11["enable_xgl"]:false; - y2milestone("X11-Auto: setup 3D <%1>",enable3D); - y2milestone("X11-Auto: setup XGL <%1>", enableXGL); - boolean has3D = XLib::hasOpenGLFeatures(); - if ((enable3D) && (has3D)) { - XLib::activate3D(); - if ( enableXGL ) - { - // setup Xgl as X server - SCR::Write (.sysconfig.displaymanager.DISPLAYMANAGER_XSERVER, "Xgl"); - // empty custom options string will not overwrite the default with empty options - // only one (or more) space character(s) will - if ( x11["xgl_custom_options"]:"" != "" ) - { - SCR::Write (.sysconfig.displaymanager.DISPLAYMANAGER_XGL_OPTS, x11["xgl_custom_options"]:"" ); - } - } - - } else { - XLib::deactivate3D(); - } - // set the PreferredMode (bnc#402581) - string colorDepth = tostring(colors); - y2milestone("Trying to set X11 PreferredMode to: %1 @ %2", resolution, colorDepth); - if ( XLib::setPreferredMode(resolution, colorDepth) ) - { - y2milestone("Sucessfully set the PreferredMode for X11"); - } - else - { - y2error("Failed to set the PreferredMode for X11."); - } - boolean status = XLib::writeConfiguration(); - return status; +// if (! (boolean)XLib::isInitialized()) { +// y2milestone ("X11-Auto: Loading library cache..."); +// XLib::loadApplication(); +// } +// string displayManager = x11["display_manager"]:""; +// string windowManager = x11["window_manager"]:""; +// if (size(displayManager) > 0) { +// y2milestone("X11-Auto: setup display manager <%1>",displayManager); +// SCR::Write (.sysconfig.displaymanager.DISPLAYMANAGER, displayManager); +// SCR::Write (.sysconfig.displaymanager, nil); +// } +// if (size(windowManager) > 0) { +// y2milestone("X11-Auto: setup window manager <%1>",windowManager); +// SCR::Write (.sysconfig.windowmanager.DEFAULT_WM, windowManager); +// SCR::Write (.sysconfig.windowmanager, nil); +// } +// integer hstart = tointeger(display["min_hsync"]:30); +// integer hstop = tointeger(display["max_hsync"]:60); +// integer vstart = tointeger(display["min_vsync"]:60); +// integer vstop = tointeger(display["max_vsync"]:75); +// y2milestone("X11-Auto: setup monitor <%1:%2>",current_vendor,current_model); +// XLib::setMonitorCDB ( [current_vendor,current_model] ); +// XLib::setHsyncRange (hstart,hstop); +// XLib::setVsyncRange (vstart,vstop); +// +// string resolution = x11["resolution"]:"800x600 (SVGA)"; +// y2milestone("X11-Auto: setup resolution <%1>",resolution); +// XLib::setResolution ( resolution ); +// +// // convert value to integer (bnc#307967) +// // made obsolete by fix for (bnc#418648), cast the value to be sure it is integer +// integer colors = (integer) x11["color_depth"]:16; +// y2milestone("X11-Auto: setup color depth <%1>",colors); +// XLib::setDefaultColorDepth ( tostring(colors) ); +// +// boolean enable3D = x11["enable_3d"]:false; +// boolean enableXGL = x11["enable_xgl"]:false; +// y2milestone("X11-Auto: setup 3D <%1>",enable3D); +// y2milestone("X11-Auto: setup XGL <%1>", enableXGL); +// boolean has3D = XLib::hasOpenGLFeatures(); +// if ((enable3D) && (has3D)) { +// XLib::activate3D(); +// if ( enableXGL ) +// { +// // setup Xgl as X server +// SCR::Write (.sysconfig.displaymanager.DISPLAYMANAGER_XSERVER, "Xgl"); +// // empty custom options string will not overwrite the default with empty options +// // only one (or more) space character(s) will +// if ( x11["xgl_custom_options"]:"" != "" ) +// { +// SCR::Write (.sysconfig.displaymanager.DISPLAYMANAGER_XGL_OPTS, x11["xgl_custom_options"]:"" ); +// } +// } +// +// } else { +// XLib::deactivate3D(); +// } +// // set the PreferredMode (bnc#402581) +// string colorDepth = tostring(colors); +// y2milestone("Trying to set X11 PreferredMode to: %1 @ %2", resolution, colorDepth); +// if ( XLib::setPreferredMode(resolution, colorDepth) ) +// { +// y2milestone("Sucessfully set the PreferredMode for X11"); +// } +// else +// { +// y2error("Failed to set the PreferredMode for X11."); +// } +// boolean status = XLib::writeConfiguration(); +// return status; + return true; } } // end Modified: trunk/x11/src/autoyast/modules/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/autoyast/modules/Makefile... ============================================================================== --- trunk/x11/src/autoyast/modules/Makefile.am (original) +++ trunk/x11/src/autoyast/modules/Makefile.am Thu Jul 30 21:46:55 2009 @@ -3,8 +3,9 @@ YCPCFLAGS = -M ../../ -I ../../ module_DATA = AutoinstX11.ycp -ydata_DATA = monitors.ycp +#ydata_DATA = monitors.ycp -EXTRA_DIST = $(module_DATA) $(ydata_DATA) +#EXTRA_DIST = $(module_DATA) $(ydata_DATA) +EXTRA_DIST = $(module_DATA) include $(top_srcdir)/Makefile.am.common Modified: trunk/x11/src/autoyast/proposal/x11_auto.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/autoyast/proposal/x11_aut... ============================================================================== --- trunk/x11/src/autoyast/proposal/x11_auto.ycp (original) +++ trunk/x11/src/autoyast/proposal/x11_auto.ycp Thu Jul 30 21:46:55 2009 @@ -24,110 +24,13 @@ { textdomain "x11"; -import "AutoinstX11"; +// import "AutoinstX11"; -include "x11/autoDialog.ycp"; +// include "x11/autoDialog.ycp"; -y2milestone("X11 AutoInstall mode activated..."); +//y2milestone("X11 AutoInstall mode activated..."); -any ret = nil; -string func = ""; -map param = $[]; - -//================================= -// Check arguments -//--------------------------------- -if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) -{ - func = (string)WFM::Args(0); - if(size(WFM::Args()) > 1 && is(WFM::Args(1), map)) - { - param = (map)WFM::Args(1); - } -} -y2debug("func=%1", func); -y2debug("param=%1", param); - - -//================================= -// Import configuration -//--------------------------------- -if (func == "Import") { - ret = AutoinstX11::Import(param); -} - -//================================= -// Create a summary -//--------------------------------- -else if (func == "Summary") { - ret = AutoinstX11::Summary(); -} - -//================================= -// Read configuration of running system -//--------------------------------- -else if (func == "Read") { - ret = AutoinstX11::Read(); -} -//================================= -// Change configuration -//--------------------------------- -else if (func == "Change") { - ret = X11AutoSequence(); -} -//================================= -// true if configuration has changed -//--------------------------------- -else if (func == "GetModified") { - ret = AutoinstX11::GetModified(); -} -//================================= -// Set configuration as modified -//--------------------------------- -else if (func == "SetModified") { - AutoinstX11::SetModified(); -} - -//================================= -// Reset configuration -//--------------------------------- -else if (func == "Reset") { - AutoinstX11::Import($[]); - ret = $[]; -} - -//================================= -// Return actual state -//--------------------------------- -else if (func == "Export") { - ret = AutoinstX11::Export(); -} - -//================================= -// Return list of additional needed packages -//--------------------------------- -else if (func == "Packages") { - ret = $[]; -} - -//================================= -// Write given settings -//--------------------------------- -else if (func == "Write") { - ret = AutoinstX11::Write(); -} - -//================================= -// Unknown function -//--------------------------------- -else { - y2error("Unknown function: %1", func); - ret = false; -} - -y2debug("ret=%1", ret); -y2milestone("X11 AutoInstall mode done..."); - -return ret; +y2error("yast-x11 started in AutoYaST mode. This should not happen as X will be configured automatically. Exiting now."); +return `auto; } Modified: trunk/x11/src/config/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/config/Makefile.am?rev=58... ============================================================================== --- trunk/x11/src/config/Makefile.am (original) +++ trunk/x11/src/config/Makefile.am Thu Jul 30 21:46:55 2009 @@ -3,8 +3,8 @@ # # $Id$ # -desktop_DATA = x11.desktop +##desktop_DATA = x11.desktop -EXTRA_DIST = $(desktop_DATA) +##EXTRA_DIST = $(desktop_DATA) -include $(top_srcdir)/Makefile.am.common +##include $(top_srcdir)/Makefile.am.common Modified: trunk/x11/src/dialog/x11Dialog.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/dialog/x11Dialog.ycp?rev=... ============================================================================== --- trunk/x11/src/dialog/x11Dialog.ycp (original) +++ trunk/x11/src/dialog/x11Dialog.ycp Thu Jul 30 21:46:55 2009 @@ -26,23 +26,24 @@ //================================ // Imports... //-------------------------------- +/* import "XMessages"; import "Label"; import "Popup"; - +*/ //================================ // Popups //-------------------------------- define void infoPopup () ``{ - Popup::Message(XMessages::selectLink); + integer i = 0; } define void warnNoteBookPopup () ``{ - Popup::Message(XMessages::warnNoteBook); + integer i = 0; } define void warnInvalidColorResolution () ``{ - Popup::Message(XMessages::warnInvalidColorResolution); + integer i = 0; } //================================ @@ -51,61 +52,7 @@ define string setupColors ( string currentRes, string currentDepth ) { // rewritten due to consistency with setupDisplaySize - y2milestone("Called setupColors with resolution(%1) and colorDepth(%2)", currentRes, currentDepth); - string topic = XMessages::colorDepth; - UI::OpenDialog( `MarginBox( 0.5, 0.5, - `VBox( - `Heading(XMessages::displaySettings), - `HBox(`ComboBox(`id(`depth),`opt(`hstretch), topic, - [ - `item(`id("8"), XMessages::color8bit ), - `item(`id("15"), XMessages::color15bit ), - `item(`id("16"), XMessages::color16bit ), - `item(`id("24"), XMessages::color24bit ), - ] - )), - `VSpacing(0.5), - `HBox ( - `PushButton(`id(`ok),Label::OKButton()), - `PushButton(`id(`cancel),Label::CancelButton()) - ) - ) - )); - - string color = "8"; - if (contains(["8", "15", "16", "24"], currentDepth)) - { color = currentDepth; } - else - { currentDepth = "undef"; } - UI::ChangeWidget(`id(`depth), `Value, color); - - any ret = nil; - - repeat - { - ret = UI::UserInput(); - - color = (string) UI::QueryWidget(`id(`depth), `Value); - - // let the user cancel the dialog with cancel (bnc#440281) - if ( ret == `ok ) - { - if (! XLib::hasValidColorResolutionSetup (color,currentRes)) - { - warnInvalidColorResolution(); - ret = nil; - } - } - - } until ( ret == `ok || ret == `cancel); - - UI::CloseDialog(); - if (ret == `cancel) - { - return currentDepth; - } - - return color; + return "DISABLED"; }; //================================ @@ -114,47 +61,7 @@ define string setupResolutions (list reslist, string currentText, string currentColor) { // rewritten to be consistent with - y2milestone("Called setupResolution with reslist(%1) and resolution(%2) and color(%3).", reslist, currentText, currentColor); - string topic = XMessages::resolution; - UI::OpenDialog( `MarginBox( 0.5, 0.5, - `VBox( - `Heading(XMessages::displaySettings), - `VSpacing(0.5), - `ComboBox(`id(`resitem),topic, reslist), - `VSpacing(0.5), - `HBox ( - `PushButton(`id(`ok),Label::OKButton()), - `PushButton(`id(`cancel),Label::CancelButton()) - ) - ) - )); - - UI::ChangeWidget(`id(`resitem), `Value, currentText); - any ret = nil; - string res = ""; - - repeat - { - ret = UI::UserInput(); - - res = (string) UI::QueryWidget(`id(`resitem), `Value); - - // let the user cancel the dialog with cancel (bnc#440281) - if ( ret == `ok ) - { - if (! XLib::hasValidColorResolutionSetup(currentColor, res)) - { - warnInvalidColorResolution(); - ret = nil; - } - } - - } until (ret == `ok || ret == `cancel); - - UI::CloseDialog(); - if (ret == `cancel) { return currentText; } - return res; - + return "DISABLED"; }; //================================ @@ -162,107 +69,9 @@ //-------------------------------- define list<string> setupDisplaySize (string currentTraversal, string currentRatio) { - // function rewritten because of (bnc#331664) and (bnc#399411) - y2milestone("Called setupDisplaySize with traversal(%1) and ratio(%2)", currentTraversal, currentRatio); - string topic1 = XMessages::selectDisplayTraversal; - string topic2 = XMessages::selectDisplayRatio; - // offer some common display settings - list<string> traversallist = [ "32.0", "31.5", "30.0", "26.0", "24.0", "23.0", - "22.2", "21.3", "21.1", "20.0", "19.0", "18.1", - "17.0", "15.4", "15.0", "14.1", "13.3", "12.2", "10.0" ]; - list<string> ratiolist = [ "4/3", "5/4", "16/9", "16/10" ]; - - string traversal = currentTraversal; - string ratio = currentRatio; - string traversalCheck = ""; - string ratioCheck = ""; - - // merge calculated values into the predefined lists - traversallist = (list<string>) sort(union(traversallist, [traversal])); - ratiolist = (list<string>) sort(union(ratiolist, [ratio])); - - UI::OpenDialog(`MarginBox(0.5, 0.5, - `VBox( - `Heading(_("Display Settings")), - `VSpacing(0.5), - `HBox( - `HSpacing(`opt(`hstretch), 0.5), - `VBox( - `Left( `ComboBox(`id(`traversal), `opt(`notify, `editable), topic1, traversallist)), - `Left( `ComboBox(`id(`ratio), `opt(`notify, `editable), topic2, ratiolist)) - ), - `HSpacing(`opt(`hstretch), 0.5) - ), - `VSpacing(0.5), - `HBox ( - `PushButton(`id(`ok),Label::OKButton()), - `PushButton(`id(`cancel),Label::CancelButton()) - ) - ) - )); - - UI::ChangeWidget(`id(`traversal), `ValidChars, "1234567890."); - UI::ChangeWidget(`id(`ratio), `ValidChars, "1234567890/"); - - UI::ChangeWidget(`id(`traversal), `Value, traversal); - UI::ChangeWidget(`id(`ratio), `Value, ratio); - - - any ret = nil; - repeat - { - // wait for event from user - ret = UI::UserInput(); - - traversal = (string) UI::QueryWidget(`id(`traversal), `Value); - ratio = (string) UI::QueryWidget(`id(`ratio), `Value); - - traversalCheck = regexpsub(traversal, "([1-9]+[0-9]*)(\.[0-9]?)?", "\\1\\2"); - if (traversalCheck == nil) { traversal = ""; traversalCheck = ""; } - if (traversalCheck != traversal) - { - traversal = traversalCheck; - UI::ChangeWidget(`id(`traversal), `Value, traversal); - } - - // here for ratio just sanity check - ratioCheck = regexpsub(ratio, "([1-9]+[0-9]*)(\/([1-9]+[0-9]*)?)?", "\\1\\2"); - if (ratioCheck == nil) { ratio = ""; ratioCheck = ""; } - if (ratioCheck != ratio) - { - ratio = ratioCheck; - UI::ChangeWidget(`id(`ratio), `Value, ratio); - } - - if (ret == `ok) - { - string ratioOrig = ratio; - ratio = regexpsub(ratio, "([1-9]+[0-9]*)\/([1-9]+[0-9]*)", "\\1\/\\2"); - if (ratio != ratioOrig || ratioOrig == "" || ratio == nil) - { - Popup::Message(_("The value for the display ratio is invalid, please correct.")); - ret = nil; - } - - if (traversal == "" || traversal == nil) - { - Popup::Message(_("The value for the display traversal is invalid, please correct.")); - ret = nil; - } - } - - } until (ret == `ok || ret == `cancel); - - - list<string> result = [traversal, ratio]; - if (ret == `cancel) - { - result = [currentTraversal, currentRatio]; - } - - UI::CloseDialog(); - return result; + list<string> l = []; + return l; }; //================================ @@ -270,64 +79,8 @@ //-------------------------------- define list setupMonitor ( map<string,list> data, string currentVendor, string currentModel ) { - any ret = nil; - list<string> result = []; - list<string> vendorList = []; - list modelList = []; - - vendorList = maplist( string Dvendor, list Dmodel, data, { return Dvendor; }); - - UI::OpenDialog(`MarginBox( 0.5, 0.5, - `VBox( - `Left (`Label(XMessages::selectMonitor)), - `MinSize( 75, 15, `HBox ( - `SelectionBox(`id(`vendor),`opt(`notify,`immediate), XMessages::Vendor,vendorList), - `SelectionBox(`id(`model) ,`opt(`notify,`immediate), XMessages::Model, []) - )), - `VSpacing(0.5), - `HBox ( - `PushButton(`id(`ok),Label::OKButton()), - `PushButton(`id(`cancel),Label::CancelButton()) - ) - ) - )); - - string vendor = currentVendor; - string model = currentModel; - - modelList = sort (data[vendor]:[]); - UI::ChangeWidget(`id(`vendor), `CurrentItem, nil); - UI::ChangeWidget(`id(`model), `CurrentItem, nil); - - if ( modelList != [] && modelList != nil) - { - UI::ChangeWidget(`id(`vendor), `CurrentItem, vendor); - UI::ChangeWidget(`id(`model) , `Items, modelList); - UI::ChangeWidget(`id(`model), `CurrentItem, nil); - - if (contains(modelList, model)) - UI::ChangeWidget(`id(`model) , `CurrentItem, model); - } - - repeat { - ret = UI::UserInput(); - if (ret == `vendor) { - vendor = (string) UI::QueryWidget(`id(`vendor), `CurrentItem); - list modelList = sort (data[vendor]:[]); - UI::ChangeWidget(`id(`model ), `Items, modelList ); - UI::ChangeWidget(`id(`model), `CurrentItem, nil); - } - if (ret == `model) { - model = (string) UI::QueryWidget(`id(`model), `CurrentItem); - } - if (ret == `cancel) { - UI::CloseDialog(); - return [currentVendor, currentModel]; - } - } until ( ret == `ok ); - UI::CloseDialog(); - return [vendor, model]; +return []; }; @@ -337,70 +90,8 @@ //-------------------------------- define list<string> setupTablet ( map<string,list> data, string currentVendor, string currentModel ) { - y2debug("Called setupTablet with data(%1)", data); - y2milestone("Called setupTablet with vendor(%1) and model(%2)", currentVendor, currentModel); - any ret = nil; - list<string> result = []; - list<string> vendorList = []; - list modelList = []; - - vendorList = maplist( string Dvendor, list Dmodel, data, { return Dvendor; }); - - UI::OpenDialog(`MarginBox( 0.5, 0.5, - `VBox( - `Left (`Label(XMessages::selectTablet)), - `MinSize( 75, 15, `HBox ( - `SelectionBox(`id(`vendor),`opt(`notify,`immediate), XMessages::Vendor, vendorList), - `SelectionBox(`id(`model) ,`opt(`notify,`immediate), XMessages::Model, []) - )), - `VSpacing(0.5), - `HBox ( - `PushButton(`id(`ok),Label::OKButton()), - `PushButton(`id(`cancel),Label::CancelButton()) - ) - ) - )); - - string vendor = currentVendor; - string model = currentModel; - - modelList = sort (data[vendor]:[]); - UI::ChangeWidget(`id(`vendor), `CurrentItem, nil); - UI::ChangeWidget(`id(`model), `CurrentItem, nil); - - if ( modelList != [] && modelList != nil) - { - UI::ChangeWidget(`id(`vendor), `CurrentItem, vendor); - UI::ChangeWidget(`id(`model) , `Items, modelList); - UI::ChangeWidget(`id(`model), `CurrentItem, nil); - - if (contains(modelList, model)) - UI::ChangeWidget(`id(`model) , `CurrentItem, model); - } - - repeat - { - ret = UI::UserInput(); - if (ret == `vendor) - { - vendor = (string) UI::QueryWidget(`id(`vendor), `CurrentItem); - modelList = sort (data[vendor]:[]); - UI::ChangeWidget(`id(`model), `Items, modelList ); - UI::ChangeWidget(`id(`model), `CurrentItem, nil); - } - if (ret == `model) - { - model = (string) UI::QueryWidget(`id(`model), `CurrentItem); - } - if (ret == `cancel) - { - UI::CloseDialog(); - return [currentVendor, currentModel]; - } - } until ( ret == `ok ); - - UI::CloseDialog(); - return [vendor, model]; + list<string> l = []; + return l; } Modified: trunk/x11/src/proposal/x11_proposal.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/proposal/x11_proposal.ycp... ============================================================================== --- trunk/x11/src/proposal/x11_proposal.ycp (original) +++ trunk/x11/src/proposal/x11_proposal.ycp Thu Jul 30 21:46:55 2009 @@ -24,6 +24,7 @@ { textdomain "x11"; +/* import "Report"; import "Installation"; import "Arch"; @@ -32,427 +33,12 @@ import "XLib"; import "Package"; import "Popup"; +*/ -include "x11/x11Dialog.ycp"; +// include "x11/x11Dialog.ycp"; -//=================================================== -// Initialize proposal parameters -//--------------------------------------------------- -string func = (string) WFM::Args(0); -map param = (map) WFM::Args(1); -map ret = $[]; +y2error("X11 proposal was started. This should not happen as X will be configured automatically. Exiting now."); -//========================================== -// Check for graphics device // (bnc#431522) -//------------------------------------------ -if ( (integer)SCR::Execute(.target.bash, "/sbin/lspci -n | cut -f 2 -d \" \" | grep -q \"0300\"") == 0 ) -{ - y2milestone("Detected a graphics device: A PCI device exists with ClassID 0300."); - y2milestone("X11 configuration will be performed."); -} -else -{ - y2milestone("No PCI device exists with ClassID 0300."); - y2milestone("Now checking for a framebuffer device."); - - if ( (integer)SCR::Execute(.target.bash, "[ -f /proc/fb ]") == 0 ) - { - y2milestone("Found a framebuffer device. X11 configuration will be perfomed."); - } - else - { - y2error("Neither a PCI device with ClassID 0300 nor a framebuffer device was found."); - y2error("X11 configuration will not be performed now."); - - // prevent xserver starts (eg. via vnc) on machines without a graphics device (bnc#466352) - y2warning("No graphics device was found, thus setting DISPLAYMANAGER_STARTS_XSERVER to _no_ in /etc/sysconfig/displaymanager."); - if ( SCR::Write(.sysconfig.displaymanager.DISPLAYMANAGER_STARTS_XSERVER, "no") ) - { - y2milestone("Successfully set DISPLAYMANAGER_STARTS_XSERVER to _no_."); - } - else - { - y2error("Setting DISPLAYMANAGER_STARTS_XSERVER to _no_ failed. VNC logins to this machine may fail."); - } - return $[]; - } -} -//========================================== -// Check for installed packages... -//------------------------------------------ -if ( - (Arch::x11_setup_needed ()) || - (Installation::x11_setup_needed ()) -) { - list<string> requiredPacs = [ - "xorg-x11", "xorg-x11-server","xorg-x11-server-glx","libusb", - "sax2", "sax2-gui", "sax2-ident", "sax2-tools","sax2-libsax", - "sax2-libsax-perl" - ]; - - // remove unavailable packages - requiredPacs = filter(string pac, requiredPacs, {return Pkg::PkgProperties(pac) != nil;} ); - - y2milestone("required X11 packages: %1", requiredPacs); - - boolean package = Package::InstallAllMsg ( - requiredPacs, XMessages::pacsMissing - ); - y2milestone ("x11 package status is: <%1>",package); - if (! package) { - return $[]; - } -} -//=================================================== -// Handle Arch flag -//--------------------------------------------------- -if ( - (! Arch::x11_setup_needed ()) || - (! Installation::x11_setup_needed ()) || - (! Package::Installed ("sax2-gui")) -) { - if ( func != "Description" ) { - ret = $[ - "rich_text_title" : "", - "menu_title" : "", - "id" : "", - "preformatted_proposal" : "<b> </b>", - "success" : true - ]; - return ret; - } else { - return ret; - } -} -//=================================================== -// Create proposal for installation/configuration... -//--------------------------------------------------- -if ( func == "MakeProposal" ) { - //====================================== - // Initialize library cache - //-------------------------------------- - if (! (boolean)XLib::isInitialized()) { - y2milestone ("Loading library cache..."); - Popup::TimedMessage(XMessages::probeWarning, 15); - XLib::loadApplication(); - } - //====================================== - // Reading library cache data - //-------------------------------------- - y2milestone ("Reading libsax cache data..."); - string resolution = (string) XLib::getActiveResolution(); - string colorDepth = (string) XLib::getActiveColorDepth(); - string cardName = (string) XLib::getCardName(); - string monitorName = (string) XLib::getMonitorName(); - boolean has3D = (boolean) XLib::hasOpenGLFeatures(); - boolean isFbdevBased= (boolean) XLib::isFbdevBased(); - boolean is3DCard = (boolean) XLib::has3DCapabilities(); - boolean isNoteBook = (boolean) XLib::isExternalVGANoteBook(); - boolean isNoteBookHW= (boolean) XLib::isNoteBookHardware(); - boolean extVGAactive= (boolean) XLib::isExternalVGAactive(); - list monitorSize = (list) XLib::getDisplaySize(); - string monitorInch = (string) monitorSize[0]:"undef"; -// integer tabletID = (integer) XLib::getTabletID(); // (bnc#429770) - integer tabletID = 0; // disabled due to (bnc#447622) - - // add more verbose logging - y2milestone("Reading libsax data finished."); - y2milestone("Creating proposal summary with the following data:"); - y2milestone("%1", $[ - "resolution" : resolution, - "colorDepth" : colorDepth, - "cardName" : cardName, - "monitorName" : monitorName, - "has3D" : has3D, - "isFbdevBased" : isFbdevBased, - "is3DCard" : is3DCard, - "isNoteBook" : isNoteBook, - "isNoteBookHW" : isNoteBookHW, - "extVGAactive" : extVGAactive, - "monitorSize" : monitorSize, - "monitorInch" : monitorInch, - "tabletID" : tabletID - ]); - - //====================================== - // Prepare proposal - //-------------------------------------- - string UL = "<ul>"; - string LU = "</ul>"; - string LI = "<li>"; - string IL = "</li>"; - string proposal = ""; - string colorCount = ""; - if (colorDepth == "24") { - colorCount = XMessages::colors16m; - } - if (colorDepth == "16") { - colorCount = XMessages::colors65k; - } - if (colorDepth == "15") { - colorCount = XMessages::colors32k; - } - if (colorDepth == "8") { - colorCount = XMessages::colors256; - } - if (monitorName == "undef") { - monitorName = XMessages::unconfigured; - } - //====================================== - // Create proposal - //-------------------------------------- - proposal = UL; - //====================================== - // Graphics card name... - //-------------------------------------- - proposal = proposal - + LI - + XMessages::graphicsCard + cardName - + IL; - //====================================== - // Monitor name and resolution... - //-------------------------------------- - - // generate a proper string for the display size - string monitorSizeStr = XMessages::unconfigured; - if (monitorInch != "undef") - { - monitorSizeStr = monitorSize[0]:"" + " " + XMessages::Inches + " - " + XMessages::Aspect + " " + monitorSize[1]:"" + ":" + monitorSize[2]:"" ; - } +return `auto; - // open sublist for display settings - proposal = proposal + LI + XMessages::displaySettings - + UL + LI - + XMessages::monitor + " " + monitorName + " (<a href=\"sax-monitor\">" + _("change") +" </a>)" - + IL + LI - + XMessages::Size + " " + monitorSizeStr + " (<a href=\"sax-displaysize\">" + _("change") + "</a>)" - + IL + LI - + XMessages::resolution + " " + resolution + " (<a href=\"sax-resolution\">" + _("change") + "</a>)" - + IL + LI - + XMessages::colorDepth + " " + colorDepth + " bit - " + colorCount + " (<a href=\"sax-colors\">" + _("change") + "</a>)" - + IL ; - // sublist still open here - following items are within "display settings" section - - // 3D acceleration status/availability - if (is3DCard) - { - string status = XMessages::deactivated; - if (has3D) - { - status = XMessages::activated; - } - proposal = proposal + LI - + XMessages::acceleration + " " + status + " (<a href=\"sax-3d\">" + _("change") + "</a>)" - + IL ; - } - - // External VGA on NoteBooks - if (isNoteBook) - { - string status = XMessages::deactivated; - if (extVGAactive) { status = XMessages::activated; } - - proposal = proposal + LI - + XMessages::externalvga + " " + status + " (<a href=\"sax-ext-vga\">" + _("change") + "</a>)" - + IL; - } - else - { - if ((isNoteBookHW) && (! XMessages::popupDone)) - { - XMessages::popupDone = true; - y2milestone ("X11: DualHead Mode not supported with this NoteBook"); - //warnNoteBookPopup(); - } - } - - // close the display settings sublist - proposal = proposal + LU + IL ; - - - //====================================== - // Tablet settings (fate#302888) - //-------------------------------------- - string tabletStatus = XMessages::unconfigured; - if ( tabletID != 0 ) - { - string tabletName = (string) XLib::getTabletModel(); - string tabletVendor= (string) XLib::getTabletVendor(); - - tabletStatus = sformat("%1 - %2", tabletVendor, tabletName); - y2milestone("Found tablet device: %1 (%2)", tabletName, tabletVendor); - - // if no tablet was found no item in the proposal will be shown - proposal = proposal - + LI - + XMessages::Tablet + " " + tabletStatus - // + " (<a href=\"sax-tablet\">" + XMessages::configure + "</a>)" - + IL; - } - //====================================== - // Test your configuration now - //-------------------------------------- - // deactivated due to problems with multiple X-Server instances - //if (! isFbdevBased) { - // proposal = proposal - // + LI - // + "<a href=\"sax-test\">" - // + XMessages::testConfig + "</a>" - // + IL; - //} - //====================================== - // End proposal... - //-------------------------------------- - proposal = proposal + LU; - ret = $[ - "preformatted_proposal" : proposal, - "links" : [ - "sax-monitor", - "sax-resolution", - "sax-displaysize", - "sax-colors", - "sax-3d", - "sax-ext-vga", - "sax-test" - //,"sax-tablet" - ] - ]; - return ret; -} -//=================================================== -// Handle user requests... -//--------------------------------------------------- -else if ( func == "AskUser" ) { - any chosenID = param["chosen_id"]:nil; - if (chosenID == "sax-monitor") { - y2milestone("X11: setup monitor..."); - string vendor = XLib::getMonitorVendor(); - string model = XLib::getMonitorModel(); - map<string,list> cdb = XLib::getMonitorCDB(); - list selectedMonitor = setupMonitor ( cdb,vendor,model ); - y2milestone("X11: setup monitor <%1>",selectedMonitor); - XLib::setMonitorCDB ( (list<string>)selectedMonitor ); - } - if (chosenID == "sax-resolution") { - y2milestone("X11: setup resolution..."); - string depth = XLib::getActiveColorDepth(); - string colstr = XMessages::color8bit; - if (depth == "15") { - colstr = XMessages::color15bit; - } - if (depth == "16") { - colstr = XMessages::color16bit; - } - if (depth == "24") { - colstr = XMessages::color24bit; - } - string selectedRes = setupResolutions ( - XLib::getAvailableResolutionNames(), - XLib::getActiveResolutionString(), - colstr - ); - y2milestone("X11: setup resolution <%1>",selectedRes); - XLib::setResolution ( selectedRes ); - } - if (chosenID == "sax-displaysize") { - y2milestone("X11: setup displaysize..."); - list<string> currentSize = XLib::getDisplaySize(); - // in case of undefined value fallback to a default - if (currentSize[0]:"undef" == "undef") - currentSize[0] = "15.0"; - list<string> selectedSize = setupDisplaySize ( - currentSize[0]:"15.0", - currentSize[1]:"4" + "/" + currentSize[2]:"3" - ); - y2milestone("X11: setup displaysize <%1>",selectedSize); - XLib::setDisplaySize ( selectedSize ); - } - if (chosenID == "sax-colors") { - y2milestone("X11: setup color depth..."); - string depth = XLib::getActiveColorDepth(); - string selectedColor = setupColors ( - XLib::getActiveResolutionString(), - depth - ); - y2milestone("X11: setup color depth <%1>",selectedColor); - XLib::setDefaultColorDepth ( selectedColor ); - } - if (chosenID == "sax-3d") { - y2milestone("X11: setup 3D..."); - boolean has3D = XLib::hasOpenGLFeatures(); - y2milestone("X11: setup 3D <%1>",has3D); - if (! has3D) { - XLib::activate3D(); - } else { - XLib::deactivate3D(); - } - } - if (chosenID == "sax-ext-vga") { - y2milestone("X11: setup external VGA..."); - boolean extVGAactive = XLib::isExternalVGAactive(); - y2milestone("X11: setup external VGA <%1>",extVGAactive); - if (! extVGAactive) { - XLib::activateExternalVGA(); - } else { - XLib::deactivateExternalVGA(); - } - } - if (chosenID == "sax-test") { - y2milestone("X11: running a test server now..."); - boolean testStatus = XLib::testConfiguration(); - y2milestone("X11: test run returns <%1>",testStatus); - y2milestone("X11: refer to /var/log/Xorg.99.log for details"); - } - if (chosenID == "x11_conf") { - infoPopup(); - } -// if (chosenID == "sax-tablet" ) { -// y2milestone("X11: setup tablet..."); -// string vendor = XLib::getTabletVendor(); -// string model = XLib::getTabletModel(); -// map<string,list> tcdb = XLib::getTabletCDB(); -// list selectedTablet = setupTablet(tcdb, vendor, model); -// y2milestone("X11: setup tablet <%1>", selectedTablet); -// XLib::setTablet( (list<string>)selectedTablet ); -// } - -} -//=================================================== -// Handle proposal description... -//--------------------------------------------------- -else if ( func == "Description" ) { - ret = $[ - "rich_text_title" : XMessages::proposalTitle, - "menu_title" : XMessages::proposalMenuTitle, - "id" : "x11_conf" - ]; -} -//=================================================== -// writing configuration -//--------------------------------------------------- -else if ( func == "Write" ) { - if (XLib::isFbdevBased()) { - integer mode = XLib::getKernelFrameBufferMode(); - if (mode > 0) { - y2milestone("X11: Updating bootloader to vga=0x%1",mode); - XLib::setKernelFrameBufferMode (mode); - } - } - - // set the PreferredMode (bnc#402581) - string resolution = (string) XLib::getActiveResolution(); - string colorDepth = (string) XLib::getActiveColorDepth(); - y2milestone("Trying to set X11 PreferredMode to: %1 @ %2", resolution, colorDepth); - if ( XLib::setPreferredMode(resolution, colorDepth) ) - { - y2milestone("Sucessfully set the PreferredMode for X11"); - } - else - { - y2error("Failed to set the PreferredMode for X11."); - } - boolean success = XLib::writeConfiguration(); - ret = $[ "success" : success ]; -} -return ret; } Modified: trunk/x11/src/proposal/x11_test.sh URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/proposal/x11_test.sh?rev=... ============================================================================== --- trunk/x11/src/proposal/x11_test.sh (original) +++ trunk/x11/src/proposal/x11_test.sh Thu Jul 30 21:46:55 2009 @@ -1,7 +1,9 @@ #!/bin/sh -PATH=$PATH:/usr/lib/YaST2/bin -cd /usr/share/YaST2/clients +exit 1; -#y2base test_proposal '("hardware")' qt --nothreads -geometry 800x600 -y2base test_proposal '("hardware")' qt -geometry 800x600 +#PATH=$PATH:/usr/lib/YaST2/bin +#cd /usr/share/YaST2/clients + +#####y2base test_proposal '("hardware")' qt --nothreads -geometry 800x600 +#y2base test_proposal '("hardware")' qt -geometry 800x600 Modified: trunk/x11/src/x11.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/x11.ycp?rev=58229&r1=5822... ============================================================================== --- trunk/x11/src/x11.ycp (original) +++ trunk/x11/src/x11.ycp Thu Jul 30 21:46:55 2009 @@ -34,99 +34,48 @@ { // begin textdomain "x11"; +/* import "XMessages"; import "Wizard"; import "Popup"; import "Mode"; import "Package"; import "CommandLine"; +*/ + +y2error("Detected start of yast2-x11. It is disabled as the X-Server is configured automtically now. yast2-x11 will not change anything and just exit."); + //========================================== // Functions... //------------------------------------------ //---[ finish ]----// define any finish() ``{ - any localReturn = `next; - y2milestone ("Running displaymanager SuSEconfig module"); - UI::BusyCursor(); - SCR::Execute (.target.bash, "/sbin/SuSEconfig --module xdm"); - SCR::Execute (.target.bash, "/sbin/SuSEconfig --module kdm3"); - SCR::Execute (.target.bash, "/sbin/SuSEconfig --module gdm"); - UI::NormalCursor(); - return localReturn; + +return `next; + } //========================================== // installPackages()... //------------------------------------------ define any installPackages() ``{ - list<string> requiredPacs = [ - "xorg-x11", "xorg-x11-server","xorg-x11-server-glx","libusb", - "sax2", "sax2-gui", "sax2-ident", "sax2-tools","sax2-libsax", - "sax2-libsax-perl" - ]; - // ... / - // setup contents of requiredPacs plus required pacs - // for the detected card(s) - // --- - requiredPacs = toset ( flatten( [requiredPacs] ) ); - - // remove unavailable packages - requiredPacs = filter(string pac, requiredPacs, {return Pkg::PkgProperties(pac) != nil;} ); - - y2milestone("required X11 packages: %1", requiredPacs); - - return Package::InstallAllMsg ( - requiredPacs, XMessages::pacsMissing - ) ? `auto : nil; -} -//========================================== -// install eventually missing packages... -//------------------------------------------ -if (installPackages() == nil) { - return `nil; +return `auto; + } + //========================================== // setup GUI handler routine //------------------------------------------ define boolean GUIHandler () { - any done = WFM::CallFunction ("XMain", [true,true]); - if ((done == `abort) || (done == `back) || (done == `nil)) { - return false; - } - finish(); - return true; -} -//========================================== -// setup commandline description -//------------------------------------------ -map cmdlineDescription = $[ - "id" : "x11", - "guihandler" : GUIHandler, - "help" : XMessages::helpCMD -]; +return true; -//========================================== -// run module now... -//------------------------------------------ -any ret = CommandLine::Run ( - cmdlineDescription -); - -// CommandLine::Run returns <any>, so we have to interpret what to return -if (is(ret, symbol)) { - return (symbol)ret; -} -else if (is(ret, boolean)) { - // true equals `next, false will be `auto in order to not block the workflow - return (boolean)ret? `next:`auto; -} -else { - // values will be interpreted as success - return `next; } +return `next; + + } // end Modified: trunk/x11/yast2-x11.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/yast2-x11.spec.in?rev=58229&r... ============================================================================== --- trunk/x11/yast2-x11.spec.in (original) +++ trunk/x11/yast2-x11.spec.in Thu Jul 30 21:46:55 2009 @@ -4,11 +4,12 @@ Group: System/YaST License: GPL v2 or later BuildRequires: docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer qt3-devel sgml-skel update-desktop-files yast2 yast2-devtools yast2-perl-bindings yast2-testsuite -%ifnarch s390 s390x -BuildRequires: sax2 sax2-libsax-perl -%endif +#%ifnarch s390 s390x +#BuildRequires: sax2 sax2-libsax-perl +#%endif -Requires: yast2 sax2-libsax-perl +#Requires: yast2 sax2-libsax-perl +Requires: yast2 Provides: yast2-config-x11 yast2-agent-isax y2a_xf86 Obsoletes: yast2-config-x11 yast2-agent-isax y2a_xf86 @@ -20,11 +21,11 @@ BuildArch: noarch -Summary: YaST2 - X Window System Configuration +Summary: - %description -This module is used for configuring the X Window System from within a -running system. The module is accessible from the YaST2 control center. +This module is obsolete. Please do not use it any longer. +The X-Server is configured automatically. @PREP@ @@ -40,9 +41,9 @@ %dir @yncludedir@/x11 @yncludedir@/x11/* @clientdir@/*.ycp -@desktopdir@/*.desktop +## @desktopdir@/*.desktop @ybindir@/update_xf86config @ybindir@/xmigrate.pl -@ydatadir@/monitors.ycp +## @ydatadir@/monitors.ycp @schemadir@/autoyast/rnc/*.rnc %doc @docdir@ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jdsn@svn.opensuse.org