Author: kmachalkova Date: Tue Mar 18 18:40:46 2008 New Revision: 45566 URL: http://svn.opensuse.org/viewcvs/yast?rev=45566&view=rev Log: moved Modified: branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.cc branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.h branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.cc branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.h Modified: branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.cc?rev=45566&r1=45565&r2=45566&view=diff ============================================================================== --- branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.cc (original) +++ branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.cc Tue Mar 18 18:40:46 2008 @@ -819,85 +819,6 @@ /////////////////////////////////////////////////////////////////// // -// fillRepoFilterList -// -// Fills the package table with packages from selected repository -// - -bool NCPackageSelector::fillRepoFilterList( ZyppRepo repo) -{ - NCMIL << "Collecting packages in selected repository" << endl; - - NCPkgTable *pkgList = PackageList(); - //clean the pkg table first - pkgList->itemsCleared (); - - //sets to store matching packages - set <ZyppSel> exactMatch; - set <ZyppSel> nearMatch; - - //iterate through the package pool - for ( ZyppPoolIterator it = zyppPkgBegin(); - it != zyppPkgEnd(); - ++it ) - { - //we have candidate object in this repository - if ( (*it)->candidateObj() && - (*it)->candidateObj()->repository() == repo ) - { - exactMatch.insert( *it ); - } - //something else (?) - else - { - zypp::ui::Selectable::available_iterator pkg_it = (*it)->availableBegin(); - - while ( pkg_it != (*it)->availableEnd() ) - { - if ( (*pkg_it)->repository() == repo ) - nearMatch.insert( *it ); - - ++pkg_it; - } - } - - } - - //finally create pkg table list entries - set<ZyppSel>::const_iterator e_it = exactMatch.begin(); - while ( e_it != exactMatch.end() ) - { - ZyppPkg pkg = tryCastToZyppPkg( (*e_it)->theObj() ); - pkgList->createListEntry ( pkg, *e_it); - e_it++; - } - - set<ZyppSel>::const_iterator n_it = nearMatch.begin(); - while ( n_it != nearMatch.end() ) - { - ZyppPkg pkg = tryCastToZyppPkg( (*n_it)->theObj() ); - pkgList->createListEntry ( pkg, *n_it); - n_it++; - } - - //and show the whole stuff to the user - pkgList->drawList(); - - //if ( repoPopup && packageLabel - //{ - // ZyppProduct product = repoPopup->findProductForRepo( repo ); - // if ( product ) - // { - // packageLabel->setLabel( product->summary() ); - // } - //} - - return true; - -} - -/////////////////////////////////////////////////////////////////// -// // match // Modified: branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.h?rev=45566&r1=45565&r2=45566&view=diff ============================================================================== --- branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.h (original) +++ branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.h Tue Mar 18 18:40:46 2008 @@ -301,12 +301,6 @@ bool fillDefaultList(); - /** - *Fills the package table with packages from selected repository - *@param repo zypp::Repository - */ - bool fillRepoFilterList ( ZyppRepo repo ); - bool isYouMode() { return youMode; } bool isAutoCheck() { return autoCheck; } Modified: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.cc?rev=45566&r1=45565&r2=45566&view=diff ============================================================================== --- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.cc (original) +++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.cc Tue Mar 18 18:40:46 2008 @@ -274,6 +274,68 @@ return true; } +bool NCPkgRepoTable::fillRepoFilterList( ZyppRepo repo ) +{ + NCMIL << "Collecting packages in selected repository" << endl; + + NCPkgTable *pkgList = packager->PackageList(); + //clean the pkg table first + pkgList->itemsCleared (); + + //sets to store matching packages + set <ZyppSel> exactMatch; + set <ZyppSel> nearMatch; + + //iterate through the package pool + for ( ZyppPoolIterator it = zyppPkgBegin(); + it != zyppPkgEnd(); + ++it ) + { + //we have candidate object in this repository + if ( (*it)->candidateObj() && + (*it)->candidateObj()->repository() == repo ) + { + exactMatch.insert( *it ); + } + //something else (?) + else + { + zypp::ui::Selectable::available_iterator pkg_it = (*it)->availableBegin(); + + while ( pkg_it != (*it)->availableEnd() ) + { + if ( (*pkg_it)->repository() == repo ) + nearMatch.insert( *it ); + + ++pkg_it; + } + } + + } + + //finally create pkg table list entries + set<ZyppSel>::const_iterator e_it = exactMatch.begin(); + while ( e_it != exactMatch.end() ) + { + ZyppPkg pkg = tryCastToZyppPkg( (*e_it)->theObj() ); + pkgList->createListEntry ( pkg, *e_it); + e_it++; + } + + set<ZyppSel>::const_iterator n_it = nearMatch.begin(); + while ( n_it != nearMatch.end() ) + { + ZyppPkg pkg = tryCastToZyppPkg( (*n_it)->theObj() ); + pkgList->createListEntry ( pkg, *n_it); + n_it++; + } + + //and show the whole stuff to the user + pkgList->drawList(); + + return true; +} + /////////////////////////////////////////////////////////////////// // // @@ -357,8 +419,12 @@ { //if ( ch == 27 ) // ESC // return NCursesEvent::cancel; + + + NCursesEvent ret = NCTable::wHandleInput( ch ); + showRepoPopup(); - return NCTable::wHandleInput( ch ); + return ret; } /////////////////////////////////////////////////////////////////// @@ -423,7 +489,7 @@ NCMIL << "Selected repository " << repo.info().alias().c_str() << endl; //and show associated packages to the user - packager->fillRepoFilterList( repo ); + fillRepoFilterList( repo ); // } // return postevent; Modified: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.h?rev=45566&r1=45565&r2=45566&view=diff ============================================================================== --- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.h (original) +++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.h Tue Mar 18 18:40:46 2008 @@ -169,6 +169,8 @@ // * @return bool (always true ;-) ) // */ bool fillRepoList( ); + + bool fillRepoFilterList( ZyppRepo repo ); // // /** // * Do actual work - show popup to the user, -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org