Salome HOME
Implement features:
[tools/install.git] / src / InstallWizard.cpp
index 810c6402124d37e8a6b1e79a1b8a1aa57f463644..d4bd4da508824be8ebbccc78a47bdf427883564a 100644 (file)
@@ -39,6 +39,7 @@
 
 #include <qlayout.h>
 #include <qpushbutton.h>
+#include <qtoolbutton.h>
 #include <qcursor.h>
 #include <qlabel.h>
 #include <qwidgetstack.h>
@@ -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" );
@@ -168,6 +172,8 @@ 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" );
@@ -176,6 +182,8 @@ InstallWizard::InstallWizard( QWidget *parent, const char *name, bool modal,
   d->nextAccel = d->accel->insertItem( Qt::ALT + Qt::Key_Right );
   d->accel->connectItem( d->nextAccel, this, SIGNAL(nextClicked()) );
 #endif
+
+  showAboutBtn( false );
 }
 
 
@@ -416,7 +424,9 @@ void InstallWizard::help()
   emit helpClicked();
 }
 
-
+/*!
+  Enables/disables <Back> button
+ */
 void InstallWizard::setBackEnabled( bool enable )
 {
   d->backButton->setEnabled( enable );
@@ -425,7 +435,9 @@ void InstallWizard::setBackEnabled( bool enable )
 #endif
 }
 
-
+/*!
+  Enables/disables <Next> button
+ */
 void InstallWizard::setNextEnabled( bool enable )
 {
   d->nextButton->setEnabled( enable );
@@ -434,13 +446,14 @@ void InstallWizard::setNextEnabled( bool enable )
 #endif
 }
 
-
+/*!
+  Enables/disables <Help> button
+ */
 void InstallWizard::setHelpEnabled( bool enable )
 {
   d->helpButton->setEnabled( enable );
 }
 
-
 /*!
 \fn void InstallWizard::setFinish( QWidget *, bool )
 \obsolete
@@ -914,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
 }
 
 /*!