Allow qrenderdoc command line python scripts to call sys.exit()

* Previously we'd catch the sys.exit "exception" and print it then show the
  window.
This commit is contained in:
baldurk
2020-08-31 13:10:38 +01:00
parent d5f45f6476
commit b5a6796240
3 changed files with 60 additions and 41 deletions
+24 -22
View File
@@ -63,9 +63,7 @@
#include "pipestate.inl"
CaptureContext::CaptureContext(QString paramFilename, QString remoteHost, uint32_t remoteIdent,
bool temp, PersistantConfig &cfg)
: m_Config(cfg)
CaptureContext::CaptureContext(PersistantConfig &cfg) : m_Config(cfg)
{
m_CaptureLoaded = false;
m_LoadInProgress = false;
@@ -90,25 +88,6 @@ CaptureContext::CaptureContext(QString paramFilename, QString remoteHost, uint32
m_Icon->addFile(QStringLiteral(":/logo.svg"), QSize(), QIcon::Normal, QIcon::Off);
m_MainWindow = new MainWindow(*this);
m_MainWindow->show();
if(remoteIdent != 0)
{
m_MainWindow->ShowLiveCapture(
new LiveCapture(*this, remoteHost, remoteHost, remoteIdent, m_MainWindow, m_MainWindow));
}
if(!paramFilename.isEmpty())
{
QFileInfo checkFile(paramFilename);
if(checkFile.exists() && checkFile.isFile())
{
m_MainWindow->LoadFromFilename(paramFilename, temp);
if(temp)
m_MainWindow->takeCaptureOwnership();
}
}
{
QDir dir(configFilePath("extensions"));
@@ -137,6 +116,29 @@ CaptureContext::~CaptureContext()
delete m_MainWindow;
}
void CaptureContext::Begin(QString paramFilename, QString remoteHost, uint32_t remoteIdent, bool temp)
{
m_MainWindow->show();
if(remoteIdent != 0)
{
m_MainWindow->ShowLiveCapture(
new LiveCapture(*this, remoteHost, remoteHost, remoteIdent, m_MainWindow, m_MainWindow));
}
if(!paramFilename.isEmpty())
{
QFileInfo checkFile(paramFilename);
if(checkFile.exists() && checkFile.isFile())
{
m_MainWindow->LoadFromFilename(paramFilename, temp);
if(temp)
m_MainWindow->takeCaptureOwnership();
}
}
}
bool CaptureContext::isRunning()
{
return m_MainWindow && m_MainWindow->isVisible();