Author: kmachalkova Date: Wed Jun 4 12:44:02 2008 New Revision: 48054 URL: http://svn.opensuse.org/viewcvs/yast?rev=48054&view=rev Log: Let's not bother users with hitting search button - removing it, searching directly by hitting enter on search expression field (ReturnOnReturn rulezz :) ) Modified: trunk/ncurses-pkg/src/NCPackageSelector.cc trunk/ncurses-pkg/src/NCPackageSelector.h trunk/ncurses-pkg/src/NCPkgFilterSearch.cc trunk/ncurses-pkg/src/NCPkgFilterSearch.h Modified: trunk/ncurses-pkg/src/NCPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPackageSelector.cc?rev=48054&r1=48053&r2=48054&view=diff ============================================================================== --- trunk/ncurses-pkg/src/NCPackageSelector.cc (original) +++ trunk/ncurses-pkg/src/NCPackageSelector.cc Wed Jun 4 12:44:02 2008 @@ -255,7 +255,7 @@ { retVal = filterMain->handleEvent(); } - else if ( event.widget == searchButton ) + else if ( event.widget == searchField ) { retVal = searchPopup->showSearchResultPackages(); } Modified: trunk/ncurses-pkg/src/NCPackageSelector.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPackageSelector.h?rev=48054&r1=48053&r2=48054&view=diff ============================================================================== --- trunk/ncurses-pkg/src/NCPackageSelector.h (original) +++ trunk/ncurses-pkg/src/NCPackageSelector.h Wed Jun 4 12:44:02 2008 @@ -144,7 +144,7 @@ // information about packages NCPkgPackageDetails * infoText; // short/longdecsription, filelist NCRichText * filter_desc; - NCPushButton *searchButton; + NCInputField *searchField; NCPkgSearchSettings *searchSet; YReplacePoint * replacePoint; // replace point for info text YReplacePoint * replPoint; @@ -224,7 +224,7 @@ YReplacePoint *ReplacePoint() { return replacePoint; } NCRichText *FilterDescription() { return filter_desc; } NCPkgSearchSettings *SearchSettings() { return searchSet; } - void setSearchButton( NCPushButton *pb ) { searchButton = pb; } + void setSearchField( NCInputField *expr ) { searchField = expr; } bool checkNow( bool *ok ); bool verifySystem( bool *ok ); Modified: trunk/ncurses-pkg/src/NCPkgFilterSearch.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgFilterSearch.cc?rev=48054&r1=48053&r2=48054&view=diff ============================================================================== --- trunk/ncurses-pkg/src/NCPkgFilterSearch.cc (original) +++ trunk/ncurses-pkg/src/NCPkgFilterSearch.cc Wed Jun 4 12:44:02 2008 @@ -87,18 +87,10 @@ NCLayoutBox * vSplit = new NCLayoutBox ( frame0, YD_VERT); new NCSpacing( vSplit, YD_VERT, true, 0.5 ); - NCLayoutBox * hSplit = new NCLayoutBox ( vSplit, YD_HORIZ); - searchExpr = new NCComboBox( hSplit, - NCPkgStrings::SearchPhrase(), - true ); // editable = true - + searchExpr = new NCInputField( vSplit, NCPkgStrings::SearchPhrase() ); searchExpr->setStretchable( YD_HORIZ, true ); - searchExpr->addItem( new YTableItem() ); - - NCLayoutBox * bogus = new NCLayoutBox ( hSplit, YD_VERT); - new NCSpacing( bogus, YD_VERT, false, 1.0 ); - searchButton = new NCPushButton( bogus, NCPkgStrings::SearchButton()); - packager->setSearchButton( searchButton ); + searchExpr->setReturnOnReturn( true ); + packager->setSearchField( searchExpr ); new NCSpacing( vSplit, YD_VERT, false, 0.5 ); @@ -128,8 +120,8 @@ // get the expression and store it in combo box list // value = searchExpr->getValue(); - value = searchExpr->text(); - searchExpr->addItem( value, true ); + value = searchExpr->value(); + //searchExpr->addItem( value, true ); } return value; @@ -245,27 +237,6 @@ /////////////////////////////////////////////////////////////////// // // -// METHOD NAME : NCPopup::wHandleInput -// METHOD TYPE : NCursesEvent -// -// DESCRIPTION : -// -NCursesEvent NCPkgFilterSearch::wHandleInput( wint_t ch ) -{ - NCursesEvent ret = NCursesEvent::none; - - // start package search if Return is pressed - if ( ch == KEY_RETURN ) - ret = NCursesEvent::button; - else - ret = NCWidget::wHandleInput( ch ); - - return ret; -} - -/////////////////////////////////////////////////////////////////// -// -// // METHOD NAME : NCPkgFilterSearch::postAgain // METHOD TYPE : bool // Modified: trunk/ncurses-pkg/src/NCPkgFilterSearch.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgFilterSearch.h?rev=48054&r1=48053&r2=48054&view=diff ============================================================================== --- trunk/ncurses-pkg/src/NCPkgFilterSearch.h (original) +++ trunk/ncurses-pkg/src/NCPkgFilterSearch.h Wed Jun 4 12:44:02 2008 @@ -28,7 +28,7 @@ using std::string; #include "NCPopup.h" -#include "NCComboBox.h" +#include "NCInputField.h" #include "NCLabel.h" #include "NCLayoutBox.h" #include "NCRichText.h" @@ -50,7 +50,7 @@ private: - NCComboBox * searchExpr; + NCInputField * searchExpr; NCCheckBox * ignoreCase; NCPushButton * searchButton; @@ -62,9 +62,6 @@ protected: string getSearchExpression() const; - - - virtual NCursesEvent wHandleInput( wint_t ch ); public: -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org