#2535 Use the MainWindowTools class instead of MainWindow directly (part 1)

This commit is contained in:
Jacob Støren
2018-02-27 15:21:14 +01:00
parent 43dc25eca0
commit d74807d669
29 changed files with 90 additions and 100 deletions

View File

@@ -25,7 +25,7 @@
#include "RimProject.h"
#include "RimFlowCharacteristicsPlot.h"
#include "RiuMainPlotWindow.h"
#include "RiuPlotMainWindowTools.h"
#include "cafSelectionManager.h"
@@ -79,12 +79,10 @@ void RicAddStoredFlowCharacteristicsPlotFeature::onActionTriggered(bool isChecke
flowPlotColl->updateConnectedEditors();
RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
if (mainPlotWindow)
{
mainPlotWindow->selectAsCurrentItem(flowCharacteristicsPlot);
mainPlotWindow->setExpanded(flowCharacteristicsPlot);
}
RiuPlotMainWindowTools::showPlotMainWindow();
RiuPlotMainWindowTools::selectAsCurrentItem(flowCharacteristicsPlot);
RiuPlotMainWindowTools::setExpanded(flowCharacteristicsPlot);
}
}
}

View File

@@ -25,7 +25,7 @@
#include "RimProject.h"
#include "RimWellAllocationPlot.h"
#include "RiuMainPlotWindow.h"
#include "RiuPlotMainWindowTools.h"
#include "cafSelectionManager.h"
@@ -79,12 +79,8 @@ void RicAddStoredWellAllocationPlotFeature::onActionTriggered(bool isChecked)
flowPlotColl->updateConnectedEditors();
RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
if (mainPlotWindow)
{
mainPlotWindow->selectAsCurrentItem(wellAllocationPlot);
mainPlotWindow->setExpanded(wellAllocationPlot);
}
RiuPlotMainWindowTools::selectAsCurrentItem(wellAllocationPlot);
RiuPlotMainWindowTools::setExpanded(wellAllocationPlot);
}
}
}

View File

@@ -41,7 +41,6 @@
#include "RiaSummaryTools.h"
#include "RiuMainPlotWindow.h"
#include "RiuMainWindow.h"
#include "cafSelectionManager.h"

View File

@@ -32,7 +32,7 @@
#include "RimProject.h"
#include "Rim3dView.h"
#include "RiuMainPlotWindow.h"
#include "RiuPlotMainWindowTools.h"
#include <QAction>
@@ -91,13 +91,13 @@ void RicShowFlowCharacteristicsPlotFeature::onActionTriggered(bool isChecked)
RimFlowPlotCollection* flowPlotColl = RiaApplication::instance()->project()->mainPlotCollection->flowPlotCollection();
if (flowPlotColl)
{
RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
RiuPlotMainWindowTools::showPlotMainWindow();
flowPlotColl->defaultFlowCharacteristicsPlot()->setFromFlowSolution(eclCase->defaultFlowDiagSolution());
flowPlotColl->defaultFlowCharacteristicsPlot()->updateConnectedEditors();
// Make sure the summary plot window is created and visible
plotwindow->selectAsCurrentItem(flowPlotColl->defaultFlowCharacteristicsPlot());
RiuPlotMainWindowTools::selectAsCurrentItem(flowPlotColl->defaultFlowCharacteristicsPlot());
}
}
}

View File

@@ -28,7 +28,7 @@
#include "Rim3dView.h"
#include "RimWellAllocationPlot.h"
#include "RiuMainPlotWindow.h"
#include "RiuPlotMainWindowTools.h"
#include "cafSelectionManager.h"
@@ -110,8 +110,8 @@ void RicShowWellAllocationPlotFeature::onActionTriggered(bool isChecked)
flowPlotColl->defaultWellAllocPlot()->updateConnectedEditors();
// Make sure the summary plot window is created and visible
RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
plotwindow->selectAsCurrentItem(flowPlotColl->defaultWellAllocPlot());
RiuPlotMainWindowTools::showPlotMainWindow();
RiuPlotMainWindowTools::selectAsCurrentItem(flowPlotColl->defaultWellAllocPlot());
}
}
}