From: vsr Date: Thu, 17 Feb 2005 12:00:07 +0000 (+0000) Subject: Fix a bug with GUI frozing when switching from the second "Products" page to the... X-Git-Tag: SALOME_V_2_2_0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1aa48ee0b805651a01f9debde64d728a4ce962e6;p=tools%2Finstall.git Fix a bug with GUI frozing when switching from the second "Products" page to the next one. --- diff --git a/bin/SALOME_InstallWizard b/bin/SALOME_InstallWizard index dc87b9c..626e8b6 100755 Binary files a/bin/SALOME_InstallWizard and b/bin/SALOME_InstallWizard differ diff --git a/src/InstallWizard.cpp b/src/InstallWizard.cpp index 28d529a..b65c80e 100644 --- a/src/InstallWizard.cpp +++ b/src/InstallWizard.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #define PROCESS_EVENT QEvent::User+100 @@ -914,7 +915,7 @@ Posts validation event */ void InstallWizard::postValidateEvent( InstallWizard* iw, const int val, void* data ) { - QApplication::postEvent( iw, new ProcessEvent( val, data ) ); + QThread::postEvent( iw, new ProcessEvent( val, data ) ); } /*! diff --git a/src/SALOME_InstallWizard.cxx b/src/SALOME_InstallWizard.cxx index 251e375..9a83803 100644 --- a/src/SALOME_InstallWizard.cxx +++ b/src/SALOME_InstallWizard.cxx @@ -132,6 +132,8 @@ public: parent->y() + (parent->height()-sh.height())/2 ); myDlg->show(); } + myDlg->raise(); + myDlg->setFocus(); } else { if ( myDlg ) { @@ -1045,8 +1047,6 @@ bool SALOME_InstallWizard::acceptData( const QString& pageTitle ) } QString tmpFolder = QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME; QString tgtFolder = QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ); - qApp->sendPostedEvents(); - qApp->processEvents(); myThread->clearCommands(); for ( unsigned i = 0; i < natives.count(); i++ ) { item = findItem( natives[ i ] ); @@ -1071,6 +1071,7 @@ bool SALOME_InstallWizard::acceptData( const QString& pageTitle ) } WarnDialog::showWarnDlg( this, true ); myThread->start(); + return true; // return in order to avoid default postValidateEvent() action } return InstallWizard::acceptData( pageTitle ); } @@ -1905,6 +1906,11 @@ void SALOME_InstallWizard::updateCaption() // ================================================================ void SALOME_InstallWizard::processValidateEvent( const int val, void* data ) { + QWidget* aPage = InstallWizard::currentPage(); + if ( aPage != productsPage ) { + InstallWizard::processValidateEvent( val, data ); + return; + } QCheckListItem* item = (QCheckListItem*)data; if ( val > 0 ) { if ( val == 2 ) {