mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2555. Add summary restart file import dialog
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RicSummaryCaseRestartDialog.h"
|
||||
|
||||
#include "RimGridSummaryCase.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimOilField.h"
|
||||
@@ -32,8 +34,6 @@
|
||||
#include "RiuMainPlotWindow.h"
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "SummaryPlotCommands/RicNewSummaryPlotFeature.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QFileDialog>
|
||||
|
||||
@@ -99,19 +99,23 @@ bool RicImportSummaryCaseFeature::createAndAddSummaryCaseFromFile(const QString&
|
||||
RimSummaryCaseMainCollection* sumCaseColl = proj->activeOilField() ? proj->activeOilField()->summaryCaseMainCollection() : nullptr;
|
||||
if (!sumCaseColl) return false;
|
||||
|
||||
RimSummaryCase* sumCase = sumCaseColl->createAndAddSummaryCaseFromFileName(fileName);
|
||||
sumCaseColl->updateAllRequiredEditors();
|
||||
RicSummaryCaseRestartDialogResult result = RicSummaryCaseRestartDialog::openDialog(fileName);
|
||||
|
||||
RiuMainPlotWindow* mainPlotWindow = app->getOrCreateAndShowMainPlotWindow();
|
||||
if (mainPlotWindow)
|
||||
if (result.ok)
|
||||
{
|
||||
mainPlotWindow->selectAsCurrentItem(sumCase);
|
||||
RimSummaryCase* sumCase = sumCaseColl->createAndAddSummaryCaseFromFileName(fileName, result.option == RicSummaryCaseRestartDialog::READ_ALL);
|
||||
sumCaseColl->updateAllRequiredEditors();
|
||||
|
||||
mainPlotWindow->updateSummaryPlotToolBar();
|
||||
RiuMainPlotWindow* mainPlotWindow = app->getOrCreateAndShowMainPlotWindow();
|
||||
if (mainPlotWindow)
|
||||
{
|
||||
mainPlotWindow->selectAsCurrentItem(sumCase);
|
||||
|
||||
mainPlotWindow->updateSummaryPlotToolBar();
|
||||
}
|
||||
|
||||
app->addToRecentFiles(fileName);
|
||||
}
|
||||
|
||||
app->addToRecentFiles(fileName);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user