]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
make Cancel button checkable
authoreap <eap@opencascade.com>
Tue, 9 Jul 2013 11:57:50 +0000 (11:57 +0000)
committereap <eap@opencascade.com>
Tue, 9 Jul 2013 11:57:50 +0000 (11:57 +0000)
src/SMESHGUI/SMESHGUI_ComputeDlg.cxx

index 214dc244603a3e6ad1feb0d20334ffa6c0966d75..ec8dd9523c348c0906e0ba6b9c4861b1c923f9c4 100644 (file)
@@ -737,6 +737,7 @@ SMESHGUI_ComputeDlg_QThreadQDialog::SMESHGUI_ComputeDlg_QThreadQDialog(QWidget
 
   cancelButton = new QPushButton(tr("CANCEL"));
   cancelButton->setDefault(true);
+  cancelButton->setCheckable(true);
 
   QLabel * nbNodesName = new QLabel(tr("SMESH_MESHINFO_NODES"), this );
   QLabel * nbElemsName = new QLabel(tr("SMESH_MESHINFO_ELEMENTS"), this );
@@ -779,13 +780,13 @@ bool SMESHGUI_ComputeDlg_QThreadQDialog::result()
 void SMESHGUI_ComputeDlg_QThreadQDialog::onCancel()
 {
   qthread.cancel();
-  cancelButton->setDown( true );
   cancelButton->setText( tr("CANCELING"));
+  cancelButton->setEnabled(false);
 }
 
 void SMESHGUI_ComputeDlg_QThreadQDialog::timerEvent(QTimerEvent *event)
 {
-  if ( !cancelButton->isDown() ) // not yet cancelled
+  if ( !cancelButton->isChecked() ) // not yet cancelled
     progressBar->setValue( progressBar->maximum() * qthread.getMesh()->GetComputeProgress() );
 
   if(qthread.isFinished())