Author: sh-sh-sh
Date: Wed Jun 13 17:14:27 2007
New Revision: 38433
URL: http://svn.opensuse.org/viewcvs/yast?rev=38433&view=rev
Log:
got rid of utterly useless YRadioButtonGroup parameter everywhere
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/YContainerWidget.h
branches/tmp/sh/mod-ui/core/libyui/src/YDialog.cc
branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc
branches/tmp/sh/mod-ui/core/libyui/src/YUI_core.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
branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YContainerWidget.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YContainerWidget.h?rev=38433&r1=38432&r2=38433&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YContainerWidget.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YContainerWidget.h Wed Jun 13 17:14:27 2007
@@ -12,8 +12,7 @@
File: YContainerWidget.h
- Author: Mathias Kettner
- Maintainer: Stefan Hundhammer
+ Author: Stefan Hundhammer
/-*/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YDialog.cc?rev=38433&r1=38432&r2=38433&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YDialog.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YDialog.cc Wed Jun 13 17:14:27 2007
@@ -152,7 +152,7 @@
string label = "Dialog with ";
- if ( widget->isContainer() )
+ if ( widget->hasChildren() )
{
label += debLabel;
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUI.h?rev=38433&r1=38432&r2=38433&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI.h Wed Jun 13 17:14:27 2007
@@ -50,7 +50,6 @@
class YMenu;
class YMenuButton;
class YMultiSelectionBox;
-class YRadioButtonGroup;
class YTree;
class YTreeItem;
class Y2Component;
@@ -233,12 +232,12 @@
* @return pointer to the new widget or 0 if it was not successful.
* And error has been logged in this case
*/
- YWidget *createWidgetTree( YWidget *parent, YWidgetOpt & opt, YRadioButtonGroup *rbg, const YCPTerm & term );
+ YWidget *createWidgetTree( YWidget *parent, YWidgetOpt & opt, const YCPTerm & term );
/**
* Overloaded version for convenience. Supplies empty widget options.
*/
- YWidget *createWidgetTree( YWidget *parent, YRadioButtonGroup *rbg, const YCPTerm & term );
+ YWidget *createWidgetTree( YWidget *parent, const YCPTerm & term );
/**
* Looks up a widget with a certain id. Returns 0 if no
@@ -1100,22 +1099,6 @@
/**
- * Helper function for @ref #replaceWidget. Searches the current dialog for
- * the radio button group that applies to a certain widget w. The searched
- * for widget must be a radio button group that is an ancestor of w but
- * there must be no other more immediate ancestor radio button to w.
- *
- * @param root root widget where to begin searching
- *
- * @param w the widget we search a button group for.
- *
- * @param contains output parameter - is set to true if the subtree root
- * contains the widget w. Otherwise it is kept unchanged.
- */
- YRadioButtonGroup *findRadioButtonGroup( YContainerWidget *root, YWidget *w, bool *contains );
-
-
- /**
* Helper function of createWidgetTree. Creates a replace point
* @param parent the widget or dialog this widget is contained in
* @param term The term specifying the widget, e.g. `ReplacePoint( `PushButton( "OK" ) )
@@ -1124,9 +1107,7 @@
* @param rbg Pointer to the current radio button group
*/
YWidget *createReplacePoint( YWidget *parent, YWidgetOpt & opt,
- const YCPTerm & term, const YCPList & optList, int argnr,
- YRadioButtonGroup *rbg );
-
+ const YCPTerm & term, const YCPList & optList, int argnr );
/**
* Helper function of createWidgetTree.
@@ -1151,15 +1132,13 @@
* Creates a frame widget.
*/
YWidget *createFrame( YWidget *parent, YWidgetOpt & opt,
- const YCPTerm & term, const YCPList & optList, int argnr,
- YRadioButtonGroup *rbg );
+ const YCPTerm & term, const YCPList & optList, int argnr );
/**
* Helper function of createWidgetTree.
* Creates a CheckBoxFrame.
*/
YWidget *createCheckBoxFrame( YWidget *parent, YWidgetOpt & opt,
- const YCPTerm & term, const YCPList & optList, int argnr,
- YRadioButtonGroup *rbg );
+ const YCPTerm & term, const YCPList & optList, int argnr );
/**
@@ -1169,7 +1148,7 @@
*/
YWidget *createWeight( YWidget *parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr,
- YRadioButtonGroup *rbg, YUIDimension dim );
+ YUIDimension dim );
/**
* Helper function of createWidgetTree.
@@ -1180,7 +1159,6 @@
*/
YWidget *createAlignment( YWidget *parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr,
- YRadioButtonGroup *rbg,
YAlignmentType halign, YAlignmentType valign );
/**
@@ -1188,8 +1166,7 @@
* Creates a MarginBox.
*/
YWidget *createMarginBox( YWidget * parent, YWidgetOpt & opt,
- const YCPTerm & term, const YCPList & optList,
- int argnr, YRadioButtonGroup * rbg );
+ const YCPTerm & term, const YCPList & optList, int argnr );
/**
* Helper function of createWidgetTree.
@@ -1200,7 +1177,6 @@
*/
YWidget *createMinSize( YWidget * parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr,
- YRadioButtonGroup * rbg,
bool hor, bool vert );
/**
@@ -1212,7 +1188,7 @@
*/
YWidget *createSquash( YWidget *parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr,
- YRadioButtonGroup *rbg, bool hsquash, bool vsquash );
+ bool hsquash, bool vsquash );
/**
* Helper function of createWidgetTree.
@@ -1222,7 +1198,7 @@
*/
YWidget *createLBox( YWidget *parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr,
- YRadioButtonGroup *rbg, YUIDimension dim );
+ YUIDimension dim );
/**
* Helper function of createWidgetTree.
@@ -1418,7 +1394,7 @@
* Creates a DumbTab.
*/
YWidget *createDumbTab( YWidget *parent, YWidgetOpt & opt, const YCPTerm & term,
- const YCPList & optList, int argnr, YRadioButtonGroup * rbg );
+ const YCPList & optList, int argnr );
/**
* Helper function of createWidgetTree.
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=38433&r1=38432&r2=38433&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 Jun 13 17:14:27 2007
@@ -744,7 +744,7 @@
if ( dialog )
{
registerDialog( dialog ); // must be done first!
- YWidget *widget = createWidgetTree( dialog, 0, dialog_term );
+ YWidget *widget = createWidgetTree( dialog, dialog_term );
if ( widget )
{
@@ -1036,29 +1036,19 @@
}
YCPValue id = getId( id_value );
- YWidget *replpoint = widgetWithId( id, true ); // reports error
- if ( ! replpoint ) return YCPBoolean( false );
+ YWidget *replacePoint = widgetWithId( id, true ); // reports error
+ if ( ! replacePoint ) return YCPBoolean( false );
- if ( ! replpoint->isReplacePoint() )
+ if ( ! replacePoint->isReplacePoint() )
{
y2error( "ReplaceWidget: widget %s is not a ReplacePoint",
id->toString().c_str() );
return YCPBoolean( false );
}
- YReplacePoint *rp = dynamic_cast ( replpoint );
+ YReplacePoint *rp = dynamic_cast ( replacePoint );
assert( rp );
- // What if the widget tree to be inserted contains radiobuttons, but the
- // radiobutton group is in the unchanged rest? We must find the radio button
- // group belonging to the new subtree.
-
- bool contains = false;
- YRadioButtonGroup *rbg = findRadioButtonGroup( currentDialog(), replpoint, & contains );
-
- // I must _first_ remove the old widget and then create the new ones. The reason
- // is: Otherwise you couldn't use the same widget ids in the old and new widget tree.
-
#if VERBOSE_REPLACE_WIDGET
rp->dumpDialogWidgetTree();
#endif
@@ -1067,7 +1057,7 @@
rp->removeChildren();
- YWidget *widget = createWidgetTree( replpoint, rbg, new_widget );
+ YWidget *widget = createWidgetTree( replacePoint, new_widget );
if ( widget )
{
@@ -1083,7 +1073,7 @@
{
blockEvents(); // We don't want self-generated events from UI builtins.
- widget = createWidgetTree( replpoint, rbg, YCPTerm( YUIWidget_Empty, YCPList() ) );
+ widget = createWidgetTree( replacePoint, YCPTerm( YUIWidget_Empty, YCPList() ) );
if ( widget )
{
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_core.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUI_core.cc?rev=38433&r1=38432&r2=38433&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI_core.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_core.cc Wed Jun 13 17:14:27 2007
@@ -426,38 +426,6 @@
}
-YRadioButtonGroup * YUI::findRadioButtonGroup( YContainerWidget * root, YWidget * widget, bool * contains )
-{
- // FIXME: this function is very likely very obsolete
-
- YCPValue root_id = root->id();
-
-#if VERBOSE_FIND_RADIO_BUTTON_GROUP
- y2debug( "findRadioButtonGroup( %s, %s )",
- root_id.isNull() ? "__" : root_id->toString().c_str(),
- widget->id()->toString().c_str() );
-#endif
-
- bool is_rbg = root->isRadioButtonGroup();
- if ( widget == root ) *contains = true;
- else
- {
- for ( int i=0; i<root->numChildren(); i++ )
- {
- if ( root->child(i)->isContainer() )
- {
- YRadioButtonGroup *rbg =
- findRadioButtonGroup( dynamic_cast ( root->child(i) ), widget, contains );
- if ( rbg ) return rbg; // Some other lower rbg is it.
- }
- else if ( root->child(i) == widget ) *contains = true;
- }
- }
- if ( is_rbg && *contains ) return dynamic_cast ( root );
- else return 0;
-}
-
-
// ----------------------------------------------------------------------
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=38433&r1=38432&r2=38433&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 Wed Jun 13 17:14:27 2007
@@ -385,7 +385,7 @@
*/
YWidget * YUI::createDumbTab( YWidget *parent, YWidgetOpt & opt, const YCPTerm & term,
- const YCPList & optList, int argnr, YRadioButtonGroup * rbg )
+ const YCPList & optList, int argnr )
{
int numArgs = term->size() - argnr;
@@ -495,7 +495,7 @@
// Create child (page contents)
//
- YWidget * child = createWidgetTree( dumbTab, rbg, contents );
+ YWidget * child = createWidgetTree( dumbTab, contents );
if ( child )
{
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=38433&r1=38432&r2=38433&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 Wed Jun 13 17:14:27 2007
@@ -66,7 +66,6 @@
YWidget * YUI::createWidgetTree( YWidget * p,
YWidgetOpt & opt,
- YRadioButtonGroup * rbg,
const YCPTerm & term )
{
// Extract optional widget ID, if present
@@ -194,28 +193,28 @@
// Container widgets
- if ( s == YUIWidget_Bottom ) w = createAlignment ( p, opt, term, ol, n, rbg, YAlignUnchanged, YAlignEnd );
- else if ( s == YUIWidget_Frame ) w = createFrame ( p, opt, term, ol, n, rbg );
- else if ( s == YUIWidget_CheckBoxFrame ) w = createCheckBoxFrame ( p, opt, term, ol, n, rbg );
- else if ( s == YUIWidget_HBox ) w = createLBox ( p, opt, term, ol, n, rbg, YD_HORIZ );
- else if ( s == YUIWidget_HCenter ) w = createAlignment ( p, opt, term, ol, n, rbg, YAlignCenter, YAlignUnchanged );
- else if ( s == YUIWidget_HSquash ) w = createSquash ( p, opt, term, ol, n, rbg, true, false );
- else if ( s == YUIWidget_HVCenter ) w = createAlignment ( p, opt, term, ol, n, rbg, YAlignCenter, YAlignCenter );
- else if ( s == YUIWidget_HVSquash ) w = createSquash ( p, opt, term, ol, n, rbg, true, true );
- else if ( s == YUIWidget_HWeight ) w = createWeight ( p, opt, term, ol, n, rbg, YD_HORIZ );
- else if ( s == YUIWidget_Left ) w = createAlignment ( p, opt, term, ol, n, rbg, YAlignBegin, YAlignUnchanged );
- else if ( s == YUIWidget_MarginBox ) w = createMarginBox ( p, opt, term, ol, n, rbg );
- else if ( s == YUIWidget_MinHeight ) w = createMinSize ( p, opt, term, ol, n, rbg, false, true );
- else if ( s == YUIWidget_MinSize ) w = createMinSize ( p, opt, term, ol, n, rbg, true, true );
- else if ( s == YUIWidget_MinWidth ) w = createMinSize ( p, opt, term, ol, n, rbg, true, false );
+ if ( s == YUIWidget_Bottom ) w = createAlignment ( p, opt, term, ol, n, YAlignUnchanged, YAlignEnd );
+ else if ( s == YUIWidget_Frame ) w = createFrame ( p, opt, term, ol, n );
+ else if ( s == YUIWidget_CheckBoxFrame ) w = createCheckBoxFrame ( p, opt, term, ol, n );
+ else if ( s == YUIWidget_HBox ) w = createLBox ( p, opt, term, ol, n, YD_HORIZ );
+ else if ( s == YUIWidget_HCenter ) w = createAlignment ( p, opt, term, ol, n, YAlignCenter, YAlignUnchanged );
+ else if ( s == YUIWidget_HSquash ) w = createSquash ( p, opt, term, ol, n, true, false );
+ else if ( s == YUIWidget_HVCenter ) w = createAlignment ( p, opt, term, ol, n, YAlignCenter, YAlignCenter );
+ else if ( s == YUIWidget_HVSquash ) w = createSquash ( p, opt, term, ol, n, true, true );
+ else if ( s == YUIWidget_HWeight ) w = createWeight ( p, opt, term, ol, n, YD_HORIZ );
+ else if ( s == YUIWidget_Left ) w = createAlignment ( p, opt, term, ol, n, YAlignBegin, YAlignUnchanged );
+ else if ( s == YUIWidget_MarginBox ) w = createMarginBox ( p, opt, term, ol, n );
+ else if ( s == YUIWidget_MinHeight ) w = createMinSize ( p, opt, term, ol, n, false, true );
+ else if ( s == YUIWidget_MinSize ) w = createMinSize ( p, opt, term, ol, n, true, true );
+ else if ( s == YUIWidget_MinWidth ) w = createMinSize ( p, opt, term, ol, n, true, false );
else if ( s == YUIWidget_RadioButtonGroup ) w = createRadioButtonGroup ( p, opt, term, ol, n );
- else if ( s == YUIWidget_Right ) w = createAlignment ( p, opt, term, ol, n, rbg, YAlignEnd, YAlignUnchanged );
- else if ( s == YUIWidget_Top ) w = createAlignment ( p, opt, term, ol, n, rbg, YAlignUnchanged, YAlignBegin );
- else if ( s == YUIWidget_VBox ) w = createLBox ( p, opt, term, ol, n, rbg, YD_VERT );
- else if ( s == YUIWidget_VCenter ) w = createAlignment ( p, opt, term, ol, n, rbg, YAlignUnchanged, YAlignCenter );
- else if ( s == YUIWidget_VSquash ) w = createSquash ( p, opt, term, ol, n, rbg, false, true );
- else if ( s == YUIWidget_VWeight ) w = createWeight ( p, opt, term, ol, n, rbg, YD_VERT );
- else if ( s == YUIWidget_ReplacePoint ) w = createReplacePoint ( p, opt, term, ol, n, rbg );
+ else if ( s == YUIWidget_Right ) w = createAlignment ( p, opt, term, ol, n, YAlignEnd, YAlignUnchanged );
+ else if ( s == YUIWidget_Top ) w = createAlignment ( p, opt, term, ol, n, YAlignUnchanged, YAlignBegin );
+ else if ( s == YUIWidget_VBox ) w = createLBox ( p, opt, term, ol, n, YD_VERT );
+ else if ( s == YUIWidget_VCenter ) w = createAlignment ( p, opt, term, ol, n, YAlignUnchanged, YAlignCenter );
+ else if ( s == YUIWidget_VSquash ) w = createSquash ( p, opt, term, ol, n, false, true );
+ else if ( s == YUIWidget_VWeight ) w = createWeight ( p, opt, term, ol, n, YD_VERT );
+ else if ( s == YUIWidget_ReplacePoint ) w = createReplacePoint ( p, opt, term, ol, n );
// Leaf widgets
@@ -256,7 +255,7 @@
else if ( s == YUISpecialWidget_DownloadProgress ) w = createDownloadProgress ( p, opt, term, ol, n );
else if ( s == YUISpecialWidget_BarGraph ) w = createBarGraph ( p, opt, term, ol, n );
else if ( s == YUISpecialWidget_ColoredLabel ) w = createColoredLabel ( p, opt, term, ol, n );
- else if ( s == YUISpecialWidget_DumbTab ) w = createDumbTab ( p, opt, term, ol, n, rbg );
+ else if ( s == YUISpecialWidget_DumbTab ) w = createDumbTab ( p, opt, term, ol, n );
else if ( s == YUISpecialWidget_HMultiProgressMeter ) w = createMultiProgressMeter ( p, opt, term, ol, n, true );
else if ( s == YUISpecialWidget_VMultiProgressMeter ) w = createMultiProgressMeter ( p, opt, term, ol, n, false );
else if ( s == YUISpecialWidget_Slider ) w = createSlider ( p, opt, term, ol, n );
@@ -307,11 +306,11 @@
* version will pass through an empty set of widget options.
*/
-YWidget * YUI::createWidgetTree( YWidget * parent, YRadioButtonGroup * rbg, const YCPTerm & term )
+YWidget * YUI::createWidgetTree( YWidget * parent, const YCPTerm & term )
{
YWidgetOpt opt;
- return createWidgetTree( parent, opt, rbg, term );
+ return createWidgetTree( parent, opt, term );
}
@@ -342,7 +341,7 @@
*/
YWidget * YUI::createReplacePoint( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term, const YCPList & optList,
- int argnr, YRadioButtonGroup * rbg )
+ int argnr )
{
if ( term->size() != argnr+1 ||
term->value( argnr ).isNull() ||
@@ -359,7 +358,7 @@
if ( replacePoint )
{
replacePoint->setParent( parent );
- YWidget * child = createWidgetTree( replacePoint, rbg, term->value( argnr )->asTerm() );
+ YWidget * child = createWidgetTree( replacePoint, term->value( argnr )->asTerm() );
if ( child ) replacePoint->addChild( child );
else
{
@@ -534,8 +533,8 @@
* ("/usr/share/YaST2/theme/current/") will be prepended.
*/
-YWidget * YUI::createAlignment( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term, const YCPList & optList,
- int argnr, YRadioButtonGroup * rbg,
+YWidget * YUI::createAlignment( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term,
+ const YCPList & optList, int argnr,
YAlignmentType halign, YAlignmentType valign )
{
int argc = term->size() - argnr;
@@ -583,7 +582,7 @@
if ( ! background_pixmap.empty() )
alignment->setBackgroundPixmap( background_pixmap );
- YWidget *child = createWidgetTree( alignment, rbg, childTerm );
+ YWidget *child = createWidgetTree( alignment, childTerm );
if ( child )
alignment->addChild( child );
@@ -615,8 +614,8 @@
* It implicitly makes the child stretchable in that dimension.
*/
-YWidget * YUI::createMinSize( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term, const YCPList & optList,
- int argnr, YRadioButtonGroup * rbg,
+YWidget * YUI::createMinSize( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term,
+ const YCPList & optList, int argnr,
bool hor, bool vert )
{
int argc = term->size() - argnr;
@@ -670,7 +669,7 @@
alignment->setMinWidth ( deviceUnits( YD_HORIZ, minWidth ) );
alignment->setMinHeight( deviceUnits( YD_VERT, minHeight ));
- YWidget *child = createWidgetTree( alignment, rbg, childTerm );
+ YWidget *child = createWidgetTree( alignment, childTerm );
if ( child )
{
@@ -714,8 +713,7 @@
* content will be reduced in size.
*/
-YWidget * YUI::createMarginBox( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term, const YCPList & optList,
- int argnr, YRadioButtonGroup * rbg )
+YWidget * YUI::createMarginBox( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term, const YCPList & optList, int argnr )
{
float leftMargin = 0.0;
float rightMargin = 0.0;
@@ -793,7 +791,7 @@
alignment->setTopMargin ( deviceUnits( YD_VERT, topMargin ) );
alignment->setBottomMargin( deviceUnits( YD_VERT, bottomMargin ) );
- YWidget *child = createWidgetTree( alignment, rbg, childTerm );
+ YWidget *child = createWidgetTree( alignment, childTerm );
if ( child ) alignment->addChild( child );
else
{
@@ -826,7 +824,7 @@
*/
YWidget * YUI::createFrame( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term,
- const YCPList & optList, int argnr, YRadioButtonGroup * rbg )
+ const YCPList & optList, int argnr )
{
int s = term->size() - argnr;
@@ -846,7 +844,7 @@
if ( frame )
{
frame->setParent( parent );
- YWidget *child = createWidgetTree( frame, rbg, term->value( argnr )->asTerm() );
+ YWidget *child = createWidgetTree( frame, term->value( argnr )->asTerm() );
if ( child )
{
@@ -889,8 +887,8 @@
*
*/
-YWidget * YUI::createSquash( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term, const YCPList & optList,
- int argnr, YRadioButtonGroup * rbg,
+YWidget * YUI::createSquash( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term,
+ const YCPList & optList, int argnr,
bool hsquash, bool vsquash )
{
if ( term->size() != argnr+1 ||
@@ -908,7 +906,7 @@
if ( squash )
{
squash->setParent( parent );
- YWidget *child = createWidgetTree( squash, rbg, term->value( argnr )->asTerm() );
+ YWidget *child = createWidgetTree( squash, term->value( argnr )->asTerm() );
if ( child ) squash->addChild( child );
else
{
@@ -953,8 +951,9 @@
*
*/
-YWidget * YUI::createWeight( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term, const YCPList & optList,
- int argnr, YRadioButtonGroup * rbg, YUIDimension dim )
+YWidget * YUI::createWeight( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term,
+ const YCPList & optList, int argnr,
+ YUIDimension dim )
{
if ( term->size() != argnr + 2
|| !term->value(argnr)->isInteger()
@@ -978,7 +977,7 @@
if ( dim == YD_HORIZ ) childOpt.hWeight.setValue( weightValue );
else childOpt.vWeight.setValue( weightValue );
- return createWidgetTree( parent, childOpt,rbg, term->value( argnr+1 )->asTerm() );
+ return createWidgetTree( parent, childOpt, term->value( argnr+1 )->asTerm() );
}
@@ -1009,8 +1008,9 @@
*
*/
-YWidget * YUI::createLBox( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term, const YCPList & optList,
- int argnr, YRadioButtonGroup * rbg, YUIDimension dim )
+YWidget * YUI::createLBox( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term,
+ const YCPList & optList, int argnr,
+ YUIDimension dim )
{
// Parse options
@@ -1038,7 +1038,7 @@
return 0;
}
- YWidget *child = createWidgetTree( split, rbg, term->value(w)->asTerm() );
+ YWidget *child = createWidgetTree( split, term->value(w)->asTerm() );
if ( ! child )
{
@@ -1522,8 +1522,7 @@
*/
YWidget * YUI::createCheckBoxFrame( YWidget * parent, YWidgetOpt & opt,
- const YCPTerm & term, const YCPList & optList, int argnr,
- YRadioButtonGroup * rbg )
+ const YCPTerm & term, const YCPList & optList, int argnr )
{
int s = term->size() - argnr;
if ( s != 3
@@ -1566,7 +1565,7 @@
if ( checkBoxFrame )
{
checkBoxFrame->setParent( parent );
- YWidget * child = createWidgetTree( checkBoxFrame, rbg, childTerm );
+ YWidget * child = createWidgetTree( checkBoxFrame, childTerm );
if ( child )
{
@@ -1663,20 +1662,20 @@
}
rejectAllOptions( term,optList );
- YRadioButtonGroup * rbg = dynamic_cast ( createRadioButtonGroup( parent, opt ) );
- assert( rbg );
+ YRadioButtonGroup * radioButtonGroup = dynamic_cast ( createRadioButtonGroup( parent, opt ) );
+ assert( radioButtonGroup );
- rbg->setParent( parent );
- YWidget *child = createWidgetTree( rbg, rbg, term->value( argnr )->asTerm() );
+ radioButtonGroup->setParent( parent );
+ YWidget *child = createWidgetTree( radioButtonGroup, term->value( argnr )->asTerm() );
- if ( child ) rbg->addChild( child );
+ if ( child ) radioButtonGroup->addChild( child );
else
{
- delete rbg;
+ delete radioButtonGroup;
return 0;
}
- return rbg;
+ return radioButtonGroup;
}
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=38433&r1=38432&r2=38433&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc Wed Jun 13 17:14:27 2007
@@ -48,10 +48,10 @@
/**
* Constructor
**/
- YWidgetPrivate( YWidgetChildrenManager * manager )
+ YWidgetPrivate( YWidgetChildrenManager * manager, YWidget * parentWidget = 0 )
: magic( YWIDGET_MAGIC )
, childrenManager( manager )
- , parent( 0 )
+ , parent( parentWidget )
, beingDestroyed( false )
, enabled( true )
, notify( false )
@@ -104,7 +104,7 @@
YWidget::YWidget( YWidget * parent )
- : priv( new YWidgetPrivate( new YWidgetChildrenRejector( this ) ) )
+ : priv( new YWidgetPrivate( new YWidgetChildrenRejector( this ), parent ) )
, user_widget_id( YCPNull() )
, windowID( -1 )
{
@@ -128,7 +128,7 @@
deleteChildren();
- if ( parent() && ! parent()->isBeingDestroyed() )
+ if ( parent() && ! parent()->beingDestroyed() )
parent()->removeChild( this );
delete priv->childrenManager;
@@ -163,7 +163,8 @@
void
YWidget::removeChild( YWidget * child )
{
- childrenManager()->remove( child );
+ if ( ! beingDestroyed() )
+ childrenManager()->remove( child );
}
@@ -212,7 +213,7 @@
bool
-YWidget::isBeingDestroyed() const
+YWidget::beingDestroyed() const
{
return priv->beingDestroyed;
}
@@ -456,11 +457,6 @@
}
-bool YWidget::isRadioButtonGroup() const
-{
- return false;
-}
-
bool YWidget::isReplacePoint() const
{
return false;
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h?rev=38433&r1=38432&r2=38433&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h Wed Jun 13 17:14:27 2007
@@ -270,7 +270,7 @@
/**
* Check if this widget is in the process of being destroyed.
**/
- bool isBeingDestroyed() const;
+ bool beingDestroyed() const;
/**
* Return a pointer to the underlying toolkit's (Qt, ...) widget
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org