Author: sh-sh-sh
Date: Fri Apr 11 14:06:03 2008
New Revision: 46401
URL: http://svn.opensuse.org/viewcvs/yast?rev=46401&view=rev
Log:
use new docking function
Modified:
trunk/qt/src/YQWizard.cc
trunk/qt/src/YQWizard.h
Modified: trunk/qt/src/YQWizard.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQWizard.cc?rev=46401&r1=46400&r2=46401&view=diff
==============================================================================
--- trunk/qt/src/YQWizard.cc (original)
+++ trunk/qt/src/YQWizard.cc Fri Apr 11 14:06:03 2008
@@ -1145,35 +1145,21 @@
}
-void YQWizard::addChild( YWidget * child )
+bool YQWizard::dockSubWizard( YWizard * ySubWizard )
{
- YWidget::addChild( child );
- YWizard * yWizard = dynamic_cast (child);
+ YUI_CHECK_PTR( ySubWizard );
- yuiMilestone() << "addChild " << child << " " << yWizard << endl;
- if ( yWizard )
- {
- yuiMilestone() << "Docking sub-wizard " << child << " to " << this << endl;
- YQWizard * yqWizard = (YQWizard *) yWizard->widgetRep();
+ if ( ySubWizard->parent() != this )
+ YUI_THROW( YUIInvalidChildException<YWidget>( this, ySubWizard ) );
- static_cast( yqWizard )->setParent( static_cast( _workingDock ) );
- int index = _workingDock->addWidget( yqWizard );
- yuiMilestone() << "Index " << index << endl;
- _workingDock->setCurrentWidget( yqWizard );
-
- // FIXME
- // FIXME
- // FIXME
-
- // Dock sub-wizard - reparent yqWizard to widget stack
- // Important: Don't mess with the child's YWidget::parent().
- // This will still remain this wizard.
- // Call only yqWizard->reparent().
-
- // FIXME
- // FIXME
- // FIXME
- }
+ yuiMilestone() << "Docking sub-wizard " << ySubWizard << " to " << this << endl;
+ YQWizard * yqSubWizard = (YQWizard *) ySubWizard->widgetRep();
+
+ int index = _workingDock->addWidget( yqSubWizard );
+ yuiMilestone() << "Index " << index << endl;
+ _workingDock->setCurrentWidget( yqSubWizard );
+
+ return true; // success
}
Modified: trunk/qt/src/YQWizard.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQWizard.h?rev=46401&r1=46400&r2=46401&view=diff
==============================================================================
--- trunk/qt/src/YQWizard.h (original)
+++ trunk/qt/src/YQWizard.h Fri Apr 11 14:06:03 2008
@@ -134,11 +134,17 @@
virtual void setDialogHeading( const string & headingText );
/**
- * Add a child widget.
+ * Dock a sub-wizard: Wizards in YWizardMode_Steps can "swallow" wizards
+ * in YWizardMode_Standard so they will obscure the content + buttons part
+ * of the "steps" wizard. The docked wizard must be created as the
+ * immediate child of the "steps" wizard.
*
- * Reimplemented from YWidget to dock any YWizard children.
+ * Return 'true' upon success, 'false' upon failure.
+ *
+ * Implemented from YWizard.
**/
- virtual void addChild( YWidget * child );
+ virtual bool dockSubWizard( YWizard * subWizard );
+
/**
* Delete the last sub-wizard of this wizard, if there is one.
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org