Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow surface generation to be cancelled #1894

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading