mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5756 Plot Window : Add message window
This commit is contained in:
parent
bd5ce912fb
commit
a48524eb42
@ -424,8 +424,13 @@ void RiaGuiApplication::initialize()
|
|||||||
RiuPlotMainWindow* plotMainWindow = getOrCreateMainPlotWindow();
|
RiuPlotMainWindow* plotMainWindow = getOrCreateMainPlotWindow();
|
||||||
plotMainWindow->hideAllDockWidgets();
|
plotMainWindow->hideAllDockWidgets();
|
||||||
|
|
||||||
RiaLogging::setLoggerInstance( new RiuMessagePanelLogger( m_mainWindow->messagePanel() ) );
|
{
|
||||||
RiaLogging::loggerInstance()->setLevel( RI_LL_DEBUG );
|
auto logger = new RiuMessagePanelLogger;
|
||||||
|
logger->addMessagePanel( m_mainWindow->messagePanel() );
|
||||||
|
logger->addMessagePanel( m_mainPlotWindow->messagePanel() );
|
||||||
|
RiaLogging::setLoggerInstance( logger );
|
||||||
|
RiaLogging::loggerInstance()->setLevel( RI_LL_DEBUG );
|
||||||
|
}
|
||||||
m_socketServer = new RiaSocketServer( this );
|
m_socketServer = new RiaSocketServer( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1643,7 +1648,7 @@ int RiaGuiApplication::applicationResolution()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiaGuiApplication::startMonitoringWorkProgress( caf::UiProcess* uiProcess )
|
void RiaGuiApplication::startMonitoringWorkProgress( caf::UiProcess* uiProcess )
|
||||||
{
|
{
|
||||||
m_mainWindow->processMonitor()->startMonitorWorkProcess( m_workerProcess );
|
m_mainWindow->processMonitor()->startMonitorWorkProcess( uiProcess );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -108,6 +108,14 @@ QString RiuDockWidgetTools::plotMainWindowPropertyEditorName()
|
|||||||
return "plotMainWindow_dockPropertyEditor";
|
return "plotMainWindow_dockPropertyEditor";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RiuDockWidgetTools::plotMainWindowMessagesName()
|
||||||
|
{
|
||||||
|
return "plotMainWindow_dockMessages";
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -48,6 +48,7 @@ public:
|
|||||||
|
|
||||||
static QString plotMainWindowProjectTreeName();
|
static QString plotMainWindowProjectTreeName();
|
||||||
static QString plotMainWindowPropertyEditorName();
|
static QString plotMainWindowPropertyEditorName();
|
||||||
|
static QString plotMainWindowMessagesName();
|
||||||
|
|
||||||
static QAction* toggleActionForWidget( const QObject* parent, const QString& dockWidgetName );
|
static QAction* toggleActionForWidget( const QObject* parent, const QString& dockWidgetName );
|
||||||
|
|
||||||
|
@ -137,12 +137,19 @@ void RiuMessagePanel::slotClearMessages()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RiuMessagePanelLogger::RiuMessagePanelLogger( RiuMessagePanel* messagePanel )
|
RiuMessagePanelLogger::RiuMessagePanelLogger()
|
||||||
: m_messagePanel( messagePanel )
|
: m_logLevel( RI_LL_WARNING )
|
||||||
, m_logLevel( RI_LL_WARNING )
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuMessagePanelLogger::addMessagePanel( RiuMessagePanel* messagePanel )
|
||||||
|
{
|
||||||
|
m_messagePanel.push_back( messagePanel );
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -201,8 +208,11 @@ void RiuMessagePanelLogger::writeToMessagePanel( RILogLevel messageLevel, const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_messagePanel )
|
for ( auto panel : m_messagePanel )
|
||||||
{
|
{
|
||||||
m_messagePanel->addMessage( messageLevel, message );
|
if ( panel )
|
||||||
|
{
|
||||||
|
panel->addMessage( messageLevel, message );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,9 @@ private:
|
|||||||
class RiuMessagePanelLogger : public RiaLogger
|
class RiuMessagePanelLogger : public RiaLogger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit RiuMessagePanelLogger( RiuMessagePanel* messagePanel );
|
explicit RiuMessagePanelLogger();
|
||||||
|
|
||||||
|
void addMessagePanel( RiuMessagePanel* messagePanel );
|
||||||
|
|
||||||
int level() const override;
|
int level() const override;
|
||||||
void setLevel( int logLevel ) override;
|
void setLevel( int logLevel ) override;
|
||||||
@ -71,6 +73,6 @@ private:
|
|||||||
void writeToMessagePanel( RILogLevel messageLevel, const char* message );
|
void writeToMessagePanel( RILogLevel messageLevel, const char* message );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<RiuMessagePanel> m_messagePanel;
|
std::vector<QPointer<RiuMessagePanel>> m_messagePanel;
|
||||||
int m_logLevel;
|
int m_logLevel;
|
||||||
};
|
};
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include "RiuDockWidgetTools.h"
|
#include "RiuDockWidgetTools.h"
|
||||||
#include "RiuDragDrop.h"
|
#include "RiuDragDrop.h"
|
||||||
#include "RiuMdiSubWindow.h"
|
#include "RiuMdiSubWindow.h"
|
||||||
|
#include "RiuMessagePanel.h"
|
||||||
#include "RiuMultiPlotPage.h"
|
#include "RiuMultiPlotPage.h"
|
||||||
#include "RiuToolTipMenu.h"
|
#include "RiuToolTipMenu.h"
|
||||||
#include "RiuTreeViewEventFilter.h"
|
#include "RiuTreeViewEventFilter.h"
|
||||||
@ -463,6 +464,15 @@ void RiuPlotMainWindow::createDockPanels()
|
|||||||
addDockWidget( Qt::LeftDockWidgetArea, dockWidget );
|
addDockWidget( Qt::LeftDockWidgetArea, dockWidget );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
QDockWidget* dockWidget = new QDockWidget( "Messages", this );
|
||||||
|
dockWidget->setObjectName( RiuDockWidgetTools::plotMainWindowMessagesName() );
|
||||||
|
m_messagePanel = new RiuMessagePanel( dockWidget );
|
||||||
|
dockWidget->setWidget( m_messagePanel );
|
||||||
|
addDockWidget( Qt::BottomDockWidgetArea, dockWidget );
|
||||||
|
dockWidget->hide();
|
||||||
|
}
|
||||||
|
|
||||||
setCorner( Qt::BottomLeftCorner, Qt::LeftDockWidgetArea );
|
setCorner( Qt::BottomLeftCorner, Qt::LeftDockWidgetArea );
|
||||||
setCorner( Qt::BottomRightCorner, Qt::BottomDockWidgetArea );
|
setCorner( Qt::BottomRightCorner, Qt::BottomDockWidgetArea );
|
||||||
|
|
||||||
@ -675,6 +685,14 @@ RicSummaryCurveCalculatorDialog* RiuPlotMainWindow::summaryCurveCalculatorDialog
|
|||||||
return m_summaryCurveCalculatorDialog;
|
return m_summaryCurveCalculatorDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RiuMessagePanel* RiuPlotMainWindow::messagePanel()
|
||||||
|
{
|
||||||
|
return m_messagePanel;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -28,14 +28,14 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
class QMdiSubWindow;
|
|
||||||
|
|
||||||
class RiuViewer;
|
|
||||||
|
|
||||||
struct RimMdiWindowGeometry;
|
struct RimMdiWindowGeometry;
|
||||||
|
|
||||||
|
class QMdiSubWindow;
|
||||||
|
class RiuViewer;
|
||||||
class RimViewWindow;
|
class RimViewWindow;
|
||||||
class RicSummaryPlotEditorDialog;
|
class RicSummaryPlotEditorDialog;
|
||||||
class RicSummaryCurveCalculatorDialog;
|
class RicSummaryCurveCalculatorDialog;
|
||||||
|
class RiuMessagePanel;
|
||||||
|
|
||||||
namespace caf
|
namespace caf
|
||||||
{
|
{
|
||||||
@ -91,6 +91,8 @@ public:
|
|||||||
RicSummaryPlotEditorDialog* summaryCurveCreatorDialog();
|
RicSummaryPlotEditorDialog* summaryCurveCreatorDialog();
|
||||||
RicSummaryCurveCalculatorDialog* summaryCurveCalculatorDialog();
|
RicSummaryCurveCalculatorDialog* summaryCurveCalculatorDialog();
|
||||||
|
|
||||||
|
RiuMessagePanel* messagePanel();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent( QCloseEvent* event ) override;
|
void closeEvent( QCloseEvent* event ) override;
|
||||||
void keyPressEvent( QKeyEvent* ) override;
|
void keyPressEvent( QKeyEvent* ) override;
|
||||||
@ -124,6 +126,7 @@ private:
|
|||||||
|
|
||||||
RiuMdiArea* m_mdiArea;
|
RiuMdiArea* m_mdiArea;
|
||||||
caf::PdmPointer<RimViewWindow> m_activePlotViewWindow;
|
caf::PdmPointer<RimViewWindow> m_activePlotViewWindow;
|
||||||
|
QPointer<RiuMessagePanel> m_messagePanel;
|
||||||
|
|
||||||
QMenu* m_windowMenu;
|
QMenu* m_windowMenu;
|
||||||
|
|
||||||
|
@ -17,7 +17,10 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
#include "RiaGuiApplication.h"
|
||||||
|
|
||||||
|
#include "RiuMessagePanel.h"
|
||||||
|
#include "RiuPlotMainWindow.h"
|
||||||
#include "RiuProcessMonitor.h"
|
#include "RiuProcessMonitor.h"
|
||||||
|
|
||||||
#include "cafUiProcess.h"
|
#include "cafUiProcess.h"
|
||||||
@ -149,6 +152,12 @@ void RiuProcessMonitor::addStringToLog( const QString& sTxt )
|
|||||||
m_textEdit->insertPlainText( sTxt );
|
m_textEdit->insertPlainText( sTxt );
|
||||||
|
|
||||||
m_textEdit->ensureCursorVisible();
|
m_textEdit->ensureCursorVisible();
|
||||||
|
|
||||||
|
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
|
||||||
|
if ( mainPlotWindow && mainPlotWindow->messagePanel() )
|
||||||
|
{
|
||||||
|
mainPlotWindow->messagePanel()->addMessage( RI_LL_INFO, sTxt );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user