mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 23:23:01 -06:00
#1406 Automatically show process monitor when executing script
This commit is contained in:
parent
2edbffdba5
commit
224211f765
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include "RimCalcScript.h"
|
#include "RimCalcScript.h"
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
@ -49,6 +50,9 @@ void RicExecuteScriptFeature::onActionTriggered(bool isChecked)
|
|||||||
std::vector<RimCalcScript*> selection = RicScriptFeatureImpl::selectedScripts();
|
std::vector<RimCalcScript*> selection = RicScriptFeatureImpl::selectedScripts();
|
||||||
CVF_ASSERT(selection.size() > 0);
|
CVF_ASSERT(selection.size() > 0);
|
||||||
|
|
||||||
|
RiuMainWindow* mainWindow = RiuMainWindow::instance();
|
||||||
|
mainWindow->showProcessMonitorDockPanel();
|
||||||
|
|
||||||
RimCalcScript* calcScript = selection[0];
|
RimCalcScript* calcScript = selection[0];
|
||||||
|
|
||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
|
@ -73,6 +73,8 @@
|
|||||||
#include <QUndoStack>
|
#include <QUndoStack>
|
||||||
|
|
||||||
|
|
||||||
|
#define DOCK_PANEL_NAME_PROCESS_MONITOR "dockProcessMonitor"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
@ -571,7 +573,7 @@ void RiuMainWindow::createDockPanels()
|
|||||||
|
|
||||||
{
|
{
|
||||||
QDockWidget* dockPanel = new QDockWidget("Process Monitor", this);
|
QDockWidget* dockPanel = new QDockWidget("Process Monitor", this);
|
||||||
dockPanel->setObjectName("dockProcessMonitor");
|
dockPanel->setObjectName(DOCK_PANEL_NAME_PROCESS_MONITOR);
|
||||||
dockPanel->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea);
|
dockPanel->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea);
|
||||||
m_processMonitor = new RiuProcessMonitor(dockPanel);
|
m_processMonitor = new RiuProcessMonitor(dockPanel);
|
||||||
dockPanel->setWidget(m_processMonitor);
|
dockPanel->setWidget(m_processMonitor);
|
||||||
@ -1444,6 +1446,31 @@ void RiuMainWindow::restoreTreeViewState()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuMainWindow::showDockPanel(const QString &dockPanelName)
|
||||||
|
{
|
||||||
|
QList<QDockWidget*> dockWidgets = findChildren<QDockWidget*>();
|
||||||
|
|
||||||
|
foreach (QDockWidget* dock, dockWidgets)
|
||||||
|
{
|
||||||
|
if (dock && dock->objectName() == dockPanelName)
|
||||||
|
{
|
||||||
|
dock->show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuMainWindow::showProcessMonitorDockPanel()
|
||||||
|
{
|
||||||
|
showDockPanel(DOCK_PANEL_NAME_PROCESS_MONITOR);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -114,6 +114,8 @@ public:
|
|||||||
RiuResultQwtPlot* resultPlot();
|
RiuResultQwtPlot* resultPlot();
|
||||||
RiuMessagePanel* messagePanel();
|
RiuMessagePanel* messagePanel();
|
||||||
|
|
||||||
|
void showProcessMonitorDockPanel();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void closeEvent(QCloseEvent* event);
|
virtual void closeEvent(QCloseEvent* event);
|
||||||
|
|
||||||
@ -125,6 +127,8 @@ private:
|
|||||||
|
|
||||||
void restoreTreeViewState();
|
void restoreTreeViewState();
|
||||||
|
|
||||||
|
void showDockPanel(const QString& dockPanelName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static RiuMainWindow* sm_mainWindowInstance;
|
static RiuMainWindow* sm_mainWindowInstance;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user