Author: sh-sh-sh Date: Thu Jun 14 16:18:48 2007 New Revision: 38460 URL: http://svn.opensuse.org/viewcvs/yast?rev=38460&view=rev Log: centralize addChild Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc 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=38460&r1=38459&r2=38460&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 Thu Jun 14 16:18:48 2007 @@ -744,18 +744,6 @@ if ( child ) { - // FIXME: Obsolete - // FIXME: Obsolete - // FIXME: Obsolete - if ( ! dialog->contains( child ) ) - { - y2milestone( "Late adding child %s to %s", child->widgetClass(), dialog->widgetClass() ); - dialog->addChild( child ); - } - // FIXME: Obsolete - // FIXME: Obsolete - // FIXME: Obsolete - dialog->setInitialSize(); dialog->checkShortcuts(); showDialog( dialog ); @@ -1069,7 +1057,6 @@ if ( widget ) { blockEvents(); // We don't want self-generated events from UI builtins. - rp->addChild( widget ); currentDialog()->setInitialSize(); currentDialog()->checkShortcuts(); unblockEvents(); @@ -1084,7 +1071,6 @@ if ( widget ) { - rp->addChild( widget ); currentDialog()->setInitialSize(); currentDialog()->checkShortcuts(); } Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc?rev=38460&r1=38459&r2=38460&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc Thu Jun 14 16:18:48 2007 @@ -493,11 +493,7 @@ YWidget * child = createWidgetTree( dumbTab, contents ); - if ( child ) - { - dumbTab->addChild( child ); - } - else + if ( ! child ) { y2error( "Couldn't create DumbTab children" ); Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc?rev=38460&r1=38459&r2=38460&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc Thu Jun 14 16:18:48 2007 @@ -291,6 +291,19 @@ w->setParent(p); } + 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 + } + return w; } @@ -354,8 +367,7 @@ { replacePoint->setParent( parent ); YWidget * child = createWidgetTree( replacePoint, term->value( argnr )->asTerm() ); - if ( child ) replacePoint->addChild( child ); - else + if ( ! child ) { delete replacePoint; return 0; @@ -579,9 +591,7 @@ YWidget *child = createWidgetTree( alignment, childTerm ); - if ( child ) - alignment->addChild( child ); - else + if ( ! child ) { delete alignment; return 0; @@ -668,8 +678,6 @@ if ( child ) { - alignment->addChild( child ); - if ( hor ) child->setStretchable( YD_HORIZ, true ); if ( vert ) child->setStretchable( YD_VERT , true ); } @@ -787,8 +795,7 @@ alignment->setBottomMargin( deviceUnits( YD_VERT, bottomMargin ) ); YWidget *child = createWidgetTree( alignment, childTerm ); - if ( child ) alignment->addChild( child ); - else + if ( ! child ) { delete alignment; return 0; @@ -841,11 +848,7 @@ frame->setParent( parent ); YWidget *child = createWidgetTree( frame, term->value( argnr )->asTerm() ); - if ( child ) - { - frame->addChild( child ); - } - else + if ( ! child ) { delete frame; return 0; @@ -902,8 +905,7 @@ { squash->setParent( parent ); YWidget *child = createWidgetTree( squash, term->value( argnr )->asTerm() ); - if ( child ) squash->addChild( child ); - else + if ( ! child ) { delete squash; return 0; @@ -1039,18 +1041,6 @@ delete layoutBox; return 0; } - - // FIXME: Obsolete - // FIXME: Obsolete - // FIXME: Obsolete - if ( ! layoutBox->contains( child ) ) - { - y2milestone( "Late adding child %s to %s", child->widgetClass(), layoutBox->widgetClass() ); - layoutBox->addChild( child ); - } - // FIXME: Obsolete - // FIXME: Obsolete - // FIXME: Obsolete } return layoutBox; @@ -1573,7 +1563,6 @@ if ( child ) { - checkBoxFrame->addChild( child ); checkBoxFrame->handleChildrenEnablement( checked ); } else // Error creating the children tree @@ -1672,8 +1661,7 @@ radioButtonGroup->setParent( parent ); YWidget *child = createWidgetTree( radioButtonGroup, term->value( argnr )->asTerm() ); - if ( child ) radioButtonGroup->addChild( child ); - else + if ( ! child ) { delete radioButtonGroup; return 0; Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc?rev=38460&r1=38459&r2=38460&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc Thu Jun 14 16:18:48 2007 @@ -159,7 +159,7 @@ void YWidget::addChild( YWidget * child ) { - y2milestone( "Adding child %s to %s", child->widgetClass(), widgetClass() ); + y2debug( "Adding child to %s", widgetClass() ); childrenManager()->add( child ); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org