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);
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016 Statoil ASA
|
||||
//
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@ -27,24 +27,12 @@
|
||||
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,14 +45,29 @@ void RicShowMainWindowFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
mainWnd->raise();
|
||||
|
||||
if (triggerReloadOfDockWindowVisibilities)
|
||||
{
|
||||
mainWnd->restoreDockWidgetVisibilities();
|
||||
}
|
||||
mainWnd->restoreDockWidgetVisibilities();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicShowMainWindowFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowMainWindowFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
this->disableModelChangeContribution();
|
||||
|
||||
RicShowMainWindowFeature::showMainWindow();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowMainWindowFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
|
@ -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