#1406 Automatically show process monitor when executing script

This commit is contained in:
Bjørnar Grip Fjær 2017-04-07 09:21:26 +02:00
parent 2edbffdba5
commit 224211f765
3 changed files with 36 additions and 1 deletions

View File

@ -23,6 +23,7 @@
#include "RimCalcScript.h"
#include "RiaApplication.h"
#include "RiuMainWindow.h"
#include "cafSelectionManager.h"
#include "cvfAssert.h"
@ -49,6 +50,9 @@ void RicExecuteScriptFeature::onActionTriggered(bool isChecked)
std::vector<RimCalcScript*> selection = RicScriptFeatureImpl::selectedScripts();
CVF_ASSERT(selection.size() > 0);
RiuMainWindow* mainWindow = RiuMainWindow::instance();
mainWindow->showProcessMonitorDockPanel();
RimCalcScript* calcScript = selection[0];
RiaApplication* app = RiaApplication::instance();

View File

@ -73,6 +73,8 @@
#include <QUndoStack>
#define DOCK_PANEL_NAME_PROCESS_MONITOR "dockProcessMonitor"
//==================================================================================================
@ -571,7 +573,7 @@ void RiuMainWindow::createDockPanels()
{
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);
m_processMonitor = new RiuProcessMonitor(dockPanel);
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);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -114,6 +114,8 @@ public:
RiuResultQwtPlot* resultPlot();
RiuMessagePanel* messagePanel();
void showProcessMonitorDockPanel();
protected:
virtual void closeEvent(QCloseEvent* event);
@ -125,6 +127,8 @@ private:
void restoreTreeViewState();
void showDockPanel(const QString& dockPanelName);
private:
static RiuMainWindow* sm_mainWindowInstance;