Regression Test : Do not show warning/error dock window

This commit is contained in:
Magne Sjaastad 2018-03-24 14:59:07 +01:00
parent bffc50b826
commit 1a6c529488

View File

@ -18,6 +18,8 @@
#include "RiuMessagePanel.h"
#include "RiaRegressionTestRunner.h"
#include <QDockWidget>
#include <QMenu>
#include <QPlainTextEdit>
@ -71,12 +73,15 @@ void RiuMessagePanel::addMessage(RILogLevel messageLevel, const QString& msg)
m_textEdit->moveCursor(QTextCursor::End);
m_textEdit->ensureCursorVisible();
if (messageLevel == RI_LL_ERROR || messageLevel == RI_LL_WARNING)
if (!RiaRegressionTestRunner::instance()->isRunningRegressionTests())
{
QDockWidget* parentDockWidget = dynamic_cast<QDockWidget*>(this->parent());
if (parentDockWidget && !parentDockWidget->isVisible())
if (messageLevel == RI_LL_ERROR || messageLevel == RI_LL_WARNING)
{
parentDockWidget->toggleViewAction()->trigger();
QDockWidget* parentDockWidget = dynamic_cast<QDockWidget*>(this->parent());
if (parentDockWidget && !parentDockWidget->isVisible())
{
parentDockWidget->toggleViewAction()->trigger();
}
}
}
}