mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4173 Fix problems with saving state when closing 3d Window before closing plot window
This commit is contained in:
@@ -108,9 +108,6 @@
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
|
||||
RiuMainWindow* RiuMainWindow::sm_mainWindowInstance = nullptr;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -123,8 +120,6 @@ RiuMainWindow::RiuMainWindow()
|
||||
m_blockSlotSubWindowActivated(false),
|
||||
m_holoLensToolBar(nullptr)
|
||||
{
|
||||
CVF_ASSERT(sm_mainWindowInstance == nullptr);
|
||||
|
||||
m_mdiArea = new QMdiArea;
|
||||
m_mdiArea->setOption(QMdiArea::DontMaximizeSubWindowOnActivation, true);
|
||||
connect(m_mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow *)), SLOT(slotSubWindowActivated(QMdiSubWindow*)));
|
||||
@@ -140,8 +135,6 @@ RiuMainWindow::RiuMainWindow()
|
||||
// Store the layout so we can offer reset option
|
||||
m_initialDockAndToolbarLayout = saveState(0);
|
||||
|
||||
sm_mainWindowInstance = this;
|
||||
|
||||
m_dragDropInterface = std::unique_ptr<caf::PdmUiDragDropInterface>(new RiuDragDrop());
|
||||
|
||||
initializeGuiNewProjectLoaded();
|
||||
@@ -175,7 +168,7 @@ RiuMainWindow::RiuMainWindow()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuMainWindow* RiuMainWindow::instance()
|
||||
{
|
||||
return sm_mainWindowInstance;
|
||||
return RiaApplication::instance()->mainWindow();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -267,6 +260,8 @@ void RiuMainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
||||
app->saveMainWinGeoAndDockToolBarLayout();
|
||||
|
||||
if (app->isMainPlotWindowVisible())
|
||||
{
|
||||
return;
|
||||
@@ -278,9 +273,7 @@ void RiuMainWindow::closeEvent(QCloseEvent* event)
|
||||
return;
|
||||
}
|
||||
|
||||
app->saveWinGeoAndDockToolBarLayout();
|
||||
|
||||
if (!app->tryClosePlotWindow()) return;
|
||||
app->closeMainPlotWindowIfOpenButHidden();
|
||||
|
||||
app->closeProject();
|
||||
}
|
||||
|
||||
@@ -165,6 +165,8 @@ void RiuPlotMainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
||||
app->savePlotWinGeoAndDockToolBarLayout();
|
||||
|
||||
if (app->isMain3dWindowVisible())
|
||||
{
|
||||
return;
|
||||
@@ -176,9 +178,7 @@ void RiuPlotMainWindow::closeEvent(QCloseEvent* event)
|
||||
return;
|
||||
}
|
||||
|
||||
app->saveWinGeoAndDockToolBarLayout();
|
||||
|
||||
if (!app->tryCloseMainWindow()) return;
|
||||
app->closeMainWindowIfOpenButHidden();
|
||||
|
||||
app->closeProject();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user