Update capture connections when an open capture is saved. Closes #2352

This commit is contained in:
baldurk
2021-08-27 11:33:40 +01:00
parent cd65e5beee
commit 1ef790ab80
3 changed files with 21 additions and 0 deletions
@@ -926,6 +926,21 @@ void LiveCapture::cleanItems()
ui->captures->clear();
}
void LiveCapture::fileSaved(QString from, QString to)
{
for(int i = 0; i < ui->captures->count(); i++)
{
Capture *cap = GetCapture(ui->captures->item(i));
if(cap->path == from)
{
cap->path = to;
cap->saved = true;
cap->local = true;
}
}
}
void LiveCapture::previewToggle_toggled(bool checked)
{
if(m_IgnorePreviewToggle)
+1
View File
@@ -60,6 +60,7 @@ public:
void QueueCapture(int frameNumber, int numFrames);
const QString &hostname() { return m_Hostname; }
void cleanItems();
void fileSaved(QString from, QString to);
public slots:
bool checkAllowClose();
+5
View File
@@ -1005,6 +1005,8 @@ bool MainWindow::PromptSaveCaptureAs()
if(!saveFilename.isEmpty())
{
QString origFilename = m_Ctx.GetCaptureFilename();
bool success = m_Ctx.SaveCaptureTo(saveFilename);
if(!success)
@@ -1014,6 +1016,9 @@ bool MainWindow::PromptSaveCaptureAs()
PopulateRecentCaptureFiles();
SetTitle(saveFilename);
for(LiveCapture *live : m_LiveCaptures)
live->fileSaved(origFilename, saveFilename);
return true;
}