[yast-commit] r62397 - in /trunk/ncurses-pkg/src: NCPackageSelectorPluginImpl.cc NCPkgFilterSearch.cc
Author: gs Date: Wed Aug 18 14:47:28 2010 New Revision: 62397 URL: http://svn.opensuse.org/viewcvs/yast?rev=62397&view=rev Log: show error popup if exception is thrown Modified: trunk/ncurses-pkg/src/NCPackageSelectorPluginImpl.cc trunk/ncurses-pkg/src/NCPkgFilterSearch.cc Modified: trunk/ncurses-pkg/src/NCPackageSelectorPluginImpl.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPackageSelectorPluginImpl.cc?rev=62397&r1=62396&r2=62397&view=diff ============================================================================== --- trunk/ncurses-pkg/src/NCPackageSelectorPluginImpl.cc (original) +++ trunk/ncurses-pkg/src/NCPackageSelectorPluginImpl.cc Wed Aug 18 14:47:28 2010 @@ -18,6 +18,7 @@ #include "NCPackageSelectorPluginImpl.h" #include "NCPackageSelectorStart.h" +#include "NCPopupInfo.h" #include <YTableHeader.h> @@ -150,6 +151,14 @@ } catch (const std::exception & e) { + NCPopupInfo * info = new NCPopupInfo ( wpos( NCurses::lines()/10, + NCurses::cols()/10), + NCPkgStrings::ErrorLabel(), + _("Caught an exception:") + ("<br>") + e.what(), + NCPkgStrings::OKLabel() ); + info->setPreferredSize( 50, 10 ); + info->showInfoPopup(); + YDialog::deleteTopmostDialog(); yuiError() << "Caught a std::exception: " << e.what () << endl; } catch (...) Modified: trunk/ncurses-pkg/src/NCPkgFilterSearch.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgFilterSearch.cc?rev=62397&r1=62396&r2=62397&view=diff ============================================================================== --- trunk/ncurses-pkg/src/NCPkgFilterSearch.cc (original) +++ trunk/ncurses-pkg/src/NCPkgFilterSearch.cc Wed Aug 18 14:47:28 2010 @@ -204,13 +204,13 @@ q.addKind( zypp::ResKind::package ); if ( !ignoreCase ) - q.setCaseSensitive(); + q.setCaseSensitive(); if ( checkName ) q.addAttribute( zypp::sat::SolvAttr::name ); if ( checkSummary ) q.addAttribute( zypp::sat::SolvAttr::summary ); if ( checkKeywords ) - q.addAttribute( zypp::sat::SolvAttr::keywords ); + q.addAttribute( zypp::sat::SolvAttr::keywords ); if ( checkDescr ) q.addAttribute( zypp::sat::SolvAttr::description ); if ( checkProvides ) @@ -225,11 +225,28 @@ info->setPreferredSize( 18, 4 ); info->popup(); - for( zypp::PoolQuery::Selectable_iterator it = q.selectableBegin(); - it != q.selectableEnd(); it++) + try { - ZyppPkg pkg = tryCastToZyppPkg( (*it)->theObj() ); - packageList->createListEntry ( pkg, *it); + 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) + { + 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(); @@ -245,13 +262,13 @@ if ( found_pkgs > 0 ) { - packageList->setCurrentItem( 0 ); - packageList->showInformation(); + packageList->setCurrentItem( 0 ); + packageList->showInformation(); packageList->setKeyboardFocus(); } else packager->clearInfoArea(); - + return true; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
gs@svn.opensuse.org