Caf:PdmUiTree: Rewrote rebuildUiSubTree to become updateUiSubTree

Now the UI state is preserved when refreshing the tree, making it suitable
to use this method more extensively. This paves the way to make changes to the Pdm data structure without considering the ui at all, until a  call to updateUiSubTree gets the ui gracefully into sync.
p4#: 21599
This commit is contained in:
Jacob Støren
2013-05-13 12:00:52 +02:00
parent 06d32ae97e
commit cad25bcd59
9 changed files with 125 additions and 77 deletions

View File

@@ -102,7 +102,7 @@ void RimResultSlot::changeLegendConfig(QString resultVarNameOfNewLegend)
m_legendConfigData.v().erase(it);
m_legendConfigData.v().push_back(this->legendConfig());
this->legendConfig = newLegend;
RiuMainWindow::instance()->uiPdmModel()->rebuildUiSubTree(this);
RiuMainWindow::instance()->uiPdmModel()->updateUiSubTree(this);
found = true;
break;
}
@@ -116,7 +116,7 @@ void RimResultSlot::changeLegendConfig(QString resultVarNameOfNewLegend)
newLegend->resultVariableName = resultVarNameOfNewLegend;
m_legendConfigData.v().push_back(this->legendConfig());
this->legendConfig = newLegend;
RiuMainWindow::instance()->uiPdmModel()->rebuildUiSubTree(this);
RiuMainWindow::instance()->uiPdmModel()->updateUiSubTree(this);
}
}

View File

@@ -174,7 +174,7 @@ void RimScriptCollection::fieldChangedByUi(const caf::PdmFieldHandle *changedFie
this->setUiName(fi.baseName());
this->readContentFromDisc();
RimUiTreeModelPdm* treeModel = RiuMainWindow::instance()->uiPdmModel();
if (treeModel) treeModel->rebuildUiSubTree(this);
if (treeModel) treeModel->updateUiSubTree(this);
}
}

View File

@@ -510,7 +510,7 @@ void RimStatisticsCase::setWellResultsAndUpdateViews(const cvf::Collection<RigSi
reservoirView->wellCollection()->wells.deleteAllChildObjects();
reservoirView->updateDisplayModelForWellResults();
treeModel->rebuildUiSubTree(reservoirView->wellCollection());
treeModel->updateUiSubTree(reservoirView->wellCollection());
progInfo.incrementProgress();
}

View File

@@ -459,7 +459,7 @@ void RimUiTreeModelPdm::slotRefreshScriptTree(QString path)
if (changedSColl)
{
changedSColl->readContentFromDisc();
this->rebuildUiSubTree(changedSColl);
this->updateUiSubTree(changedSColl);
}
}
@@ -484,7 +484,7 @@ void RimUiTreeModelPdm::addInputProperty(const QModelIndex& itemIndex, const QSt
inputReservoir->openDataFileSet(fileNames);
}
this->rebuildUiSubTree(inputPropertyCollection);
this->updateUiSubTree(inputPropertyCollection);
}
//--------------------------------------------------------------------------------------------------