Add checks of any current captures or temp logs when closing main window

This commit is contained in:
baldurk
2016-11-21 17:59:01 +01:00
parent 46a86dce92
commit aa8139fcb4
2 changed files with 23 additions and 0 deletions
+2
View File
@@ -66,8 +66,10 @@ private slots:
void on_previewSplit_splitterMoved(int pos, int index);
// manual slots
public slots:
bool checkAllowClose();
private slots:
void childUpdate();
void captureCountdownTick();
+21
View File
@@ -973,6 +973,27 @@ void MainWindow::loadLayout_triggered()
void MainWindow::closeEvent(QCloseEvent *event)
{
for(LiveCapture *live : m_LiveCaptures)
{
if(!live->checkAllowClose())
{
event->ignore();
return;
}
}
if(!PromptCloseLog())
{
event->ignore();
return;
}
for(LiveCapture *live : m_LiveCaptures)
{
live->cleanItems();
live->close();
}
SaveLayout(0);
}