Wired up application logic related to new RiuMainPlotWindow

This commit is contained in:
Magne Sjaastad
2016-06-27 11:07:01 +02:00
parent e92624a862
commit bbf1574feb
12 changed files with 194 additions and 92 deletions

View File

@@ -143,23 +143,14 @@ RiuMainPlotWindow::RiuMainPlotWindow()
// When enableUndoCommandSystem is set false, all commands are executed and deleted immediately
//caf::CmdExecCommandManager::instance()->enableUndoCommandSystem(true);
{
setWindowTitle("Summary Plots for ResInsight");
setDefaultWindowSize();
loadWinGeoAndDockToolBarLayout();
showWindow();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuMainPlotWindow* RiuMainPlotWindow::instance()
RiuMainPlotWindow::~RiuMainPlotWindow()
{
static RiuMainPlotWindow staticInstance;
return &staticInstance;
delete m_dragDropInterface;
}
//--------------------------------------------------------------------------------------------------
@@ -211,14 +202,6 @@ void RiuMainPlotWindow::cleanupGuiBeforeProjectClose()
//--------------------------------------------------------------------------------------------------
void RiuMainPlotWindow::closeEvent(QCloseEvent* event)
{
if (!RiaApplication::instance()->closeProject(true))
{
event->ignore();
return;
}
delete m_dragDropInterface;
saveWinGeoAndDockToolBarLayout();
event->accept();
@@ -578,6 +561,8 @@ void RiuMainPlotWindow::createDockPanels()
connect(m_projectTreeView, SIGNAL(selectionChanged()), this, SLOT(selectedObjectsChanged()));
m_projectTreeView->treeView()->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_projectTreeView->treeView(), SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(customMenuRequested(const QPoint&)));
m_projectTreeView->setUiConfigurationName("PlotWindow");
}
/*

View File

@@ -72,7 +72,7 @@ class RiuMainPlotWindow : public RiuMainWindowBase
public:
RiuMainPlotWindow();
static RiuMainPlotWindow* instance();
~RiuMainPlotWindow();
virtual QString mainWindowName() { return "RiuMainPlotWindow"; }
@@ -289,8 +289,6 @@ private:
caf::PdmUiDragDropInterface* m_dragDropInterface;
QUndoView* m_undoView;
caf::PdmObject* m_pdmRoot;
caf::PdmUiPropertyView* m_pdmUiPropertyView;

View File

@@ -18,11 +18,14 @@
#include "RiuMdiSubWindow.h"
#include "RiaApplication.h"
#include "RimSummaryPlot.h"
#include "RimView.h"
#include "RimWellLogPlot.h"
#include "RiuMainPlotWindow.h"
#include "RiuMainWindow.h"
#include "RiuSummaryQwtPlot.h"
#include "RiuViewer.h"
#include "RiuWellLogPlot.h"
@@ -40,7 +43,12 @@ RiuMdiSubWindow::RiuMdiSubWindow(QWidget* parent /*= 0*/, Qt::WindowFlags flags
//--------------------------------------------------------------------------------------------------
RiuMdiSubWindow::~RiuMdiSubWindow()
{
RiuMainPlotWindow::instance()->slotRefreshViewActions();
RiuMainWindow::instance()->slotRefreshViewActions();
if (RiaApplication::instance()->mainPlotWindow())
{
RiaApplication::instance()->mainPlotWindow()->slotRefreshViewActions();
}
}
//--------------------------------------------------------------------------------------------------
@@ -54,18 +62,24 @@ void RiuMdiSubWindow::closeEvent(QCloseEvent* event)
RiuSummaryQwtPlot* summaryPlot = dynamic_cast<RiuSummaryQwtPlot*>(mainWidget);
if (wellLogPlot)
{
wellLogPlot->ownerPlotDefinition()->setMdiWindowGeometry(RiuMainPlotWindow::instance()->windowGeometryForWidget(this));
RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
CVF_ASSERT(mainPlotWindow);
wellLogPlot->ownerPlotDefinition()->setMdiWindowGeometry(mainPlotWindow->windowGeometryForWidget(this));
}
else if (summaryPlot)
{
summaryPlot->ownerPlotDefinition()->setMdiWindowGeometry(RiuMainPlotWindow::instance()->windowGeometryForWidget(this));
RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
CVF_ASSERT(mainPlotWindow);
summaryPlot->ownerPlotDefinition()->setMdiWindowGeometry(mainPlotWindow->windowGeometryForWidget(this));
}
else
{
RiuViewer* viewer = mainWidget->findChild<RiuViewer*>();
if (viewer)
{
viewer->ownerReservoirView()->setMdiWindowGeometry(RiuMainPlotWindow::instance()->windowGeometryForWidget(this));
viewer->ownerReservoirView()->setMdiWindowGeometry(RiuMainWindow::instance()->windowGeometryForWidget(this));
}
}