#1030 Don't automatically create summary plots of preference is turned off

This commit is contained in:
Bjørnar Grip Fjær
2017-04-20 15:58:52 +02:00
parent bd47826608
commit 327fb31cb0
2 changed files with 9 additions and 4 deletions

View File

@@ -19,6 +19,7 @@
#include "RicImportSummaryCaseFeature.h"
#include "RiaApplication.h"
#include "RiaPreferences.h"
#include "RimGridSummaryCase.h"
#include "RimMainPlotCollection.h"
@@ -102,10 +103,14 @@ bool RicImportSummaryCaseFeature::createAndAddSummaryCaseFromFile(const QString&
RimSummaryCase* newSumCase = sumCaseColl->createAndAddSummaryCaseFromFileName(fileName);
newSumCase->loadCase();
RimMainPlotCollection* mainPlotColl = proj->mainPlotCollection();
RimSummaryPlotCollection* summaryPlotColl = mainPlotColl->summaryPlotCollection();
RicNewSummaryPlotFeature::createNewSummaryPlot(summaryPlotColl, newSumCase);
if (app->preferences()->autoCreatePlotsOnImport())
{
RimMainPlotCollection* mainPlotColl = proj->mainPlotCollection();
RimSummaryPlotCollection* summaryPlotColl = mainPlotColl->summaryPlotCollection();
RicNewSummaryPlotFeature::createNewSummaryPlot(summaryPlotColl, newSumCase);
}
sumCaseColl->updateConnectedEditors();
app->addToRecentFiles(fileName);