mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-25 07:56:33 +00:00
Call OnCaptureClosed for capture viewers before resetting capture info
This commit is contained in:
@@ -1443,6 +1443,14 @@ void CaptureContext::CloseCapture()
|
||||
if(!m_CaptureLoaded)
|
||||
return;
|
||||
|
||||
rdcarray<ICaptureViewer *> capviewers(m_CaptureViewers);
|
||||
|
||||
for(ICaptureViewer *viewer : capviewers)
|
||||
{
|
||||
if(viewer && m_CaptureViewers.contains(viewer))
|
||||
viewer->OnCaptureClosed();
|
||||
}
|
||||
|
||||
delete m_Watcher;
|
||||
m_Watcher = NULL;
|
||||
|
||||
@@ -1487,14 +1495,6 @@ void CaptureContext::CloseCapture()
|
||||
|
||||
m_CaptureLoaded = false;
|
||||
|
||||
rdcarray<ICaptureViewer *> capviewers(m_CaptureViewers);
|
||||
|
||||
for(ICaptureViewer *viewer : capviewers)
|
||||
{
|
||||
if(viewer && m_CaptureViewers.contains(viewer))
|
||||
viewer->OnCaptureClosed();
|
||||
}
|
||||
|
||||
m_Replay.CloseThread();
|
||||
}
|
||||
|
||||
|
||||
@@ -408,7 +408,7 @@ void LiveCapture::deleteCapture_triggered()
|
||||
if(cap->path == m_Ctx.GetCaptureFilename())
|
||||
{
|
||||
m_Main->takeCaptureOwnership();
|
||||
m_Main->CloseCapture();
|
||||
m_Ctx.CloseCapture();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1208,7 +1208,7 @@ bool MainWindow::PromptCloseCapture()
|
||||
}
|
||||
}
|
||||
|
||||
CloseCapture();
|
||||
m_Ctx.CloseCapture();
|
||||
|
||||
if(!deletepath.isEmpty())
|
||||
{
|
||||
@@ -1219,31 +1219,11 @@ bool MainWindow::PromptCloseCapture()
|
||||
return true;
|
||||
}
|
||||
|
||||
void MainWindow::CloseCapture()
|
||||
{
|
||||
QString path = m_Ctx.GetCaptureFilename();
|
||||
bool local = m_Ctx.IsCaptureLocal();
|
||||
bool temp = m_Ctx.IsCaptureTemporary();
|
||||
|
||||
m_Ctx.CloseCapture();
|
||||
|
||||
if(m_OwnTempCapture && temp)
|
||||
{
|
||||
m_Ctx.Replay().DeleteCapture(path, local);
|
||||
RemoveRecentCapture(path);
|
||||
m_OwnTempCapture = false;
|
||||
}
|
||||
|
||||
ui->action_Save_Capture_Inplace->setEnabled(false);
|
||||
ui->action_Save_Capture_As->setEnabled(false);
|
||||
ui->menu_Export_As->setEnabled(false);
|
||||
}
|
||||
|
||||
void MainWindow::SetTitle(const QString &filename)
|
||||
{
|
||||
QString prefix;
|
||||
|
||||
if(m_Ctx.IsCaptureLoaded())
|
||||
if(m_Ctx.IsCaptureLoaded() && !filename.isEmpty())
|
||||
{
|
||||
prefix = QFileInfo(filename).fileName();
|
||||
if(m_Ctx.APIProps().degraded)
|
||||
@@ -2363,6 +2343,16 @@ void MainWindow::OnCaptureLoaded()
|
||||
|
||||
void MainWindow::OnCaptureClosed()
|
||||
{
|
||||
if(m_OwnTempCapture && m_Ctx.IsCaptureTemporary())
|
||||
{
|
||||
QString path = m_Ctx.GetCaptureFilename();
|
||||
|
||||
m_Ctx.Replay().DeleteCapture(path, m_Ctx.IsCaptureLocal());
|
||||
RemoveRecentCapture(path);
|
||||
}
|
||||
|
||||
m_OwnTempCapture = false;
|
||||
|
||||
ui->action_Save_Capture_Inplace->setEnabled(false);
|
||||
ui->action_Save_Capture_As->setEnabled(false);
|
||||
ui->action_Close_Capture->setEnabled(false);
|
||||
@@ -2385,7 +2375,7 @@ void MainWindow::OnCaptureClosed()
|
||||
ui->action_EmbedExternalFiles->setEnabled(false);
|
||||
ui->action_RemoveExternalFiles->setEnabled(false);
|
||||
|
||||
SetTitle();
|
||||
SetTitle(QString());
|
||||
|
||||
// if the remote sever disconnected during capture replay, resort back to a 'disconnected' state
|
||||
if(m_Ctx.Replay().CurrentRemote().IsValid() && !m_Ctx.Replay().CurrentRemote().IsServerRunning())
|
||||
|
||||
@@ -106,7 +106,6 @@ public:
|
||||
void captureModified();
|
||||
void LoadFromFilename(const QString &filename, bool temporary);
|
||||
void LoadCapture(const QString &filename, const ReplayOptions &opts, bool temporary, bool local);
|
||||
void CloseCapture();
|
||||
QString GetSavePath(QString title = QString(), QString filter = QString());
|
||||
|
||||
void OnCaptureTrigger(const QString &exe, const QString &workingDir, const QString &cmdLine,
|
||||
|
||||
Reference in New Issue
Block a user