mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 18:02:23 +02:00
add cancellation handling to model bake widget
This commit is contained in:
parent
7a5bfb8c19
commit
8a1eb5f077
2 changed files with 15 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -26,6 +26,7 @@ class ModelBakeWidget : public QWidget {
|
|||
|
||||
public:
|
||||
ModelBakeWidget(QWidget* parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
|
||||
~ModelBakeWidget();
|
||||
|
||||
private slots:
|
||||
void chooseFileButtonClicked();
|
||||
|
|
Loading…
Reference in a new issue