From a71eace12466fbcd620509eb167b6048ad02f073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Grip=20Fj=C3=A6r?= Date: Fri, 19 May 2017 11:09:36 +0200 Subject: [PATCH] #1462 Set first eclipse case in project to default selected eclipse case --- .../RicWellPathExportCompletionDataFeature.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp b/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp index ea35fecfb3..26e883fbe7 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp @@ -76,13 +76,20 @@ void RicWellPathExportCompletionDataFeature::onActionTriggered(bool isChecked) QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallback("COMPLETIONS", projectFolder); RimExportCompletionDataSettings exportSettings; + std::vector cases; + app->project()->allCases(cases); + for (auto c : cases) + { + RimEclipseCase* eclipseCase = dynamic_cast(c); + if (eclipseCase != nullptr) + { + exportSettings.caseToApply = eclipseCase; + break; + } + } exportSettings.fileName = QDir(defaultDir).filePath("Completions"); - RimEclipseCase* caseToApply; - objects[0]->firstAncestorOrThisOfType(caseToApply); - exportSettings.caseToApply = caseToApply; - caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), &exportSettings, "Export Completion Data", ""); if (propertyDialog.exec() == QDialog::Accepted) {