mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1059 System : Use PdmOptionItemInfo constructor for PdmObjects
This commit is contained in:
@@ -21,7 +21,15 @@
|
||||
#include "RimTools.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "cafPdmUiItem.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
@@ -200,3 +208,45 @@ QString RimTools::relocateFile(const QString& orgFileName, const QString& orgNew
|
||||
|
||||
return fileName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTools::wellPathOptionItems(QList<caf::PdmOptionItemInfo>* options)
|
||||
{
|
||||
CVF_ASSERT(options);
|
||||
if (!options) return;
|
||||
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj && proj->activeOilField() && proj->activeOilField()->wellPathCollection())
|
||||
{
|
||||
caf::PdmChildArrayField<RimWellPath*>& wellPaths = proj->activeOilField()->wellPathCollection()->wellPaths;
|
||||
|
||||
QIcon wellIcon(":/Well.png");
|
||||
for (RimWellPath* wellPath : wellPaths)
|
||||
{
|
||||
options->push_back(caf::PdmOptionItemInfo(wellPath->name(), wellPath, false, wellIcon));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTools::caseOptionItems(QList<caf::PdmOptionItemInfo>* options)
|
||||
{
|
||||
CVF_ASSERT(options);
|
||||
if (!options) return;
|
||||
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj)
|
||||
{
|
||||
std::vector<RimCase*> cases;
|
||||
proj->allCases(cases);
|
||||
|
||||
for (RimCase* c : cases)
|
||||
{
|
||||
options->push_back(caf::PdmOptionItemInfo(c->caseUserDescription(), c, false, c->uiIcon()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user