Added ShowPlotWindow feature

This commit is contained in:
Magne Sjaastad 2016-06-27 15:27:18 +02:00
parent 119881dc7d
commit 3b55f98dbd
6 changed files with 122 additions and 13 deletions

View File

@ -203,6 +203,8 @@ RiaApplication::RiaApplication(int& argc, char** argv)
//--------------------------------------------------------------------------------------------------
RiaApplication::~RiaApplication()
{
deleteMainPlotWindow();
delete m_preferences;
}
@ -692,11 +694,8 @@ bool RiaApplication::closeProject(bool askToSaveIfDirty)
if (m_mainPlotWindow)
{
m_mainPlotWindow->cleanupGuiBeforeProjectClose();
deleteMainPlotWindow();
}
caf::EffectGenerator::clearEffectCache();
m_project->close();
@ -1329,7 +1328,10 @@ RiuMainPlotWindow* RiaApplication::getOrCreateAndShowMainPlotWindow()
createMainPlotWindow();
}
m_mainPlotWindow->showWindow();
if (!m_mainPlotWindow->isVisible())
{
m_mainPlotWindow->show();
}
return m_mainPlotWindow;
}

View File

@ -42,6 +42,7 @@ ${CEE_CURRENT_LIST_DIR}RicComputeStatisticsFeature.h
${CEE_CURRENT_LIST_DIR}RicWellLogsImportFileFeature.h
${CEE_CURRENT_LIST_DIR}RicTileWindowsFeature.h
${CEE_CURRENT_LIST_DIR}RicShowPlotWindowFeature.h
${CEE_CURRENT_LIST_DIR}RicLaunchUnitTestsFeature.h
${CEE_CURRENT_LIST_DIR}RicExportToLasFileFeature.h
${CEE_CURRENT_LIST_DIR}RicImportInputEclipseCaseOpmFeature.h
@ -89,6 +90,7 @@ ${CEE_CURRENT_LIST_DIR}RicNewStatisticsCaseFeature.cpp
${CEE_CURRENT_LIST_DIR}RicComputeStatisticsFeature.cpp
${CEE_CURRENT_LIST_DIR}RicTileWindowsFeature.cpp
${CEE_CURRENT_LIST_DIR}RicShowPlotWindowFeature.cpp
${CEE_CURRENT_LIST_DIR}RicLaunchUnitTestsFeature.cpp
${CEE_CURRENT_LIST_DIR}RicExportToLasFileFeature.cpp
${CEE_CURRENT_LIST_DIR}RicImportInputEclipseCaseOpmFeature.cpp

View File

@ -0,0 +1,50 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicShowPlotWindowFeature.h"
#include "RiaApplication.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicShowPlotWindowFeature, "RicShowPlotWindowFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicShowPlotWindowFeature::isCommandEnabled()
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowPlotWindowFeature::onActionTriggered(bool isChecked)
{
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowPlotWindowFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Show Plot Window");
actionToSetup->setIcon(QIcon(":/SummaryPlots16x16.png"));
}

View File

@ -0,0 +1,38 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
//==================================================================================================
///
//==================================================================================================
class RicShowPlotWindowFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
virtual bool isCommandEnabled();
virtual void onActionTriggered( bool isChecked );
virtual void setupActionLook( QAction* actionToSetup );
};

View File

@ -160,12 +160,23 @@ void RiuMainPlotWindow::createMenus()
//--------------------------------------------------------------------------------------------------
void RiuMainPlotWindow::createToolBars()
{
// Snapshots
QToolBar* toolbar = addToolBar(tr("View Snapshots"));
toolbar->setObjectName(toolbar->windowTitle());
toolbar->addAction(m_snapshotToClipboard);
toolbar->addAction(m_snapshotToFile);
toolbar->addAction(m_snapshotAllViewsToFile);
{
// Snapshots
QToolBar* toolbar = addToolBar(tr("View Snapshots"));
toolbar->setObjectName(toolbar->windowTitle());
toolbar->addAction(m_snapshotToClipboard);
toolbar->addAction(m_snapshotToFile);
toolbar->addAction(m_snapshotAllViewsToFile);
}
caf::CmdFeatureManager* cmdFeatureMgr = caf::CmdFeatureManager::instance();
CVF_ASSERT(cmdFeatureMgr);
{
QToolBar* toolbar = addToolBar(tr("Window Management"));
toolbar->setObjectName(toolbar->windowTitle());
toolbar->addAction(cmdFeatureMgr->action("RicTileWindowsFeature"));
}
}

View File

@ -509,9 +509,6 @@ void RiuMainWindow::createToolBars()
m_viewToolBar->addAction(m_viewFromAbove);
m_viewToolBar->addAction(m_viewFromBelow);
m_viewToolBar->addSeparator();
m_viewToolBar->addAction(cmdFeatureMgr->action("RicLinkVisibleViewsFeature"));
m_viewToolBar->addAction(cmdFeatureMgr->action("RicTileWindowsFeature"));
m_viewToolBar->addSeparator();
m_viewToolBar->addAction(m_drawStyleLinesAction);
m_viewToolBar->addAction(m_drawStyleLinesSolidAction);
m_viewToolBar->addAction(m_drawStyleSurfOnlyAction);
@ -535,6 +532,15 @@ void RiuMainWindow::createToolBars()
addToolBar(m_animationToolBar);
//connect(m_animationToolBar, SIGNAL(signalFrameRateChanged(double)), SLOT(slotFramerateChanged(double)));
{
// Snapshots
QToolBar* toolbar = addToolBar(tr("Window Management"));
toolbar->setObjectName(toolbar->windowTitle());
toolbar->addAction(cmdFeatureMgr->action("RicLinkVisibleViewsFeature"));
toolbar->addAction(cmdFeatureMgr->action("RicTileWindowsFeature"));
toolbar->addAction(cmdFeatureMgr->action("RicShowPlotWindowFeature"));
}
refreshAnimationActions();
refreshDrawStyleActions();
}