mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Project tree: Fixed several issues after the reconfiguration
Missing Icon and text on the Grid Models folder New cases and Grid Case Groups ended up outside the Grid Model Folder Old Project files did not show up properly p4#: 21854
This commit is contained in:
@@ -565,12 +565,8 @@ bool RiaApplication::openEclipseCase(const QString& caseName, const QString& cas
|
||||
}
|
||||
|
||||
RimUiTreeModelPdm* uiModel = RiuMainWindow::instance()->uiPdmModel();
|
||||
caf::PdmUiTreeItem* projectTreeItem = uiModel->treeItemRoot();
|
||||
|
||||
// New case is inserted before the last item, the script item
|
||||
int position = projectTreeItem->childCount() - 1;
|
||||
|
||||
uiModel->addToParentAndBuildUiItems(projectTreeItem, position, rimResultReservoir);
|
||||
uiModel->updateUiSubTree(analysisModels);
|
||||
|
||||
RiuMainWindow::instance()->setCurrentObjectInTreeView(riv->cellResult());
|
||||
|
||||
@@ -607,12 +603,7 @@ bool RiaApplication::openInputEclipseCase(const QString& caseName, const QString
|
||||
}
|
||||
|
||||
RimUiTreeModelPdm* uiModel = RiuMainWindow::instance()->uiPdmModel();
|
||||
caf::PdmUiTreeItem* projectTreeItem = uiModel->treeItemRoot();
|
||||
|
||||
// New case is inserted before the last item, the script item
|
||||
int position = projectTreeItem->childCount() - 1;
|
||||
|
||||
uiModel->addToParentAndBuildUiItems(projectTreeItem, position, rimInputReservoir);
|
||||
uiModel->updateUiSubTree(analysisModels);
|
||||
|
||||
RiuMainWindow::instance()->setCurrentObjectInTreeView(riv->cellResult());
|
||||
|
||||
@@ -1533,12 +1524,8 @@ bool RiaApplication::addEclipseCases(const QStringList& fileNames)
|
||||
}
|
||||
|
||||
RimUiTreeModelPdm* uiModel = RiuMainWindow::instance()->uiPdmModel();
|
||||
caf::PdmUiTreeItem* projectTreeItem = uiModel->treeItemRoot();
|
||||
|
||||
// New case is inserted before the last item, the script item
|
||||
int position = projectTreeItem->childCount() - 1;
|
||||
|
||||
uiModel->addToParentAndBuildUiItems(projectTreeItem, position, gridCaseGroup);
|
||||
|
||||
uiModel->updateUiSubTree( m_project->activeOilField()->analysisModels());
|
||||
|
||||
if (gridCaseGroup->statisticsCaseCollection()->reservoirs.size() > 0)
|
||||
{
|
||||
|
||||
@@ -55,6 +55,8 @@ CAF_PDM_SOURCE_INIT(RimAnalysisModels, "ResInsightAnalysisModels");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimAnalysisModels::RimAnalysisModels(void)
|
||||
{
|
||||
CAF_PDM_InitObject("Grid Models", ":/GridModels.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&cases, "Reservoirs", "", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&caseGroups, "CaseGroups", "", "", "", "");
|
||||
|
||||
|
||||
@@ -51,8 +51,10 @@ CAF_PDM_SOURCE_INIT(RimOilField, "ResInsightOilField");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimOilField::RimOilField(void)
|
||||
{
|
||||
CAF_PDM_InitFieldNoDefault(&wellPathCollection, "WellPathCollection", "Well Paths", ":/WellCollection.png", "", "");
|
||||
CAF_PDM_InitObject("Oil Field", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&analysisModels, "AnalysisModels", "Grid Models", ":/GridModels.png", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&wellPathCollection, "WellPathCollection", "Well Paths", ":/WellCollection.png", "", "");
|
||||
|
||||
analysisModels = new RimAnalysisModels();
|
||||
}
|
||||
|
||||
@@ -84,6 +84,9 @@ RimProject::RimProject(void)
|
||||
scriptCollection = new RimScriptCollection();
|
||||
scriptCollection->directory.setUiHidden(true);
|
||||
|
||||
// For now, create a default first oilfield that contains the rest of the project
|
||||
oilFields.push_back(new RimOilField);
|
||||
|
||||
initScriptDirectories();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
<file>SnapShotSaveViews.png</file>
|
||||
<file>draw_style_faults_24x24.png</file>
|
||||
<file>Case48x48.png</file>
|
||||
<file>GridModels.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/Shader/">
|
||||
<file>fs_CellFace.glsl</file>
|
||||
|
||||
@@ -525,8 +525,14 @@ PdmUiTreeItem* UiTreeItemBuilderPdm::buildViewItems(PdmUiTreeItem* parentTreeIte
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// NOTE: if position is -1, the item is appended to the parent tree item
|
||||
|
||||
PdmUiTreeItem* objectTreeItem = NULL;
|
||||
|
||||
// Ignore this particular object if the field it resides in is hidden.
|
||||
// Child objects of this object, however, is not hidden
|
||||
// Todo: This is a Hack to make oilField disappear. Must be rewritten when
|
||||
// a more general ui tree building method is in place.
|
||||
|
||||
std::vector<caf::PdmFieldHandle*> parentFields;
|
||||
object->parentFields(parentFields);
|
||||
if (parentFields.size() == 1 && parentFields[0]->isUiHidden())
|
||||
|
||||
Reference in New Issue
Block a user