mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Restore image auto-update on change feature
* This was apparently never ported over to Qt!
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <QDirIterator>
|
||||
#include <QElapsedTimer>
|
||||
#include <QFileInfo>
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QLabel>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
@@ -732,6 +733,19 @@ void CaptureContext::LoadCapture(const rdcstr &captureFile, const ReplayOptions
|
||||
[this]() { return !m_LoadInProgress; },
|
||||
[this]() { return UpdateLoadProgress(); });
|
||||
|
||||
if(local)
|
||||
{
|
||||
m_Watcher = new QFileSystemWatcher({captureFile}, GetMainWindow()->Widget());
|
||||
|
||||
QObject::connect(m_Watcher, &QFileSystemWatcher::fileChanged, [this]() {
|
||||
Replay().AsyncInvoke([this](IReplayController *r) {
|
||||
r->FileChanged();
|
||||
r->SetFrameEvent(m_EventID, true);
|
||||
GUIInvoke::call(GetMainWindow()->Widget(), [this]() { RefreshUIStatus({}, true, true); });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
#if defined(RELEASE)
|
||||
ANALYTIC_ADDAVG(Performance.LoadTime, double(loadTimer.nsecsElapsed() * 1.0e-9));
|
||||
#endif
|
||||
@@ -1274,6 +1288,9 @@ void CaptureContext::CloseCapture()
|
||||
if(!m_CaptureLoaded)
|
||||
return;
|
||||
|
||||
delete m_Watcher;
|
||||
m_Watcher = NULL;
|
||||
|
||||
delete m_RGP;
|
||||
m_RGP = NULL;
|
||||
|
||||
|
||||
@@ -55,6 +55,8 @@ class ResourceInspector;
|
||||
class ShaderViewer;
|
||||
class MiniQtHelper;
|
||||
|
||||
class QFileSystemWatcher;
|
||||
|
||||
class CaptureContext : public ICaptureContext, IExtensionManager
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(CaptureContext);
|
||||
@@ -405,6 +407,8 @@ private:
|
||||
|
||||
MiniQtHelper *m_QtHelper = NULL;
|
||||
|
||||
QFileSystemWatcher *m_Watcher = NULL;
|
||||
|
||||
// Windows
|
||||
MainWindow *m_MainWindow = NULL;
|
||||
EventBrowser *m_EventBrowser = NULL;
|
||||
|
||||
Reference in New Issue
Block a user