[yast-commit] r67624 - in /trunk/ncurses-pkg/src: NCPackageSelector.cc NCPackageSelector.h NCPkgFilterSearch.cc NCPkgPatchSearch.cc NCPkgPatchSearch.h
Author: gs Date: Wed Mar 14 13:42:03 2012 New Revision: 67624 URL: http://svn.opensuse.org/viewcvs/yast?rev=67624&view=rev Log: search in patch summary is possible Modified: trunk/ncurses-pkg/src/NCPackageSelector.cc trunk/ncurses-pkg/src/NCPackageSelector.h trunk/ncurses-pkg/src/NCPkgFilterSearch.cc trunk/ncurses-pkg/src/NCPkgPatchSearch.cc trunk/ncurses-pkg/src/NCPkgPatchSearch.h Modified: trunk/ncurses-pkg/src/NCPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPackageSelector... ============================================================================== --- trunk/ncurses-pkg/src/NCPackageSelector.cc (original) +++ trunk/ncurses-pkg/src/NCPackageSelector.cc Wed Mar 14 13:42:03 2012 @@ -380,7 +380,7 @@ // // Fills the patch list with search results // -bool NCPackageSelector::fillPatchSearchList( const string & expr ) +bool NCPackageSelector::fillPatchSearchList( const string & expr, bool checkName, bool checkSum ) { NCPkgTable * packageList = PackageList(); @@ -396,7 +396,14 @@ q.addString( expr ); q.addKind( zypp::ResKind::patch ); q.addAttribute( zypp::sat::SolvAttr::keywords ); - q.addAttribute( zypp::sat::SolvAttr::name ); + if ( checkName ) + { + q.addAttribute( zypp::sat::SolvAttr::name ); + } + if ( checkSum ) + { + q.addAttribute( zypp::sat::SolvAttr::summary ); + } for( zypp::PoolQuery::Selectable_iterator it = q.selectableBegin(); it != q.selectableEnd(); it++) Modified: trunk/ncurses-pkg/src/NCPackageSelector.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPackageSelector... ============================================================================== --- trunk/ncurses-pkg/src/NCPackageSelector.h (original) +++ trunk/ncurses-pkg/src/NCPackageSelector.h Wed Mar 14 13:42:03 2012 @@ -300,7 +300,7 @@ * @param checkRequires Check in Requires (true or false) * @return bool */ - bool fillPatchSearchList( const string & expr ); + bool fillPatchSearchList( const string & expr, bool checkName, bool checkSum ); bool fillDefaultList(); Modified: trunk/ncurses-pkg/src/NCPkgFilterSearch.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgFilterSearch... ============================================================================== --- trunk/ncurses-pkg/src/NCPkgFilterSearch.cc (original) +++ trunk/ncurses-pkg/src/NCPkgFilterSearch.cc Wed Mar 14 13:42:03 2012 @@ -321,10 +321,6 @@ settings->doCheckRequires() ); } - else - { - packager->fillPatchSearchList( filter ); - } return true; } Modified: trunk/ncurses-pkg/src/NCPkgPatchSearch.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgPatchSearch.... ============================================================================== --- trunk/ncurses-pkg/src/NCPkgPatchSearch.cc (original) +++ trunk/ncurses-pkg/src/NCPkgPatchSearch.cc Wed Mar 14 13:42:03 2012 @@ -70,7 +70,7 @@ , searchExpr( 0 ) , packager( pkger ) { - createLayout( _("Search for Patch Name") ); + createLayout( _("Search for Patches") ); } /////////////////////////////////////////////////////////////////// @@ -117,8 +117,16 @@ new NCSpacing( vSplit, YD_VERT, false, 0.6 ); + NCMultiSelectionBox * settings = new NCMultiSelectionBox( vSplit, NCPkgStrings::SearchIn() ); + YItemCollection items; + searchName = new YItem ( _( "Name of the Patch" ), true); + items.push_back( searchName ); + searchSum = new YItem ( _( "Summary" ), true); + items.push_back( searchSum ); + settings->addItems( items ); + + new NCSpacing( vSplit, YD_VERT, false, 0.6 ); NCLayoutBox * hSplit3 = new NCLayoutBox( vSplit, YD_HORIZ ); - new NCSpacing( hSplit3, YD_HORIZ, true, 0.2 ); // add the cancel and the ok button @@ -131,7 +139,7 @@ cancelButton->setFunctionKey( 9 ); new NCSpacing( hSplit3, YD_HORIZ, true, 0.2 ); - + new NCSpacing( vSplit, YD_VERT, false, 0.6 ); } /////////////////////////////////////////////////////////////////// @@ -200,7 +208,7 @@ // int NCPkgPatchSearch::preferredHeight() { - return 10; + return 16; } /////////////////////////////////////////////////////////////////// @@ -248,8 +256,9 @@ postevent.result = getSearchExpression(); string filter = postevent.result; - - packager->fillPatchSearchList( filter ); + bool checkName = searchName->selected(); + bool checkSum = searchSum->selected(); + packager->fillPatchSearchList( filter, checkName, checkSum ); } Modified: trunk/ncurses-pkg/src/NCPkgPatchSearch.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgPatchSearch.... ============================================================================== --- trunk/ncurses-pkg/src/NCPkgPatchSearch.h (original) +++ trunk/ncurses-pkg/src/NCPkgPatchSearch.h Wed Mar 14 13:42:03 2012 @@ -70,6 +70,9 @@ private: NCComboBox * searchExpr; + + YItem * searchName; + YItem * searchSum; NCPushButton * cancelButton; NCPushButton * okButton; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
gs@svn2.opensuse.org