#4410 Dock Window State : Restore dock widgets when opening main window

This commit is contained in:
Magne Sjaastad 2019-05-15 13:54:05 +02:00
parent a52afd7b34
commit bfe8e7176a
3 changed files with 35 additions and 24 deletions

View File

@ -18,6 +18,8 @@
#include "RiaImportEclipseCaseTools.h"
#include "ApplicationCommands/RicShowMainWindowFeature.h"
#include "SummaryPlotCommands/RicNewSummaryPlotFeature.h"
#include "SummaryPlotCommands/RicNewSummaryCurveFeature.h"
@ -275,7 +277,10 @@ bool RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl(const QStr
return false;
}
RiuMainWindow::instance()->show();
if (RiaGuiApplication::isRunning())
{
RicShowMainWindowFeature::showMainWindow();
}
analysisModels->cases.push_back(rimResultReservoir);

View File

@ -29,22 +29,10 @@ CAF_CMD_SOURCE_INIT(RicShowMainWindowFeature, "RicShowMainWindowFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicShowMainWindowFeature::isCommandEnabled()
void RicShowMainWindowFeature::showMainWindow()
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowMainWindowFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiuMainWindow* mainWnd = RiuMainWindow::instance();
bool triggerReloadOfDockWindowVisibilities = !mainWnd->isVisible();
if (mainWnd->isMinimized())
{
mainWnd->showNormal();
@ -57,10 +45,25 @@ void RicShowMainWindowFeature::onActionTriggered(bool isChecked)
mainWnd->raise();
if (triggerReloadOfDockWindowVisibilities)
{
mainWnd->restoreDockWidgetVisibilities();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicShowMainWindowFeature::isCommandEnabled()
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowMainWindowFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RicShowMainWindowFeature::showMainWindow();
}
//--------------------------------------------------------------------------------------------------

View File

@ -28,6 +28,9 @@ class RicShowMainWindowFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
public:
static void showMainWindow();
protected:
// Overrides
bool isCommandEnabled() override;