add cancellation handling to model bake widget

This commit is contained in:
Stephen Birarda 2017-04-17 17:23:06 -07:00
parent 7a5bfb8c19
commit 8a1eb5f077
2 changed files with 15 additions and 0 deletions

View file

@ -36,6 +36,20 @@ ModelBakeWidget::ModelBakeWidget(QWidget* parent, Qt::WindowFlags flags) :
setupUI();
}
ModelBakeWidget::~ModelBakeWidget() {
// if we're about to go down, whatever bakers we're managing are about to as well
// enumerate them, send the results table a cancelled status, and clean them up
auto it = _bakers.begin();
while (it != _bakers.end()) {
auto resultRow = it->second;
auto resultsWindow = qApp->getMainWindow()->showResultsWindow();
resultsWindow->changeStatusForRow(resultRow, "Cancelled");
it = _bakers.erase(it);
}
}
void ModelBakeWidget::setupUI() {
// setup a grid layout to hold everything
QGridLayout* gridLayout = new QGridLayout;

View file

@ -26,6 +26,7 @@ class ModelBakeWidget : public QWidget {
public:
ModelBakeWidget(QWidget* parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
~ModelBakeWidget();
private slots:
void chooseFileButtonClicked();