#846 Store window state for mainwindows in project and moved features into ApplicationCommands

This commit is contained in:
Magne Sjaastad
2016-10-04 14:23:34 +02:00
parent 1080de473a
commit 2d5295cf74
16 changed files with 102 additions and 14 deletions

View File

@@ -48,6 +48,7 @@
#include "RimWellPathImport.h"
#include "RiuMainWindow.h"
#include "RiuMainPlotWindow.h"
#include "OctaveScriptCommands/RicExecuteScriptForCasesFeature.h"
@@ -102,6 +103,12 @@ RimProject::RimProject(void)
CAF_PDM_InitFieldNoDefault(&currentModelIndexPath, "TreeViewCurrentModelIndexPath", "", "", "", "");
currentModelIndexPath.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&m_show3DWindow, "show3DWindow", true, "Show 3D Window", "", "", "");
m_show3DWindow.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&m_showPlotWindow, "showPlotWindow", false, "Show Plot Window", "", "", "");
m_showPlotWindow.uiCapability()->setUiHidden(true);
// Obsolete fields. The content is moved to OilFields and friends
CAF_PDM_InitFieldNoDefault(&casesObsolete, "Reservoirs", "", "", "", "");
casesObsolete.uiCapability()->setUiHidden(true);
@@ -324,6 +331,18 @@ void RimProject::initAfterRead()
//--------------------------------------------------------------------------------------------------
void RimProject::setupBeforeSave()
{
m_show3DWindow = RiuMainWindow::instance()->isVisible();
if (RiaApplication::instance()->mainPlotWindow() &&
RiaApplication::instance()->mainPlotWindow()->isVisible())
{
m_showPlotWindow = true;
}
else
{
m_showPlotWindow = false;
}
m_projectFileVersionString = STRPRODUCTVER;
}
@@ -706,6 +725,22 @@ void RimProject::actionsBasedOnSelection(QMenu& contextMenu)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimProject::show3DWindow() const
{
return m_show3DWindow;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimProject::showPlotWindow() const
{
return m_showPlotWindow;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------