X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FInstallWizard.cpp;h=d4bd4da508824be8ebbccc78a47bdf427883564a;hb=7f20464cbfdbb123c2880002895cdbb454e63fbf;hp=e1beb403c012478ad72e663b09c537a7568f07a6;hpb=912c594d67fcbb6d5f7df61f615428037af601db;p=tools%2Finstall.git diff --git a/src/InstallWizard.cpp b/src/InstallWizard.cpp index e1beb40..d4bd4da 100644 --- a/src/InstallWizard.cpp +++ b/src/InstallWizard.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -95,6 +96,7 @@ public: QPushButton * cancelButton; QPushButton * helpButton; QFrame * hbar1, * hbar2; + QToolButton * aboutButton; #ifndef QT_NO_ACCEL QAccel * accel; @@ -128,11 +130,13 @@ InstallWizard::InstallWizard( QWidget *parent, const char *name, bool modal, d->ws = new QWidgetStack( this, "qt_widgetstack" ); d->pages.setAutoDelete( TRUE ); d->titleBox = new QHBox( this, "title box" ); + d->aboutButton = new QToolButton( d->titleBox, "about button"); + d->aboutButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); + d->aboutButton->setAutoRaise( true ); d->title = new QLabel( d->titleBox, "title label" ); d->logoBox = new QHBox( d->titleBox, "logo box" ); d->logoBox->setSpacing( 2 ); d->titleBox->setStretchFactor( d->title, 10 ); - // create in nice tab order d->nextButton = new QPushButton( this, "next" ); d->finishButton = new QPushButton( this, "finish" ); @@ -155,8 +159,12 @@ InstallWizard::InstallWizard( QWidget *parent, const char *name, bool modal, d->nextButton->setDefault( TRUE ); connect( d->backButton, SIGNAL(clicked()), + this, SIGNAL(backClicked()) ); + connect( this, SIGNAL(backClicked()), this, SLOT(back()) ); connect( d->nextButton, SIGNAL(clicked()), + this, SIGNAL(nextClicked()) ); + connect( this, SIGNAL(nextClicked()), this, SLOT(next()) ); connect( d->finishButton, SIGNAL(clicked()), this, SLOT(accept()) ); @@ -164,14 +172,18 @@ InstallWizard::InstallWizard( QWidget *parent, const char *name, bool modal, this, SLOT(reject()) ); connect( d->helpButton, SIGNAL(clicked()), this, SLOT(help()) ); + connect( d->aboutButton, SIGNAL(clicked()), + this, SIGNAL(aboutClicked()) ); #ifndef QT_NO_ACCEL d->accel = new QAccel( this, "arrow-key accel" ); d->backAccel = d->accel->insertItem( Qt::ALT + Qt::Key_Left ); - d->accel->connectItem( d->backAccel, this, SLOT(back()) ); + d->accel->connectItem( d->backAccel, this, SIGNAL(backClicked()) ); d->nextAccel = d->accel->insertItem( Qt::ALT + Qt::Key_Right ); - d->accel->connectItem( d->nextAccel, this, SLOT(next()) ); + d->accel->connectItem( d->nextAccel, this, SIGNAL(nextClicked()) ); #endif + + showAboutBtn( false ); } @@ -412,7 +424,9 @@ void InstallWizard::help() emit helpClicked(); } - +/*! + Enables/disables button + */ void InstallWizard::setBackEnabled( bool enable ) { d->backButton->setEnabled( enable ); @@ -421,7 +435,9 @@ void InstallWizard::setBackEnabled( bool enable ) #endif } - +/*! + Enables/disables button + */ void InstallWizard::setNextEnabled( bool enable ) { d->nextButton->setEnabled( enable ); @@ -430,13 +446,14 @@ void InstallWizard::setNextEnabled( bool enable ) #endif } - +/*! + Enables/disables button + */ void InstallWizard::setHelpEnabled( bool enable ) { d->helpButton->setEnabled( enable ); } - /*! \fn void InstallWizard::setFinish( QWidget *, bool ) \obsolete @@ -910,12 +927,32 @@ void InstallWizard::removeLogos() delete children; } +/*! +Show/hide "About" button +*/ +void InstallWizard::showAboutBtn( bool show ) +{ + show ? d->aboutButton->show() : d->aboutButton->hide(); +} + +/*! +Set icon for "About" button +*/ +void InstallWizard::setAboutIcon( const QPixmap& px ) +{ + d->aboutButton->setIconSet( px ); +} + /*! Posts validation event */ void InstallWizard::postValidateEvent( InstallWizard* iw, const int val, void* data ) { +#if QT_VERSION > 0x030005 + QApplication::postEvent( iw, new ProcessEvent( val, data ) ); +#else QThread::postEvent( iw, new ProcessEvent( val, data ) ); +#endif } /*!