Author: jdsn Date: Wed Nov 12 19:52:00 2008 New Revision: 53245 URL: http://svn.opensuse.org/viewcvs/yast?rev=53245&view=rev Log: fix tablet proposal during installation (bnc#429770) Modified: trunk/x11/package/yast2-x11.changes trunk/x11/src/XLib.pm trunk/x11/src/proposal/x11_proposal.ycp Modified: trunk/x11/package/yast2-x11.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/package/yast2-x11.changes?rev=53245&r1=53244&r2=53245&view=diff ============================================================================== --- trunk/x11/package/yast2-x11.changes (original) +++ trunk/x11/package/yast2-x11.changes Wed Nov 12 19:52:00 2008 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Wed Nov 12 18:25:16 CET 2008 - jdsn@suse.de + +- fix tablet proposal during installation (bnc#429770) + +------------------------------------------------------------------- Tue Nov 11 23:32:05 CET 2008 - jdsn@suse.de - only disable X11 cloning during installation (bnc#439612) Modified: trunk/x11/src/XLib.pm URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/XLib.pm?rev=53245&r1=53244&r2=53245&view=diff ============================================================================== --- trunk/x11/src/XLib.pm (original) +++ trunk/x11/src/XLib.pm Wed Nov 12 19:52:00 2008 @@ -898,87 +898,84 @@ #------------------------------------------ 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} - ); - $mTablet->selectPointer (1); - my @vendorList = @{$mTablet->getTabletVendorList()}; - foreach my $vendor (@vendorList) { - my $modelList = $mTablet->getTabletModelList ($vendor); - $tabletCDB{$vendor} = $modelList; - } - return \%tabletCDB; + 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; } #========================================== # getTabletVendor #------------------------------------------ BEGIN{ $TYPEINFO{getTabletVendor} = ["function", "string"]; } sub getTabletVendor { - my $class = shift; - my $mTablet = new SaX::SaXManipulateTablets ( - $section{Pointers},$section{Layout} - ); - $mTablet->selectPointer(1); - my $vendor = $mTablet->getVendor(); - if ($vendor =~ /Unknown/i) { - return "undef"; - } - return $vendor; + my $class = shift; + my $mTablet = new SaX::SaXManipulateTablets ( + $section{Pointers},$section{Layout} + ); + my $vendor = $mTablet->getVendor(); + if ($vendor =~ /Unknown/i) { + return "undef"; + } + return $vendor; } #========================================== # getTabletModel #------------------------------------------ BEGIN{ $TYPEINFO{getTabletModel} = ["function", "string"]; } sub getTabletModel { - my $class = shift; - my $mTablet = new SaX::SaXManipulateTablets ( - $section{Pointers},$section{Layout} - ); - $mTablet->selectPointer(1); - my $model = $mTablet->getName(); - if ($model =~ /Unknown/i) { - return "undef"; - } - return $model; + my $class = shift; + my $mTablet = new SaX::SaXManipulateTablets ( + $section{Pointers},$section{Layout} + ); + my $model = $mTablet->getName(); + if ($model =~ /Unknown/i) { + return "undef"; + } + return $model; } #========================================== -# getTabletPointer +# getTabletID #------------------------------------------ -BEGIN{ $TYPEINFO{getTabletPointer} = ["function", "string"]; } -sub getTabletPointer { - my $class = shift; - my $mTablet = new SaX::SaXManipulateTablets ( - $section{Pointers},$section{Layout} - ); - # check if one of the first 5 pointer devices is a tablet - my $i; - for ( $i=0 ; $i <= 4 ; $i++ ) - { - $mTablet->selectPointer($i); - if ($mTablet->isTablet() ) - { - return "$i"; - } - } - return "undef"; +BEGIN{ $TYPEINFO{getTabletID} = ["function", "string"]; } +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; } #========================================== # 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} - ); - $mTablet->selectPointer(1); - $mTablet->setTablet($vendor, $model); + my $vendor = shift; + my $model = shift; + my $mTablet = new SaX::SaXManipulateTablets ( + $section{Pointers},$section{Layout} + ); + $mTablet->setTablet($vendor, $model); } Modified: trunk/x11/src/proposal/x11_proposal.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/x11/src/proposal/x11_proposal.ycp?rev=53245&r1=53244&r2=53245&view=diff ============================================================================== --- trunk/x11/src/proposal/x11_proposal.ycp (original) +++ trunk/x11/src/proposal/x11_proposal.ycp Wed Nov 12 19:52:00 2008 @@ -117,9 +117,7 @@ boolean extVGAactive= (boolean) XLib::isExternalVGAactive(); list monitorSize = (list) XLib::getDisplaySize(); string monitorInch = (string) monitorSize[0]:"undef"; - //string tabletPtr = (string) XLib::getTabletPointer(); - string tabletName = (string) XLib::getTabletModel(); - string tabletVendor= (string) XLib::getTabletVendor(); + integer tabletID = (string) XLib::getTabletID(); // (bnc#429770) // add more verbose logging y2milestone("Reading libsax data finished."); @@ -137,8 +135,7 @@ "extVGAactive" : extVGAactive, "monitorSize" : monitorSize, "monitorInch" : monitorInch, - "tabletName" : tabletName, - "tabletVendor" : tabletVendor + "tabletID" : tabletID ]); //====================================== @@ -241,16 +238,21 @@ // Tablet settings (fate#302888) //-------------------------------------- string tabletStatus = XMessages::unconfigured; - if ( tabletVendor != "undef" && - tabletName != "undef" ) + 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 + + " (" + XMessages::configure + "</a>)" + + IL; } - proposal = proposal - + LI - + XMessages::Tablet + " " + tabletStatus - + " (" + XMessages::configure + "</a>)" - + IL; //====================================== // Test your configuration now //-------------------------------------- -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org