Skip to content

Commit

Permalink
Restrict closing the simulation output window
Browse files Browse the repository at this point in the history
While the model is compiling or simulating then don't allow closing the simulation output window.
  • Loading branch information
adeas31 committed Apr 24, 2020
1 parent 6dd25b6 commit 5727cb1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions OMEdit/OMEditLIB/Simulation/SimulationOutputWidget.cpp
Expand Up @@ -839,3 +839,17 @@ void SimulationOutputWidget::keyPressEvent(QKeyEvent *event)
}
QWidget::keyPressEvent(event);
}

/*!
* \brief SimulationOutputWidget::closeEvent
* Reimplementation of QWidget::closeEvent(). Ignores the event if compilation or simulation process is running.
* \param event
*/
void SimulationOutputWidget::closeEvent(QCloseEvent *event)
{
if (mpSimulationProcessThread->isCompilationProcessRunning() || mpSimulationProcessThread->isSimulationProcessRunning()) {
event->ignore();
} else {
event->accept();
}
}
1 change: 1 addition & 0 deletions OMEdit/OMEditLIB/Simulation/SimulationOutputWidget.h
Expand Up @@ -131,6 +131,7 @@ public slots:
void openTransformationBrowser(QUrl url);
protected:
virtual void keyPressEvent(QKeyEvent *event) override;
virtual void closeEvent(QCloseEvent *event) override;
};

#endif // SIMULATIONOUTPUTWIDGET_H

0 comments on commit 5727cb1

Please sign in to comment.