mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1380 Major refactor of the management of views to fix the active view problem. Expect some trouble following this.
This commit is contained in:
@@ -1116,6 +1116,25 @@ RimView* RiaApplication::activeReservoirView()
|
||||
return m_activeReservoirView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewWindow* RiaApplication::activePlotWindow() const
|
||||
{
|
||||
RimViewWindow* viewWindow = nullptr;
|
||||
|
||||
if ( m_mainPlotWindow )
|
||||
{
|
||||
QList<QMdiSubWindow*> subwindows = m_mainPlotWindow->subWindowList(QMdiArea::StackingOrder);
|
||||
if ( subwindows.size() > 0 )
|
||||
{
|
||||
viewWindow = RiuInterfaceToViewWindow::viewWindowFromWidget(subwindows.back()->widget());
|
||||
}
|
||||
}
|
||||
|
||||
return viewWindow;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1124,54 +1143,6 @@ void RiaApplication::setActiveReservoirView(RimView* rv)
|
||||
m_activeReservoirView = rv;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::setActiveWellLogPlot(RimWellLogPlot* wlp)
|
||||
{
|
||||
m_activeWellLogPlot = wlp;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogPlot* RiaApplication::activeWellLogPlot()
|
||||
{
|
||||
return m_activeWellLogPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::setActiveSummaryPlot(RimSummaryPlot* sp)
|
||||
{
|
||||
m_activeSummaryPlot = sp;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot* RiaApplication::activeSummaryPlot()
|
||||
{
|
||||
return m_activeSummaryPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::setActiveWellAllocationPlot(RimWellAllocationPlot* wap)
|
||||
{
|
||||
m_activeWellAllocationPlot = wap;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellAllocationPlot* RiaApplication::activeWellAllocationPlot()
|
||||
{
|
||||
return m_activeWellAllocationPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1620,42 +1591,20 @@ RimViewWindow* RiaApplication::activeViewWindow()
|
||||
{
|
||||
RimViewWindow* viewWindow = NULL;
|
||||
|
||||
QWidget* topLevelWidget = RiaApplication::activeWindow();
|
||||
QWidget* mainWindowWidget = RiaApplication::activeWindow();
|
||||
|
||||
if (dynamic_cast<RiuMainWindow*>(topLevelWidget))
|
||||
if (dynamic_cast<RiuMainWindow*>(mainWindowWidget))
|
||||
{
|
||||
viewWindow = RiaApplication::instance()->activeReservoirView();
|
||||
}
|
||||
|
||||
if (dynamic_cast<RiuMainPlotWindow*>(topLevelWidget))
|
||||
else if (dynamic_cast<RiuMainPlotWindow*>(mainWindowWidget))
|
||||
{
|
||||
RiuMainPlotWindow* mainPlotWindow = dynamic_cast<RiuMainPlotWindow*>(topLevelWidget);
|
||||
RiuMainPlotWindow* mainPlotWindow = dynamic_cast<RiuMainPlotWindow*>(mainWindowWidget);
|
||||
|
||||
QList<QMdiSubWindow*> subwindows = mainPlotWindow->subWindowList(QMdiArea::StackingOrder);
|
||||
if (subwindows.size() > 0)
|
||||
{
|
||||
RiuSummaryQwtPlot* summaryQwtPlot = dynamic_cast<RiuSummaryQwtPlot*>(subwindows.back()->widget());
|
||||
if (summaryQwtPlot)
|
||||
{
|
||||
viewWindow = summaryQwtPlot->ownerPlotDefinition();
|
||||
}
|
||||
|
||||
RiuWellLogPlot* wellLogPlot = dynamic_cast<RiuWellLogPlot*>(subwindows.back()->widget());
|
||||
if (wellLogPlot)
|
||||
{
|
||||
viewWindow = wellLogPlot->ownerPlotDefinition();
|
||||
}
|
||||
|
||||
RiuWellAllocationPlot* wellAllocationPlot = dynamic_cast<RiuWellAllocationPlot*>(subwindows.back()->widget());
|
||||
if (wellAllocationPlot)
|
||||
{
|
||||
viewWindow = wellAllocationPlot->ownerPlotDefinition();
|
||||
}
|
||||
|
||||
RiuFlowCharacteristicsPlot* flowCharacteristicsPlot = dynamic_cast<RiuFlowCharacteristicsPlot*>(subwindows.back()->widget());
|
||||
if (flowCharacteristicsPlot)
|
||||
{
|
||||
viewWindow = flowCharacteristicsPlot->ownerPlotDefinition();
|
||||
}
|
||||
viewWindow = RiuInterfaceToViewWindow::viewWindowFromWidget(subwindows.back()->widget());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user