mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added ShowPlotWindow feature
This commit is contained in:
parent
119881dc7d
commit
3b55f98dbd
@ -203,6 +203,8 @@ RiaApplication::RiaApplication(int& argc, char** argv)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RiaApplication::~RiaApplication()
|
RiaApplication::~RiaApplication()
|
||||||
{
|
{
|
||||||
|
deleteMainPlotWindow();
|
||||||
|
|
||||||
delete m_preferences;
|
delete m_preferences;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -692,11 +694,8 @@ bool RiaApplication::closeProject(bool askToSaveIfDirty)
|
|||||||
if (m_mainPlotWindow)
|
if (m_mainPlotWindow)
|
||||||
{
|
{
|
||||||
m_mainPlotWindow->cleanupGuiBeforeProjectClose();
|
m_mainPlotWindow->cleanupGuiBeforeProjectClose();
|
||||||
|
|
||||||
deleteMainPlotWindow();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
caf::EffectGenerator::clearEffectCache();
|
caf::EffectGenerator::clearEffectCache();
|
||||||
m_project->close();
|
m_project->close();
|
||||||
|
|
||||||
@ -1329,7 +1328,10 @@ RiuMainPlotWindow* RiaApplication::getOrCreateAndShowMainPlotWindow()
|
|||||||
createMainPlotWindow();
|
createMainPlotWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_mainPlotWindow->showWindow();
|
if (!m_mainPlotWindow->isVisible())
|
||||||
|
{
|
||||||
|
m_mainPlotWindow->show();
|
||||||
|
}
|
||||||
|
|
||||||
return m_mainPlotWindow;
|
return m_mainPlotWindow;
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ ${CEE_CURRENT_LIST_DIR}RicComputeStatisticsFeature.h
|
|||||||
${CEE_CURRENT_LIST_DIR}RicWellLogsImportFileFeature.h
|
${CEE_CURRENT_LIST_DIR}RicWellLogsImportFileFeature.h
|
||||||
|
|
||||||
${CEE_CURRENT_LIST_DIR}RicTileWindowsFeature.h
|
${CEE_CURRENT_LIST_DIR}RicTileWindowsFeature.h
|
||||||
|
${CEE_CURRENT_LIST_DIR}RicShowPlotWindowFeature.h
|
||||||
${CEE_CURRENT_LIST_DIR}RicLaunchUnitTestsFeature.h
|
${CEE_CURRENT_LIST_DIR}RicLaunchUnitTestsFeature.h
|
||||||
${CEE_CURRENT_LIST_DIR}RicExportToLasFileFeature.h
|
${CEE_CURRENT_LIST_DIR}RicExportToLasFileFeature.h
|
||||||
${CEE_CURRENT_LIST_DIR}RicImportInputEclipseCaseOpmFeature.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}RicComputeStatisticsFeature.cpp
|
||||||
|
|
||||||
${CEE_CURRENT_LIST_DIR}RicTileWindowsFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicTileWindowsFeature.cpp
|
||||||
|
${CEE_CURRENT_LIST_DIR}RicShowPlotWindowFeature.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RicLaunchUnitTestsFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicLaunchUnitTestsFeature.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RicExportToLasFileFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicExportToLasFileFeature.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RicImportInputEclipseCaseOpmFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicImportInputEclipseCaseOpmFeature.cpp
|
||||||
|
50
ApplicationCode/Commands/RicShowPlotWindowFeature.cpp
Normal file
50
ApplicationCode/Commands/RicShowPlotWindowFeature.cpp
Normal 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"));
|
||||||
|
}
|
38
ApplicationCode/Commands/RicShowPlotWindowFeature.h
Normal file
38
ApplicationCode/Commands/RicShowPlotWindowFeature.h
Normal 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 );
|
||||||
|
};
|
||||||
|
|
||||||
|
|
@ -160,12 +160,23 @@ void RiuMainPlotWindow::createMenus()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMainPlotWindow::createToolBars()
|
void RiuMainPlotWindow::createToolBars()
|
||||||
{
|
{
|
||||||
// Snapshots
|
{
|
||||||
QToolBar* toolbar = addToolBar(tr("View Snapshots"));
|
// Snapshots
|
||||||
toolbar->setObjectName(toolbar->windowTitle());
|
QToolBar* toolbar = addToolBar(tr("View Snapshots"));
|
||||||
toolbar->addAction(m_snapshotToClipboard);
|
toolbar->setObjectName(toolbar->windowTitle());
|
||||||
toolbar->addAction(m_snapshotToFile);
|
toolbar->addAction(m_snapshotToClipboard);
|
||||||
toolbar->addAction(m_snapshotAllViewsToFile);
|
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"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -509,9 +509,6 @@ void RiuMainWindow::createToolBars()
|
|||||||
m_viewToolBar->addAction(m_viewFromAbove);
|
m_viewToolBar->addAction(m_viewFromAbove);
|
||||||
m_viewToolBar->addAction(m_viewFromBelow);
|
m_viewToolBar->addAction(m_viewFromBelow);
|
||||||
m_viewToolBar->addSeparator();
|
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_drawStyleLinesAction);
|
||||||
m_viewToolBar->addAction(m_drawStyleLinesSolidAction);
|
m_viewToolBar->addAction(m_drawStyleLinesSolidAction);
|
||||||
m_viewToolBar->addAction(m_drawStyleSurfOnlyAction);
|
m_viewToolBar->addAction(m_drawStyleSurfOnlyAction);
|
||||||
@ -535,6 +532,15 @@ void RiuMainWindow::createToolBars()
|
|||||||
addToolBar(m_animationToolBar);
|
addToolBar(m_animationToolBar);
|
||||||
//connect(m_animationToolBar, SIGNAL(signalFrameRateChanged(double)), SLOT(slotFramerateChanged(double)));
|
//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();
|
refreshAnimationActions();
|
||||||
refreshDrawStyleActions();
|
refreshDrawStyleActions();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user