mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-24 07:16:53 -06:00
#2873 Do only one updateAllRequiredEditors when closing cases
* Instead of one for every case that is being closed.
This commit is contained in:
parent
743993718c
commit
4c6a56bb52
@ -22,8 +22,10 @@
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
#include "RimOilField.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryCrossPlot.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
@ -42,6 +44,17 @@ RimSummaryPlotCollection* RiaSummaryTools::summaryPlotCollection()
|
||||
return project->mainPlotCollection()->summaryPlotCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCaseMainCollection* RiaSummaryTools::summaryCaseMainCollection()
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
RimSummaryCaseMainCollection* summaryCaseMainCollection = project->activeOilField()->summaryCaseMainCollection();
|
||||
CVF_ASSERT(summaryCaseMainCollection);
|
||||
return summaryCaseMainCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Update the summary curves referencing this curve, as the curve is identified by the name
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -22,6 +22,7 @@ class RimSummaryPlotCollection;
|
||||
class RimSummaryPlot;
|
||||
class RimSummaryCrossPlot;
|
||||
class RimSummaryCrossPlotCollection;
|
||||
class RimSummaryCaseMainCollection;
|
||||
|
||||
class QString;
|
||||
|
||||
@ -35,8 +36,9 @@ namespace caf {
|
||||
class RiaSummaryTools
|
||||
{
|
||||
public:
|
||||
static RimSummaryPlotCollection* summaryPlotCollection();
|
||||
static void notifyCalculatedCurveNameHasChanged(const QString& previousCurveName,
|
||||
static RimSummaryPlotCollection* summaryPlotCollection();
|
||||
static RimSummaryCaseMainCollection* summaryCaseMainCollection();
|
||||
static void notifyCalculatedCurveNameHasChanged(const QString& previousCurveName,
|
||||
const QString& currentCurveName);
|
||||
|
||||
static RimSummaryPlot* parentSummaryPlot(caf::PdmObject* object);
|
||||
|
@ -54,6 +54,7 @@ void RicCloseSummaryCaseFeature::setupActionLook(QAction* actionToSetup)
|
||||
void RicCloseSummaryCaseFeature::deleteSummaryCases(std::vector<RimSummaryCase*>& cases)
|
||||
{
|
||||
RimSummaryPlotCollection* summaryPlotColl = RiaSummaryTools::summaryPlotCollection();
|
||||
RimSummaryCaseMainCollection* summaryCaseMainCollection = RiaSummaryTools::summaryCaseMainCollection();
|
||||
|
||||
for (RimSummaryCase* summaryCase : cases)
|
||||
{
|
||||
@ -63,13 +64,11 @@ void RicCloseSummaryCaseFeature::deleteSummaryCases(std::vector<RimSummaryCase*>
|
||||
}
|
||||
summaryPlotColl->updateConnectedEditors();
|
||||
|
||||
RimSummaryCaseMainCollection* summaryCaseMainCollection = nullptr;
|
||||
summaryCase->firstAncestorOrThisOfTypeAsserted(summaryCaseMainCollection);
|
||||
|
||||
summaryCaseMainCollection->removeCase(summaryCase);
|
||||
summaryCaseMainCollection->updateAllRequiredEditors();
|
||||
}
|
||||
|
||||
summaryCaseMainCollection->updateAllRequiredEditors();
|
||||
|
||||
RiuPlotMainWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
||||
mainPlotWindow->updateSummaryPlotToolBar();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user