[yast-commit] r62631 - in /branches/SuSE-Code-11-SP2-Branch/ncurses-pkg: package/yast2-ncurses-pkg.changes src/NCPkgFilterSearch.cc
Author: gs Date: Wed Oct 13 14:11:20 2010 New Revision: 62631 URL: http://svn.opensuse.org/viewcvs/yast?rev=62631&view=rev Log: Show error popup if searching for packages throws an exception Modified: branches/SuSE-Code-11-SP2-Branch/ncurses-pkg/package/yast2-ncurses-pkg.changes branches/SuSE-Code-11-SP2-Branch/ncurses-pkg/src/NCPkgFilterSearch.cc Modified: branches/SuSE-Code-11-SP2-Branch/ncurses-pkg/package/yast2-ncurses-pkg.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/ncurses-pkg/package/yast2-ncurses-pkg.changes?rev=62631&r1=62630&r2=62631&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/ncurses-pkg/package/yast2-ncurses-pkg.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/ncurses-pkg/package/yast2-ncurses-pkg.changes Wed Oct 13 14:11:20 2010 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Oct 13 13:58:01 CEST 2010 - gs@suse.de + +- Show error popup if searching for packages throws an exception + (bnc #615102) + +------------------------------------------------------------------- Tue Jul 27 09:59:58 CEST 2010 - gs@suse.de - Show all patterns in 'Filter/Patterns' list Modified: branches/SuSE-Code-11-SP2-Branch/ncurses-pkg/src/NCPkgFilterSearch.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/ncurses-pkg/src/NCPkgFilterSearch.cc?rev=62631&r1=62630&r2=62631&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/ncurses-pkg/src/NCPkgFilterSearch.cc (original) +++ branches/SuSE-Code-11-SP2-Branch/ncurses-pkg/src/NCPkgFilterSearch.cc Wed Oct 13 14:11:20 2010 @@ -223,15 +223,32 @@ _("Searching...") ); info->setPreferredSize( 18, 4 ); - info->popup(); - - for( zypp::PoolQuery::Selectable_iterator it = q.selectableBegin(); - it != q.selectableEnd(); it++) + info->popup(); + + try + { + for( zypp::PoolQuery::Selectable_iterator it = q.selectableBegin(); + it != q.selectableEnd(); it++) + { + ZyppPkg pkg = tryCastToZyppPkg( (*it)->theObj() ); + packageList->createListEntry ( pkg, *it); + } + } + catch (const std::exception & e) { - ZyppPkg pkg = tryCastToZyppPkg( (*it)->theObj() ); - packageList->createListEntry ( pkg, *it); + NCPopupInfo * info = new NCPopupInfo ( wpos( NCurses::lines()/10, + NCurses::cols()/10), + NCPkgStrings::ErrorLabel(), + // Popup informs the user that the query string + // entered for package search isn't correct + _("Query Error:") + ("<br>") + e.what(), + NCPkgStrings::OKLabel() ); + info->setPreferredSize( 50, 10 ); + info->showInfoPopup(); + YDialog::deleteTopmostDialog(); + yuiError() << "Caught a std::exception: " << e.what () << endl; } - + info->popdown(); YDialog::deleteTopmostDialog(); -- 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