From: eap Date: Tue, 9 Jul 2013 11:57:50 +0000 (+0000) Subject: make Cancel button checkable X-Git-Tag: V7_3_0a1~287 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f4ec60b8cafcd69027c06c9ab132219fb2b27932;p=modules%2Fsmesh.git make Cancel button checkable --- diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 214dc2446..ec8dd9523 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -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())