mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix crash if main window is null
When launching a script, the main window must be created. It is the Process Monitor that received info from the process and passes the text to process monitor and Message Panel.
This commit is contained in:
parent
8b7144d987
commit
35e2e43c3a
@ -19,6 +19,8 @@
|
||||
|
||||
#include "RicExecuteScriptFeature.h"
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
|
||||
#include "RicExecuteLastUsedScriptFeature.h"
|
||||
#include "RicScriptFeatureImpl.h"
|
||||
|
||||
@ -75,6 +77,15 @@ void RicExecuteScriptFeature::setupActionLook( QAction* actionToSetup )
|
||||
void RicExecuteScriptFeature::executeScript( RimCalcScript* calcScript )
|
||||
{
|
||||
RiuMainWindow* mainWindow = RiuMainWindow::instance();
|
||||
if ( !mainWindow )
|
||||
{
|
||||
// It is required to have a main window for the process monitor. If the process monitor is not present, no text can be displayed in
|
||||
// message window, and text feedback from script is not possible to see in the user interface.
|
||||
|
||||
RiaGuiApplication* app = RiaGuiApplication::instance();
|
||||
mainWindow = app->getOrCreateAndShowMainWindow();
|
||||
}
|
||||
|
||||
mainWindow->showProcessMonitorDockPanel();
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
Loading…
Reference in New Issue
Block a user