mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-31 20:01:12 +00:00
Refactor qrenderdoc to provide stable, clean and deliberate API
* Note, this API is still in-flux and beta, so there may still be some more changes before it's 'stable', and even then it will still be subject to some amount of change. * This API is then exposed to python via SWIG bindings and hides internals that don't need to be visible, and means the actual API is easier to work with. * We also use this API to reduce inter-dependencies between different windows that need to interact with each other at a high level. * The naming is python/standard RenderDoc TitleCase method names, not Qt style camelCase methods. # Conflicts: # qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp # qrenderdoc/Windows/TextureViewer.cpp
This commit is contained in:
+122
-116
@@ -27,13 +27,13 @@
|
||||
#include <QFileDialog>
|
||||
#include <QFileInfo>
|
||||
#include <QMimeData>
|
||||
#include <QMouseEvent>
|
||||
#include <QProgressBar>
|
||||
#include <QProgressDialog>
|
||||
#include <QToolButton>
|
||||
#include "Code/CaptureContext.h"
|
||||
#include "Code/QRDUtils.h"
|
||||
#include "Code/Resources.h"
|
||||
#include "PipelineState/PipelineStateViewer.h"
|
||||
#include "Resources/resource.h"
|
||||
#include "Widgets/Extended/RDLabel.h"
|
||||
#include "Windows/Dialogs/AboutDialog.h"
|
||||
@@ -43,13 +43,6 @@
|
||||
#include "Windows/Dialogs/SettingsDialog.h"
|
||||
#include "Windows/Dialogs/SuggestRemoteDialog.h"
|
||||
#include "Windows/Dialogs/TipsDialog.h"
|
||||
#include "APIInspector.h"
|
||||
#include "BufferViewer.h"
|
||||
#include "ConstantBufferPreviewer.h"
|
||||
#include "DebugMessageView.h"
|
||||
#include "EventBrowser.h"
|
||||
#include "StatisticsViewer.h"
|
||||
#include "TextureViewer.h"
|
||||
#include "ui_MainWindow.h"
|
||||
#include "version.h"
|
||||
|
||||
@@ -79,7 +72,7 @@ struct Version
|
||||
extern "C" void *__stdcall GetModuleHandleA(const char *);
|
||||
#endif
|
||||
|
||||
MainWindow::MainWindow(CaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::MainWindow), m_Ctx(ctx)
|
||||
MainWindow::MainWindow(ICaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::MainWindow), m_Ctx(ctx)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -183,8 +176,9 @@ MainWindow::MainWindow(CaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Main
|
||||
PopulateRecentCaptures();
|
||||
|
||||
ui->toolWindowManager->setRubberBandLineWidth(50);
|
||||
ui->toolWindowManager->setToolWindowCreateCallback(
|
||||
[this](const QString &objectName) -> QWidget * { return m_Ctx.createToolWindow(objectName); });
|
||||
ui->toolWindowManager->setToolWindowCreateCallback([this](const QString &objectName) -> QWidget * {
|
||||
return m_Ctx.CreateBuiltinWindow(objectName);
|
||||
});
|
||||
|
||||
ui->action_Resolve_Symbols->setEnabled(false);
|
||||
ui->action_Resolve_Symbols->setText(tr("Resolve Symbols"));
|
||||
@@ -192,8 +186,8 @@ MainWindow::MainWindow(CaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Main
|
||||
bool loaded = LoadLayout(0);
|
||||
|
||||
LambdaThread *th = new LambdaThread([this]() {
|
||||
m_Ctx.Config.AddAndroidHosts();
|
||||
for(RemoteHost *host : m_Ctx.Config.RemoteHosts)
|
||||
m_Ctx.Config().AddAndroidHosts();
|
||||
for(RemoteHost *host : m_Ctx.Config().RemoteHosts)
|
||||
host->CheckStatus();
|
||||
});
|
||||
th->selfDelete(true);
|
||||
@@ -202,36 +196,36 @@ MainWindow::MainWindow(CaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Main
|
||||
// create default layout if layout failed to load
|
||||
if(!loaded)
|
||||
{
|
||||
EventBrowser *eventBrowser = m_Ctx.eventBrowser();
|
||||
QWidget *eventBrowser = m_Ctx.GetEventBrowser()->Widget();
|
||||
|
||||
ui->toolWindowManager->addToolWindow(eventBrowser, ToolWindowManager::EmptySpace);
|
||||
|
||||
TextureViewer *textureViewer = m_Ctx.textureViewer();
|
||||
QWidget *textureViewer = m_Ctx.GetTextureViewer()->Widget();
|
||||
|
||||
ui->toolWindowManager->addToolWindow(
|
||||
textureViewer,
|
||||
ToolWindowManager::AreaReference(ToolWindowManager::RightOf,
|
||||
ui->toolWindowManager->areaOf(eventBrowser), 0.75f));
|
||||
|
||||
PipelineStateViewer *pipe = m_Ctx.pipelineViewer();
|
||||
QWidget *pipe = m_Ctx.GetPipelineViewer()->Widget();
|
||||
|
||||
ui->toolWindowManager->addToolWindow(
|
||||
pipe, ToolWindowManager::AreaReference(ToolWindowManager::AddTo,
|
||||
ui->toolWindowManager->areaOf(textureViewer)));
|
||||
|
||||
BufferViewer *mesh = m_Ctx.meshPreview();
|
||||
QWidget *mesh = m_Ctx.GetMeshPreview()->Widget();
|
||||
|
||||
ui->toolWindowManager->addToolWindow(
|
||||
mesh, ToolWindowManager::AreaReference(ToolWindowManager::AddTo,
|
||||
ui->toolWindowManager->areaOf(textureViewer)));
|
||||
|
||||
CaptureDialog *capDialog = m_Ctx.captureDialog();
|
||||
QWidget *capDialog = m_Ctx.GetCaptureDialog()->Widget();
|
||||
|
||||
ui->toolWindowManager->addToolWindow(
|
||||
capDialog, ToolWindowManager::AreaReference(ToolWindowManager::AddTo,
|
||||
ui->toolWindowManager->areaOf(textureViewer)));
|
||||
|
||||
APIInspector *apiInspector = m_Ctx.apiInspector();
|
||||
QWidget *apiInspector = m_Ctx.GetAPIInspector()->Widget();
|
||||
|
||||
ui->toolWindowManager->addToolWindow(
|
||||
apiInspector,
|
||||
@@ -284,7 +278,7 @@ QString MainWindow::GetLayoutPath(int layout)
|
||||
if(layout > 0)
|
||||
filename = QString("Layout%1.config").arg(layout);
|
||||
|
||||
return m_Ctx.ConfigFile(filename);
|
||||
return ConfigFilePath(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Exit_triggered()
|
||||
@@ -298,7 +292,7 @@ void MainWindow::on_action_Open_Log_triggered()
|
||||
return;
|
||||
|
||||
QString filename =
|
||||
RDDialog::getOpenFileName(this, "Select Logfile to open", m_Ctx.Config.LastLogPath,
|
||||
RDDialog::getOpenFileName(this, "Select Logfile to open", m_Ctx.Config().LastLogPath,
|
||||
"Log Files (*.rdc);;Image Files (*.dds *.hdr *.exr *.bmp *.jpg "
|
||||
"*.jpeg *.png *.tga *.gif *.psd;;All Files (*.*)");
|
||||
|
||||
@@ -353,8 +347,8 @@ void MainWindow::OnCaptureTrigger(const QString &exe, const QString &workingDir,
|
||||
}
|
||||
|
||||
LiveCapture *live = new LiveCapture(
|
||||
m_Ctx, m_Ctx.Renderer().remote() ? m_Ctx.Renderer().remote()->Hostname : "", ret, this,
|
||||
this);
|
||||
m_Ctx, m_Ctx.Renderer().CurrentRemote() ? m_Ctx.Renderer().CurrentRemote()->Hostname : "",
|
||||
ret, this, this);
|
||||
ShowLiveCapture(live);
|
||||
callback(live);
|
||||
});
|
||||
@@ -428,7 +422,8 @@ void MainWindow::LoadLogfile(const QString &filename, bool temporary, bool local
|
||||
rdctype::str machineIdent;
|
||||
ReplaySupport support = ReplaySupport::Unsupported;
|
||||
|
||||
bool remoteReplay = !local || (m_Ctx.Renderer().remote() && m_Ctx.Renderer().remote()->Connected);
|
||||
bool remoteReplay =
|
||||
!local || (m_Ctx.Renderer().CurrentRemote() && m_Ctx.Renderer().CurrentRemote()->Connected);
|
||||
|
||||
if(local)
|
||||
{
|
||||
@@ -437,7 +432,8 @@ void MainWindow::LoadLogfile(const QString &filename, bool temporary, bool local
|
||||
// if the return value suggests remote replay, and it's not already selected, AND the user
|
||||
// hasn't previously chosen to always replay locally without being prompted, ask if they'd
|
||||
// prefer to switch to a remote context for replaying.
|
||||
if(support == ReplaySupport::SuggestRemote && !remoteReplay && !m_Ctx.Config.AlwaysReplayLocally)
|
||||
if(support == ReplaySupport::SuggestRemote && !remoteReplay &&
|
||||
!m_Ctx.Config().AlwaysReplayLocally)
|
||||
{
|
||||
SuggestRemoteDialog dialog(ToQStr(driver), ToQStr(machineIdent), this);
|
||||
|
||||
@@ -465,7 +461,8 @@ void MainWindow::LoadLogfile(const QString &filename, bool temporary, bool local
|
||||
[this]() { return contextChooser->isEnabled(); });
|
||||
}
|
||||
|
||||
remoteReplay = (m_Ctx.Renderer().remote() && m_Ctx.Renderer().remote()->Connected);
|
||||
remoteReplay =
|
||||
(m_Ctx.Renderer().CurrentRemote() && m_Ctx.Renderer().CurrentRemote()->Connected);
|
||||
|
||||
if(!remoteReplay)
|
||||
{
|
||||
@@ -484,9 +481,9 @@ void MainWindow::LoadLogfile(const QString &filename, bool temporary, bool local
|
||||
// set that bit as sticky in the config
|
||||
if(dialog.alwaysReplayLocally())
|
||||
{
|
||||
m_Ctx.Config.AlwaysReplayLocally = true;
|
||||
m_Ctx.Config().AlwaysReplayLocally = true;
|
||||
|
||||
m_Ctx.Config.Save();
|
||||
m_Ctx.Config().Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -516,7 +513,7 @@ void MainWindow::LoadLogfile(const QString &filename, bool temporary, bool local
|
||||
QString remoteMessage =
|
||||
tr("This log was captured with %1 and cannot be replayed on %2.\n\n")
|
||||
.arg(driver.c_str())
|
||||
.arg(m_Ctx.Renderer().remote()->Hostname);
|
||||
.arg(m_Ctx.Renderer().CurrentRemote()->Hostname);
|
||||
|
||||
remoteMessage += "Try selecting a different remote context in the status bar.";
|
||||
|
||||
@@ -558,7 +555,7 @@ void MainWindow::LoadLogfile(const QString &filename, bool temporary, bool local
|
||||
|
||||
if(!remoteReplay)
|
||||
{
|
||||
m_Ctx.Config.LastLogPath = QFileInfo(filename).absolutePath();
|
||||
m_Ctx.Config().LastLogPath = QFileInfo(filename).absolutePath();
|
||||
}
|
||||
|
||||
statusText->setText(tr("Loading ") + origFilename + "...");
|
||||
@@ -567,25 +564,25 @@ void MainWindow::LoadLogfile(const QString &filename, bool temporary, bool local
|
||||
|
||||
void MainWindow::OpenCaptureConfigFile(const QString &filename, bool exe)
|
||||
{
|
||||
CaptureDialog *capDialog = m_Ctx.captureDialog();
|
||||
ICaptureDialog *capDialog = m_Ctx.GetCaptureDialog();
|
||||
|
||||
if(exe)
|
||||
capDialog->setExecutableFilename(filename);
|
||||
capDialog->SetExecutableFilename(filename);
|
||||
else
|
||||
capDialog->loadSettings(filename);
|
||||
capDialog->LoadSettings(filename);
|
||||
|
||||
if(!ui->toolWindowManager->toolWindows().contains(capDialog))
|
||||
ui->toolWindowManager->addToolWindow(capDialog, mainToolArea());
|
||||
if(!ui->toolWindowManager->toolWindows().contains(capDialog->Widget()))
|
||||
ui->toolWindowManager->addToolWindow(capDialog->Widget(), mainToolArea());
|
||||
}
|
||||
|
||||
QString MainWindow::GetSavePath()
|
||||
{
|
||||
QString dir;
|
||||
|
||||
if(m_Ctx.Config.DefaultCaptureSaveDirectory != "")
|
||||
if(m_Ctx.Config().DefaultCaptureSaveDirectory != "")
|
||||
{
|
||||
if(m_LastSaveCapturePath == "")
|
||||
dir = m_Ctx.Config.DefaultCaptureSaveDirectory;
|
||||
dir = m_Ctx.Config().DefaultCaptureSaveDirectory;
|
||||
else
|
||||
dir = m_LastSaveCapturePath;
|
||||
}
|
||||
@@ -648,7 +645,7 @@ bool MainWindow::PromptSaveLog()
|
||||
return false;
|
||||
}
|
||||
|
||||
PersistantConfig::AddRecentFile(m_Ctx.Config.RecentLogFiles, saveFilename, 10);
|
||||
AddRecentFile(m_Ctx.Config().RecentLogFiles, saveFilename, 10);
|
||||
PopulateRecentFiles();
|
||||
SetTitle(saveFilename);
|
||||
|
||||
@@ -730,8 +727,8 @@ void MainWindow::SetTitle(const QString &filename)
|
||||
prefix += " - ";
|
||||
}
|
||||
|
||||
if(m_Ctx.Renderer().remote())
|
||||
prefix += tr("Remote: %1 - ").arg(m_Ctx.Renderer().remote()->Hostname);
|
||||
if(m_Ctx.Renderer().CurrentRemote())
|
||||
prefix += tr("Remote: %1 - ").arg(m_Ctx.Renderer().CurrentRemote()->Hostname);
|
||||
|
||||
QString text = prefix + "RenderDoc ";
|
||||
|
||||
@@ -760,9 +757,9 @@ void MainWindow::PopulateRecentFiles()
|
||||
ui->menu_Recent_Logs->setEnabled(false);
|
||||
|
||||
int idx = 1;
|
||||
for(int i = m_Ctx.Config.RecentLogFiles.size() - 1; i >= 0; i--)
|
||||
for(int i = m_Ctx.Config().RecentLogFiles.size() - 1; i >= 0; i--)
|
||||
{
|
||||
const QString &filename = m_Ctx.Config.RecentLogFiles[i];
|
||||
const QString &filename = m_Ctx.Config().RecentLogFiles[i];
|
||||
ui->menu_Recent_Logs->addAction("&" + QString::number(idx) + " " + filename,
|
||||
[this, filename] { recentLog(filename); });
|
||||
idx++;
|
||||
@@ -781,9 +778,9 @@ void MainWindow::PopulateRecentCaptures()
|
||||
ui->menu_Recent_Capture_Settings->setEnabled(false);
|
||||
|
||||
int idx = 1;
|
||||
for(int i = m_Ctx.Config.RecentCaptureSettings.size() - 1; i >= 0; i--)
|
||||
for(int i = m_Ctx.Config().RecentCaptureSettings.size() - 1; i >= 0; i--)
|
||||
{
|
||||
const QString &filename = m_Ctx.Config.RecentCaptureSettings[i];
|
||||
const QString &filename = m_Ctx.Config().RecentCaptureSettings[i];
|
||||
ui->menu_Recent_Capture_Settings->addAction("&" + QString::number(idx) + " " + filename,
|
||||
[this, filename] { recentCapture(filename); });
|
||||
idx++;
|
||||
@@ -797,9 +794,9 @@ void MainWindow::PopulateRecentCaptures()
|
||||
|
||||
void MainWindow::ShowLiveCapture(LiveCapture *live)
|
||||
{
|
||||
live->setWindowIcon(m_Ctx.winIcon());
|
||||
m_LiveCaptures.push_back(live);
|
||||
ui->toolWindowManager->addToolWindow(live, mainToolArea());
|
||||
|
||||
m_Ctx.AddDockWindow(live, DockReference::MainToolArea, this);
|
||||
}
|
||||
|
||||
void MainWindow::LiveCaptureClosed(LiveCapture *live)
|
||||
@@ -807,25 +804,32 @@ void MainWindow::LiveCaptureClosed(LiveCapture *live)
|
||||
m_LiveCaptures.removeOne(live);
|
||||
}
|
||||
|
||||
ToolWindowManager *MainWindow::mainToolManager()
|
||||
{
|
||||
return ui->toolWindowManager;
|
||||
}
|
||||
|
||||
ToolWindowManager::AreaReference MainWindow::mainToolArea()
|
||||
{
|
||||
// bit of a hack. Maybe the ToolWindowManager should track this?
|
||||
// Try and identify where to add new windows, by searching a
|
||||
// priority list of other windows to use their area
|
||||
if(m_Ctx.hasTextureViewer() && ui->toolWindowManager->toolWindows().contains(m_Ctx.textureViewer()))
|
||||
return ToolWindowManager::AreaReference(ToolWindowManager::AddTo,
|
||||
ui->toolWindowManager->areaOf(m_Ctx.textureViewer()));
|
||||
else if(m_Ctx.hasPipelineViewer() &&
|
||||
ui->toolWindowManager->toolWindows().contains(m_Ctx.pipelineViewer()))
|
||||
return ToolWindowManager::AreaReference(ToolWindowManager::AddTo,
|
||||
ui->toolWindowManager->areaOf(m_Ctx.pipelineViewer()));
|
||||
else if(m_Ctx.hasMeshPreview() && ui->toolWindowManager->toolWindows().contains(m_Ctx.meshPreview()))
|
||||
return ToolWindowManager::AreaReference(ToolWindowManager::AddTo,
|
||||
ui->toolWindowManager->areaOf(m_Ctx.meshPreview()));
|
||||
else if(m_Ctx.hasCaptureDialog() &&
|
||||
ui->toolWindowManager->toolWindows().contains(m_Ctx.captureDialog()))
|
||||
return ToolWindowManager::AreaReference(ToolWindowManager::AddTo,
|
||||
ui->toolWindowManager->areaOf(m_Ctx.captureDialog()));
|
||||
if(m_Ctx.HasTextureViewer() &&
|
||||
ui->toolWindowManager->toolWindows().contains(m_Ctx.GetTextureViewer()->Widget()))
|
||||
return ToolWindowManager::AreaReference(
|
||||
ToolWindowManager::AddTo, ui->toolWindowManager->areaOf(m_Ctx.GetTextureViewer()->Widget()));
|
||||
else if(m_Ctx.HasPipelineViewer() &&
|
||||
ui->toolWindowManager->toolWindows().contains(m_Ctx.GetPipelineViewer()->Widget()))
|
||||
return ToolWindowManager::AreaReference(
|
||||
ToolWindowManager::AddTo, ui->toolWindowManager->areaOf(m_Ctx.GetPipelineViewer()->Widget()));
|
||||
else if(m_Ctx.HasMeshPreview() &&
|
||||
ui->toolWindowManager->toolWindows().contains(m_Ctx.GetMeshPreview()->Widget()))
|
||||
return ToolWindowManager::AreaReference(
|
||||
ToolWindowManager::AddTo, ui->toolWindowManager->areaOf(m_Ctx.GetMeshPreview()->Widget()));
|
||||
else if(m_Ctx.HasCaptureDialog() &&
|
||||
ui->toolWindowManager->toolWindows().contains(m_Ctx.GetCaptureDialog()->Widget()))
|
||||
return ToolWindowManager::AreaReference(
|
||||
ToolWindowManager::AddTo, ui->toolWindowManager->areaOf(m_Ctx.GetCaptureDialog()->Widget()));
|
||||
|
||||
// if all else fails just add to the last place we placed something.
|
||||
return ToolWindowManager::AreaReference(ToolWindowManager::LastUsedArea);
|
||||
@@ -834,17 +838,19 @@ ToolWindowManager::AreaReference MainWindow::mainToolArea()
|
||||
ToolWindowManager::AreaReference MainWindow::leftToolArea()
|
||||
{
|
||||
// see mainToolArea()
|
||||
if(m_Ctx.hasTextureViewer() && ui->toolWindowManager->toolWindows().contains(m_Ctx.textureViewer()))
|
||||
return ToolWindowManager::AreaReference(ToolWindowManager::LeftOf,
|
||||
ui->toolWindowManager->areaOf(m_Ctx.textureViewer()));
|
||||
else if(m_Ctx.hasPipelineViewer() &&
|
||||
ui->toolWindowManager->toolWindows().contains(m_Ctx.pipelineViewer()))
|
||||
return ToolWindowManager::AreaReference(ToolWindowManager::LeftOf,
|
||||
ui->toolWindowManager->areaOf(m_Ctx.pipelineViewer()));
|
||||
else if(m_Ctx.hasCaptureDialog() &&
|
||||
ui->toolWindowManager->toolWindows().contains(m_Ctx.captureDialog()))
|
||||
return ToolWindowManager::AreaReference(ToolWindowManager::LeftOf,
|
||||
ui->toolWindowManager->areaOf(m_Ctx.captureDialog()));
|
||||
if(m_Ctx.HasTextureViewer() &&
|
||||
ui->toolWindowManager->toolWindows().contains(m_Ctx.GetTextureViewer()->Widget()))
|
||||
return ToolWindowManager::AreaReference(
|
||||
ToolWindowManager::LeftOf, ui->toolWindowManager->areaOf(m_Ctx.GetTextureViewer()->Widget()));
|
||||
else if(m_Ctx.HasPipelineViewer() &&
|
||||
ui->toolWindowManager->toolWindows().contains(m_Ctx.GetPipelineViewer()->Widget()))
|
||||
return ToolWindowManager::AreaReference(
|
||||
ToolWindowManager::LeftOf,
|
||||
ui->toolWindowManager->areaOf(m_Ctx.GetPipelineViewer()->Widget()));
|
||||
else if(m_Ctx.HasCaptureDialog() &&
|
||||
ui->toolWindowManager->toolWindows().contains(m_Ctx.GetCaptureDialog()->Widget()))
|
||||
return ToolWindowManager::AreaReference(
|
||||
ToolWindowManager::LeftOf, ui->toolWindowManager->areaOf(m_Ctx.GetCaptureDialog()->Widget()));
|
||||
|
||||
return ToolWindowManager::AreaReference(ToolWindowManager::LastUsedArea);
|
||||
}
|
||||
@@ -863,7 +869,7 @@ void MainWindow::recentLog(const QString &filename)
|
||||
|
||||
if(res == QMessageBox::Yes)
|
||||
{
|
||||
m_Ctx.Config.RecentLogFiles.removeOne(filename);
|
||||
m_Ctx.Config().RecentLogFiles.removeOne(filename);
|
||||
|
||||
PopulateRecentFiles();
|
||||
}
|
||||
@@ -884,7 +890,7 @@ void MainWindow::recentCapture(const QString &filename)
|
||||
|
||||
if(res == QMessageBox::Yes)
|
||||
{
|
||||
m_Ctx.Config.RecentLogFiles.removeOne(filename);
|
||||
m_Ctx.Config().RecentLogFiles.removeOne(filename);
|
||||
|
||||
PopulateRecentFiles();
|
||||
}
|
||||
@@ -917,9 +923,9 @@ void MainWindow::setLogHasErrors(bool errors)
|
||||
text = tr("%1 loaded. Log has %2 errors, warnings or performance notes. "
|
||||
"See the 'Log Errors and Warnings' window.")
|
||||
.arg(filename)
|
||||
.arg(m_Ctx.DebugMessages.size());
|
||||
if(m_Ctx.UnreadMessageCount > 0)
|
||||
text += tr(" %1 Unread.").arg(m_Ctx.UnreadMessageCount);
|
||||
.arg(m_Ctx.DebugMessages().size());
|
||||
if(m_Ctx.UnreadMessageCount() > 0)
|
||||
text += tr(" %1 Unread.").arg(m_Ctx.UnreadMessageCount());
|
||||
statusText->setText(text);
|
||||
}
|
||||
else
|
||||
@@ -933,7 +939,7 @@ void MainWindow::remoteProbe()
|
||||
{
|
||||
if(!m_Ctx.LogLoaded() && !m_Ctx.LogLoading())
|
||||
{
|
||||
for(RemoteHost *host : m_Ctx.Config.RemoteHosts)
|
||||
for(RemoteHost *host : m_Ctx.Config().RemoteHosts)
|
||||
{
|
||||
// don't mess with a host we're connected to - this is handled anyway
|
||||
if(host->Connected)
|
||||
@@ -958,13 +964,13 @@ void MainWindow::messageCheck()
|
||||
|
||||
bool disconnected = false;
|
||||
|
||||
if(m_Ctx.Renderer().remote())
|
||||
if(m_Ctx.Renderer().CurrentRemote())
|
||||
{
|
||||
bool prev = m_Ctx.Renderer().remote()->ServerRunning;
|
||||
bool prev = m_Ctx.Renderer().CurrentRemote()->ServerRunning;
|
||||
|
||||
m_Ctx.Renderer().PingRemote();
|
||||
|
||||
if(prev != m_Ctx.Renderer().remote()->ServerRunning)
|
||||
if(prev != m_Ctx.Renderer().CurrentRemote()->ServerRunning)
|
||||
disconnected = true;
|
||||
}
|
||||
|
||||
@@ -979,31 +985,30 @@ void MainWindow::messageCheck()
|
||||
"RenderDoc to reconnect and load the capture again"));
|
||||
}
|
||||
|
||||
if(m_Ctx.Renderer().remote() && !m_Ctx.Renderer().remote()->ServerRunning)
|
||||
if(m_Ctx.Renderer().CurrentRemote() && !m_Ctx.Renderer().CurrentRemote()->ServerRunning)
|
||||
contextChooser->setIcon(Icons::cross());
|
||||
|
||||
if(!msgs.empty())
|
||||
{
|
||||
m_Ctx.AddMessages(msgs);
|
||||
m_Ctx.debugMessageView()->RefreshMessageList();
|
||||
}
|
||||
|
||||
if(m_Ctx.UnreadMessageCount > 0)
|
||||
if(m_Ctx.UnreadMessageCount() > 0)
|
||||
m_messageAlternate = !m_messageAlternate;
|
||||
else
|
||||
m_messageAlternate = false;
|
||||
|
||||
setLogHasErrors(!m_Ctx.DebugMessages.empty());
|
||||
setLogHasErrors(!m_Ctx.DebugMessages().empty());
|
||||
});
|
||||
});
|
||||
}
|
||||
else if(!m_Ctx.LogLoaded() && !m_Ctx.LogLoading())
|
||||
{
|
||||
if(m_Ctx.Renderer().remote())
|
||||
if(m_Ctx.Renderer().CurrentRemote())
|
||||
m_Ctx.Renderer().PingRemote();
|
||||
|
||||
GUIInvoke::call([this]() {
|
||||
if(m_Ctx.Renderer().remote() && !m_Ctx.Renderer().remote()->ServerRunning)
|
||||
if(m_Ctx.Renderer().CurrentRemote() && !m_Ctx.Renderer().CurrentRemote()->ServerRunning)
|
||||
{
|
||||
contextChooser->setIcon(Icons::cross());
|
||||
contextChooser->setText(tr("Replay Context: %1").arg("Local"));
|
||||
@@ -1020,9 +1025,9 @@ void MainWindow::FillRemotesMenu(QMenu *menu, bool includeLocalhost)
|
||||
{
|
||||
menu->clear();
|
||||
|
||||
for(int i = 0; i < m_Ctx.Config.RemoteHosts.count(); i++)
|
||||
for(int i = 0; i < m_Ctx.Config().RemoteHosts.count(); i++)
|
||||
{
|
||||
RemoteHost *host = m_Ctx.Config.RemoteHosts[i];
|
||||
RemoteHost *host = m_Ctx.Config().RemoteHosts[i];
|
||||
|
||||
// add localhost at the end
|
||||
if(host->Hostname == "localhost")
|
||||
@@ -1080,9 +1085,9 @@ void MainWindow::switchContext()
|
||||
|
||||
RemoteHost *host = NULL;
|
||||
|
||||
if(hostIdx >= 0 && hostIdx < m_Ctx.Config.RemoteHosts.count())
|
||||
if(hostIdx >= 0 && hostIdx < m_Ctx.Config().RemoteHosts.count())
|
||||
{
|
||||
host = m_Ctx.Config.RemoteHosts[hostIdx];
|
||||
host = m_Ctx.Config().RemoteHosts[hostIdx];
|
||||
}
|
||||
|
||||
for(LiveCapture *live : m_LiveCaptures)
|
||||
@@ -1203,7 +1208,7 @@ void MainWindow::contextChooser_menuShowing()
|
||||
FillRemotesMenu(contextChooserMenu, true);
|
||||
}
|
||||
|
||||
void MainWindow::statusDoubleClicked()
|
||||
void MainWindow::statusDoubleClicked(QMouseEvent *event)
|
||||
{
|
||||
showDebugMessageView();
|
||||
}
|
||||
@@ -1215,7 +1220,7 @@ void MainWindow::OnLogfileLoaded()
|
||||
|
||||
statusProgress->setVisible(false);
|
||||
|
||||
setLogHasErrors(!m_Ctx.DebugMessages.empty());
|
||||
setLogHasErrors(!m_Ctx.DebugMessages().empty());
|
||||
|
||||
m_Ctx.Renderer().AsyncInvoke([this](IReplayRenderer *r) {
|
||||
bool hasResolver = r->HasCallstacks();
|
||||
@@ -1233,7 +1238,7 @@ void MainWindow::OnLogfileLoaded()
|
||||
|
||||
PopulateRecentFiles();
|
||||
|
||||
ToolWindowManager::raiseToolWindow(m_Ctx.eventBrowser());
|
||||
ToolWindowManager::raiseToolWindow(m_Ctx.GetEventBrowser()->Widget());
|
||||
}
|
||||
|
||||
void MainWindow::OnLogfileClosed()
|
||||
@@ -1250,7 +1255,7 @@ void MainWindow::OnLogfileClosed()
|
||||
SetTitle();
|
||||
|
||||
// if the remote sever disconnected during log replay, resort back to a 'disconnected' state
|
||||
if(m_Ctx.Renderer().remote() && !m_Ctx.Renderer().remote()->ServerRunning)
|
||||
if(m_Ctx.Renderer().CurrentRemote() && !m_Ctx.Renderer().CurrentRemote()->ServerRunning)
|
||||
{
|
||||
statusText->setText(
|
||||
tr("Remote server disconnected. To attempt to reconnect please select it again."));
|
||||
@@ -1281,7 +1286,7 @@ void MainWindow::on_action_About_triggered()
|
||||
|
||||
void MainWindow::on_action_Mesh_Output_triggered()
|
||||
{
|
||||
BufferViewer *meshPreview = m_Ctx.meshPreview();
|
||||
QWidget *meshPreview = m_Ctx.GetMeshPreview()->Widget();
|
||||
|
||||
if(ui->toolWindowManager->toolWindows().contains(meshPreview))
|
||||
ToolWindowManager::raiseToolWindow(meshPreview);
|
||||
@@ -1291,7 +1296,7 @@ void MainWindow::on_action_Mesh_Output_triggered()
|
||||
|
||||
void MainWindow::on_action_API_Inspector_triggered()
|
||||
{
|
||||
APIInspector *apiInspector = m_Ctx.apiInspector();
|
||||
QWidget *apiInspector = m_Ctx.GetAPIInspector()->Widget();
|
||||
|
||||
if(ui->toolWindowManager->toolWindows().contains(apiInspector))
|
||||
{
|
||||
@@ -1299,10 +1304,11 @@ void MainWindow::on_action_API_Inspector_triggered()
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_Ctx.hasEventBrowser())
|
||||
if(m_Ctx.HasEventBrowser())
|
||||
{
|
||||
ToolWindowManager::AreaReference ref(ToolWindowManager::BottomOf,
|
||||
ui->toolWindowManager->areaOf(m_Ctx.eventBrowser()));
|
||||
ToolWindowManager::AreaReference ref(
|
||||
ToolWindowManager::BottomOf,
|
||||
ui->toolWindowManager->areaOf(m_Ctx.GetEventBrowser()->Widget()));
|
||||
ui->toolWindowManager->addToolWindow(apiInspector, ref);
|
||||
}
|
||||
else
|
||||
@@ -1314,7 +1320,7 @@ void MainWindow::on_action_API_Inspector_triggered()
|
||||
|
||||
void MainWindow::on_action_Event_Browser_triggered()
|
||||
{
|
||||
EventBrowser *eventBrowser = m_Ctx.eventBrowser();
|
||||
QWidget *eventBrowser = m_Ctx.GetEventBrowser()->Widget();
|
||||
|
||||
if(ui->toolWindowManager->toolWindows().contains(eventBrowser))
|
||||
ToolWindowManager::raiseToolWindow(eventBrowser);
|
||||
@@ -1324,7 +1330,7 @@ void MainWindow::on_action_Event_Browser_triggered()
|
||||
|
||||
void MainWindow::on_action_Texture_Viewer_triggered()
|
||||
{
|
||||
TextureViewer *textureViewer = m_Ctx.textureViewer();
|
||||
QWidget *textureViewer = m_Ctx.GetTextureViewer()->Widget();
|
||||
|
||||
if(ui->toolWindowManager->toolWindows().contains(textureViewer))
|
||||
ToolWindowManager::raiseToolWindow(textureViewer);
|
||||
@@ -1334,7 +1340,7 @@ void MainWindow::on_action_Texture_Viewer_triggered()
|
||||
|
||||
void MainWindow::on_action_Pipeline_State_triggered()
|
||||
{
|
||||
PipelineStateViewer *pipelineViewer = m_Ctx.pipelineViewer();
|
||||
QWidget *pipelineViewer = m_Ctx.GetPipelineViewer()->Widget();
|
||||
|
||||
if(ui->toolWindowManager->toolWindows().contains(pipelineViewer))
|
||||
ToolWindowManager::raiseToolWindow(pipelineViewer);
|
||||
@@ -1344,31 +1350,31 @@ void MainWindow::on_action_Pipeline_State_triggered()
|
||||
|
||||
void MainWindow::on_action_Capture_Log_triggered()
|
||||
{
|
||||
CaptureDialog *capDialog = m_Ctx.captureDialog();
|
||||
ICaptureDialog *capDialog = m_Ctx.GetCaptureDialog();
|
||||
|
||||
capDialog->setInjectMode(false);
|
||||
capDialog->SetInjectMode(false);
|
||||
|
||||
if(ui->toolWindowManager->toolWindows().contains(capDialog))
|
||||
ToolWindowManager::raiseToolWindow(capDialog);
|
||||
if(ui->toolWindowManager->toolWindows().contains(capDialog->Widget()))
|
||||
ToolWindowManager::raiseToolWindow(capDialog->Widget());
|
||||
else
|
||||
ui->toolWindowManager->addToolWindow(capDialog, mainToolArea());
|
||||
ui->toolWindowManager->addToolWindow(capDialog->Widget(), mainToolArea());
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Inject_into_Process_triggered()
|
||||
{
|
||||
CaptureDialog *capDialog = m_Ctx.captureDialog();
|
||||
ICaptureDialog *capDialog = m_Ctx.GetCaptureDialog();
|
||||
|
||||
capDialog->setInjectMode(true);
|
||||
capDialog->SetInjectMode(true);
|
||||
|
||||
if(ui->toolWindowManager->toolWindows().contains(capDialog))
|
||||
ToolWindowManager::raiseToolWindow(capDialog);
|
||||
if(ui->toolWindowManager->toolWindows().contains(capDialog->Widget()))
|
||||
ToolWindowManager::raiseToolWindow(capDialog->Widget());
|
||||
else
|
||||
ui->toolWindowManager->addToolWindow(capDialog, mainToolArea());
|
||||
ui->toolWindowManager->addToolWindow(capDialog->Widget(), mainToolArea());
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Errors_and_Warnings_triggered()
|
||||
{
|
||||
DebugMessageView *debugMessages = m_Ctx.debugMessageView();
|
||||
QWidget *debugMessages = m_Ctx.GetDebugMessageView()->Widget();
|
||||
|
||||
if(ui->toolWindowManager->toolWindows().contains(debugMessages))
|
||||
ToolWindowManager::raiseToolWindow(debugMessages);
|
||||
@@ -1378,7 +1384,7 @@ void MainWindow::on_action_Errors_and_Warnings_triggered()
|
||||
|
||||
void MainWindow::on_action_Statistics_Viewer_triggered()
|
||||
{
|
||||
StatisticsViewer *stats = m_Ctx.statisticsViewer();
|
||||
QWidget *stats = m_Ctx.GetStatisticsViewer()->Widget();
|
||||
|
||||
if(ui->toolWindowManager->toolWindows().contains(stats))
|
||||
ToolWindowManager::raiseToolWindow(stats);
|
||||
@@ -1397,8 +1403,8 @@ void MainWindow::on_action_Resolve_Symbols_triggered()
|
||||
return !running;
|
||||
});
|
||||
|
||||
if(m_Ctx.hasAPIInspector())
|
||||
m_Ctx.apiInspector()->on_apiEvents_itemSelectionChanged();
|
||||
if(m_Ctx.HasAPIInspector())
|
||||
m_Ctx.GetAPIInspector()->Refresh();
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Attach_to_Running_Instance_triggered()
|
||||
|
||||
Reference in New Issue
Block a user