Skip to content

Commit

Permalink
Allow surface generation to be cancelled
Browse files Browse the repository at this point in the history
Fix OpenChemistry#1582

Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Dec 27, 2024
1 parent b6365a9 commit 76c8fd4
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

1 comment on commit 76c8fd4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR: clang-format-diff detected formatting issues. See the artifact for a patch or run clang-format on your branch.

Please sign in to comment.