Skip to content

Commit

Permalink
Merge pull request #1894 from ghutchis/cancel-surface-generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ghutchis authored Dec 27, 2024
2 parents 36b6ca9 + 76c8fd4 commit c639881
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion avogadro/qtplugins/surfaces/surfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,6 @@ void Surfaces::calculateQM(Type type, int index, bool beta, float isoValue,
// TODO: Check to see if this cube or surface has already been computed
if (!m_progressDialog) {
m_progressDialog = new QProgressDialog(qobject_cast<QWidget*>(parent()));
m_progressDialog->setCancelButtonText(nullptr);
m_progressDialog->setWindowModality(Qt::NonModal);
connectSlots = true;
}
Expand Down Expand Up @@ -629,6 +628,8 @@ void Surfaces::calculateQM(Type type, int index, bool beta, float isoValue,
SIGNAL(progressRangeChanged(int, int)), m_progressDialog,
SLOT(setRange(int, int)));
connect(m_gaussianConcurrent, SIGNAL(finished()), SLOT(displayMesh()));
connect(m_progressDialog, SIGNAL(canceled()),
&m_gaussianConcurrent->watcher(), SLOT(cancel()));
}
} else {
// slaters
Expand All @@ -643,6 +644,8 @@ void Surfaces::calculateQM(Type type, int index, bool beta, float isoValue,
connect(&m_slaterConcurrent->watcher(),
SIGNAL(progressRangeChanged(int, int)), m_progressDialog,
SLOT(setRange(int, int)));
connect(m_progressDialog, SIGNAL(canceled()),
&m_slaterConcurrent->watcher(), SLOT(cancel()));
connect(m_slaterConcurrent, SIGNAL(finished()), SLOT(displayMesh()));
}
}
Expand Down

0 comments on commit c639881

Please sign in to comment.