+int HYDROGUI_Wizard::addPage( QWizardPage* thePage )
+{
+ if ( myWizard->count() > 0 )
+ {
+ myNext->setVisible( true );
+ myFinish->setVisible( false );
+ }
+ return myWizard->addWidget( thePage );
+}
+
+void HYDROGUI_Wizard::onNext()
+{
+ if ( !acceptCurrent() )
+ return;
+
+ if ( myWizard->count() <= 0 )
+ return;
+
+ myBack->setEnabled( true );
+ int aCurIdx = myWizard->currentIndex();
+ if ( aCurIdx == ( myWizard->count() - 2 ) )
+ {
+ // Go to the last page
+ myNext->setVisible( false );
+ myFinish->setVisible( true );
+ }
+ myWizard->setCurrentIndex( aCurIdx + 1 );
+
+ emit Next( myWizard->currentIndex() );
+}
+
+void HYDROGUI_Wizard::onBack()
+{
+ if ( myWizard->count() <= 0 )
+ return;
+
+ if ( myWizard->count() > 1 )
+ {
+ myNext->setVisible( true );
+ myFinish->setVisible( false );
+ }
+ else
+ {
+ // Wizard has a single page - show finish
+ myNext->setVisible( false );
+ myFinish->setVisible( true );
+ }
+
+ int aCurIdx = myWizard->currentIndex();
+ myWizard->setCurrentIndex( aCurIdx - 1 );
+
+ aCurIdx = myWizard->currentIndex();
+ if ( aCurIdx <= 0 )
+ {
+ // Disable back if go to the first page
+ myBack->setEnabled( false );
+ }
+
+ emit Back( aCurIdx );
+}
+
+void HYDROGUI_Wizard::onFirstPage()
+{
+ if ( myWizard->count() > 1 ) {
+ myNext->setVisible( true );
+ myFinish->setVisible( false );
+ myWizard->setCurrentIndex( 0 );
+ myBack->setEnabled( false );
+ emit Back( myWizard->currentIndex() );
+ }
+}
+
+bool HYDROGUI_Wizard::acceptCurrent() const
+{
+ return true;
+}
+
+QAbstractButton* HYDROGUI_Wizard::button( QWizard::WizardButton theBtnId ) const