Author: coolo
Date: Tue Feb 26 11:42:06 2008
New Revision: 45010
URL: http://svn.opensuse.org/viewcvs/yast?rev=45010&view=rev
Log:
only scale the graphics once the steps are registered
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=45010&r1=45009&r2=45010&view=diff
==============================================================================
--- trunk/qt/src/YQWizard.cc (original)
+++ trunk/qt/src/YQWizard.cc Tue Feb 26 11:42:06 2008
@@ -27,6 +27,7 @@
#include <string>
#include
+#include <QDebug>
#include <QDialog>
#include <QSvgRenderer>
#include <QPainter>
@@ -99,9 +100,11 @@
setWidgetRep( this );
+
_stepsEnabled = (wizardMode == YWizardMode_Steps);
_treeEnabled = (wizardMode == YWizardMode_Tree);
+ _stepsRegistered = false;
_stepsDirty = false;
_direction = YQWizard::Forward;
@@ -131,11 +134,13 @@
layout->addLayout( layoutSideBar( this ) );
layout->addWidget( layoutWorkArea( this ) );
- QY2Styler::self()->registerWidget( this );
+ /* If steps are enabled, we want to delay
+ the registering for after we have steps registered */
+ if ( !_stepsEnabled )
+ QY2Styler::self()->registerWidget( this );
}
-
YQWizard::~YQWizard()
{
deleteSteps();
@@ -230,8 +235,6 @@
_stepsDirty = true; // no layout yet
}
-
-
void YQWizard::addStep( const string & text, const string & id )
{
QString qId = fromUTF8( id );
@@ -284,6 +287,9 @@
yuiDebug() << "updateSteps" << endl;
+ if ( !_stepsRegistered )
+ setUpdatesEnabled(false);
+
// Create a grid layout for the steps
delete _stepsPanel->layout();
QVBoxLayout *_stepsVBox = new QVBoxLayout( _stepsPanel );
@@ -329,7 +335,7 @@
_stepsGrid->addWidget( label,
row, statusCol,
1, nameCol - statusCol + 1);
- }
+ }
else // No heading - ordinary step
{
//
@@ -355,9 +361,10 @@
nameLabel->setObjectName( step->name() );
step->setNameLabel( nameLabel );
- _stepsGrid->addWidget( nameLabel, row, nameCol );
+ _stepsGrid->addWidget( nameLabel, row, nameCol );
}
+ step->setStatus( Step::Todo );
row++;
}
@@ -369,6 +376,14 @@
_stepsVBox->addStretch( 29 );
_stepsDirty = false;
+
+ if ( !_stepsRegistered )
+ {
+ QY2Styler::self()->registerWidget( this );
+ setUpdatesEnabled( true );
+ QY2Styler::self()->updateRendering( this );
+ _stepsRegistered = true;
+ }
}
Modified: trunk/qt/src/YQWizard.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQWizard.h?rev=45010&r1=45009&r2=45010&view=diff
==============================================================================
--- trunk/qt/src/YQWizard.h (original)
+++ trunk/qt/src/YQWizard.h Tue Feb 26 11:42:06 2008
@@ -510,6 +510,7 @@
string _nextButtonLabel;
bool _stepsEnabled;
+ bool _stepsRegistered;
bool _treeEnabled;
bool _protectNextButton;
bool _stepsDirty;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org