[yast-commit] r39322 - in /branches/tmp/sh/mod-ui/core/libyui/src: YCPDialogParser.cc YUI_builtins.cc
Author: sh-sh-sh Date: Wed Jul 11 14:57:26 2007 New Revision: 39322 URL: http://svn.opensuse.org/viewcvs/yast?rev=39322&view=rev Log: Improved error handling Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc?rev=39322&r1=39321&r2=39322&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc Wed Jul 11 14:57:26 2007 @@ -78,6 +78,8 @@ YWidgetOpt & opt, const YCPTerm & term ) { + YUI_CHECK_PTR( p ); + // Extract optional widget ID, if present int n; YCPValue id = getWidgetId( term, &n ); @@ -200,7 +202,6 @@ YWidget * w = 0; string s = term->name(); - if ( s == YUIWidget_Bottom ) w = parseAlignment ( p, opt, term, ol, n, YAlignUnchanged, YAlignEnd ); else if ( s == YUIWidget_CheckBox ) w = parseCheckBox ( p, opt, term, ol, n ); else if ( s == YUIWidget_CheckBoxFrame ) w = parseCheckBoxFrame ( p, opt, term, ol, n ); @@ -270,8 +271,7 @@ else if ( s == YUISpecialWidget_Wizard ) w = parseWizard ( p, opt, term, ol, n ); else { - y2error( "Unknown widget type %s", s.c_str() ); - return 0; + YUI_THROW( YUIException( string( "Unknown widget type " ) + s.c_str() ) ); } @@ -308,19 +308,24 @@ w->setParent(p); - } - if ( ! p->contains( w ) ) + if ( ! p->contains( w ) ) + { + // FIXME: Obsolete + // FIXME: Obsolete + // FIXME: Obsolete + y2warning( "Late adding child %s to %s", w->widgetClass(), p->widgetClass() ); + p->addChild( w ); + + // FIXME: Obsolete + // FIXME: Obsolete + // FIXME: Obsolete + } + } + else { - // FIXME: Obsolete - // FIXME: Obsolete - // FIXME: Obsolete - y2warning( "Late adding child %s to %s", w->widgetClass(), p->widgetClass() ); - p->addChild( w ); - - // FIXME: Obsolete - // FIXME: Obsolete - // FIXME: Obsolete + y2error( "Could not create %s", s.c_str() ); + ycperror( "Could not create %s from\n%s", s.c_str(), term->toString().c_str() ); } return w; Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc?rev=39322&r1=39321&r2=39322&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc Wed Jul 11 14:57:26 2007 @@ -798,6 +798,11 @@ catch ( YUIException & exception ) { YUI_CAUGHT( exception ); + + // Delete this half-created dialog: + // Some widgets are in a very undefined state (no children etc.) + YDialog::deleteTopmostDialog(); + ycperror( "UI::OpenDialog(): Dialog term parse error" ); } } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
sh-sh-sh@svn.opensuse.org