mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4410 Dock Window State : Restore dock widgets when opening main window
This commit is contained in:
parent
a52afd7b34
commit
bfe8e7176a
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -28,6 +28,9 @@ class RicShowMainWindowFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
public:
|
||||
static void showMainWindow();
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
bool isCommandEnabled() override;
|
||||
|
Loading…
Reference in New Issue
Block a user