mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
#922 Use setValueWithFieldChanged instead of setValueFromUi
This commit is contained in:
parent
96e532696e
commit
e732d5c373
@ -126,13 +126,9 @@ void RicToggleItemsFeatureImpl::setObjectToggleStateForSelection(SelectionToggle
|
||||
{
|
||||
caf::PdmField<bool>* field = dynamic_cast<caf::PdmField<bool>*>(uiObjectHandleChild->objectToggleField());
|
||||
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
if (state == TOGGLE_ON) uiFieldHandle->setValueFromUi(true);
|
||||
if (state == TOGGLE_OFF) uiFieldHandle->setValueFromUi(false);
|
||||
if (state == TOGGLE_SUBITEMS) uiFieldHandle->setValueFromUi(!(field->v()));
|
||||
}
|
||||
if (state == TOGGLE_ON) field->setValueWithFieldChanged(true);
|
||||
if (state == TOGGLE_OFF) field->setValueWithFieldChanged(false);
|
||||
if (state == TOGGLE_SUBITEMS) field->setValueWithFieldChanged(!(field->v()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -146,15 +142,11 @@ void RicToggleItemsFeatureImpl::setObjectToggleStateForSelection(SelectionToggle
|
||||
{
|
||||
caf::PdmField<bool>* field = dynamic_cast<caf::PdmField<bool>* >(uiObjectHandle->objectToggleField());
|
||||
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
if (state == TOGGLE_ON) field->setValueWithFieldChanged(true);
|
||||
if (state == TOGGLE_OFF) field->setValueWithFieldChanged(false);
|
||||
if (state == TOGGLE_SUBITEMS || state == TOGGLE)
|
||||
{
|
||||
if (state == TOGGLE_ON) uiFieldHandle->setValueFromUi(true);
|
||||
if (state == TOGGLE_OFF) uiFieldHandle->setValueFromUi(false);
|
||||
if (state == TOGGLE_SUBITEMS || state == TOGGLE)
|
||||
{
|
||||
uiFieldHandle->setValueFromUi(!(field->v()));
|
||||
}
|
||||
field->setValueWithFieldChanged(!(field->v()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ void RicShowAllLinkedViewsFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
for (size_t j = 0; j < views.size(); j++)
|
||||
{
|
||||
views[j]->showWindow.uiCapability()->setValueFromUi(true);
|
||||
views[j]->showWindow.setValueWithFieldChanged(true);
|
||||
views[j]->uiCapability()->updateUiIconFromToggleField();
|
||||
}
|
||||
}
|
||||
|
@ -394,14 +394,14 @@ void RimView::setMeshOnlyDrawstyle()
|
||||
{
|
||||
if (isGridVisualizationMode())
|
||||
{
|
||||
meshMode.uiCapability()->setValueFromUi(FULL_MESH);
|
||||
meshMode.setValueWithFieldChanged(FULL_MESH);
|
||||
}
|
||||
else
|
||||
{
|
||||
meshMode.uiCapability()->setValueFromUi(FAULTS_MESH);
|
||||
meshMode.setValueWithFieldChanged(FAULTS_MESH);
|
||||
}
|
||||
|
||||
surfaceMode.uiCapability()->setValueFromUi(NO_SURFACE);
|
||||
surfaceMode.setValueWithFieldChanged(NO_SURFACE);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -411,13 +411,13 @@ void RimView::setMeshSurfDrawstyle()
|
||||
{
|
||||
if (isGridVisualizationMode())
|
||||
{
|
||||
surfaceMode.uiCapability()->setValueFromUi(SURFACE);
|
||||
meshMode.uiCapability()->setValueFromUi(FULL_MESH);
|
||||
surfaceMode.setValueWithFieldChanged(SURFACE);
|
||||
meshMode.setValueWithFieldChanged(FULL_MESH);
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceMode.uiCapability()->setValueFromUi(FAULTS);
|
||||
meshMode.uiCapability()->setValueFromUi(FAULTS_MESH);
|
||||
surfaceMode.setValueWithFieldChanged(FAULTS);
|
||||
meshMode.setValueWithFieldChanged(FAULTS_MESH);
|
||||
}
|
||||
}
|
||||
|
||||
@ -433,14 +433,14 @@ void RimView::setFaultMeshSurfDrawstyle()
|
||||
// Mesh SF SF SF
|
||||
if (this->isGridVisualizationMode())
|
||||
{
|
||||
surfaceMode.uiCapability()->setValueFromUi(SURFACE);
|
||||
surfaceMode.setValueWithFieldChanged(SURFACE);
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceMode.uiCapability()->setValueFromUi(FAULTS);
|
||||
surfaceMode.setValueWithFieldChanged(FAULTS);
|
||||
}
|
||||
|
||||
meshMode.uiCapability()->setValueFromUi(FAULTS_MESH);
|
||||
meshMode.setValueWithFieldChanged(FAULTS_MESH);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -450,14 +450,14 @@ void RimView::setSurfOnlyDrawstyle()
|
||||
{
|
||||
if (isGridVisualizationMode())
|
||||
{
|
||||
surfaceMode.uiCapability()->setValueFromUi(SURFACE);
|
||||
surfaceMode.setValueWithFieldChanged(SURFACE);
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceMode.uiCapability()->setValueFromUi(FAULTS);
|
||||
surfaceMode.setValueWithFieldChanged(FAULTS);
|
||||
}
|
||||
|
||||
meshMode.uiCapability()->setValueFromUi(NO_MESH);
|
||||
meshMode.setValueWithFieldChanged(NO_MESH);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -468,13 +468,13 @@ void RimView::showGridCells(bool enableGridCells)
|
||||
if (!enableGridCells)
|
||||
{
|
||||
m_previousGridModeMeshLinesWasFaults = meshMode() == FAULTS_MESH;
|
||||
if (surfaceMode() != NO_SURFACE) surfaceMode.uiCapability()->setValueFromUi(FAULTS);
|
||||
if (meshMode() != NO_MESH) meshMode.uiCapability()->setValueFromUi(FAULTS_MESH);
|
||||
if (surfaceMode() != NO_SURFACE) surfaceMode.setValueWithFieldChanged(FAULTS);
|
||||
if (meshMode() != NO_MESH) meshMode.setValueWithFieldChanged(FAULTS_MESH);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (surfaceMode() != NO_SURFACE) surfaceMode.uiCapability()->setValueFromUi(SURFACE);
|
||||
if (meshMode() != NO_MESH) meshMode.uiCapability()->setValueFromUi(m_previousGridModeMeshLinesWasFaults ? FAULTS_MESH : FULL_MESH);
|
||||
if (surfaceMode() != NO_SURFACE) surfaceMode.setValueWithFieldChanged(SURFACE);
|
||||
if (meshMode() != NO_MESH) meshMode.setValueWithFieldChanged(m_previousGridModeMeshLinesWasFaults ? FAULTS_MESH : FULL_MESH);
|
||||
}
|
||||
|
||||
m_gridCollection->isActive = enableGridCells;
|
||||
@ -487,7 +487,7 @@ void RimView::showGridCells(bool enableGridCells)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimView::setSurfaceDrawstyle()
|
||||
{
|
||||
if (surfaceMode() != NO_SURFACE) surfaceMode.uiCapability()->setValueFromUi(SURFACE);
|
||||
if (surfaceMode() != NO_SURFACE) surfaceMode.setValueWithFieldChanged(SURFACE);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -1129,8 +1129,7 @@ void RiuMainWindow::slotFramerateChanged(double frameRate)
|
||||
{
|
||||
if (RiaApplication::instance()->activeReservoirView() != NULL)
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = RiaApplication::instance()->activeReservoirView()->maximumFrameRate.uiCapability();
|
||||
uiFieldHandle->setValueFromUi(QVariant(frameRate));
|
||||
RiaApplication::instance()->activeReservoirView()->maximumFrameRate.setValueWithFieldChanged(frameRate);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1385,8 +1384,7 @@ void RiuMainWindow::slotToggleFaultLabelsAction(bool showLabels)
|
||||
RimEclipseView* activeRiv = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
|
||||
if (!activeRiv) return;
|
||||
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = activeRiv->faultCollection->showFaultLabel.uiCapability();
|
||||
uiFieldHandle->setValueFromUi(showLabels);
|
||||
activeRiv->faultCollection->showFaultLabel.setValueWithFieldChanged(showLabels);
|
||||
|
||||
refreshDrawStyleActions();
|
||||
}
|
||||
@ -1488,8 +1486,7 @@ void RiuMainWindow::slotScaleChanged(int scaleValue)
|
||||
{
|
||||
if (RiaApplication::instance()->activeReservoirView())
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = RiaApplication::instance()->activeReservoirView()->scaleZ.uiCapability();
|
||||
uiFieldHandle->setValueFromUi(scaleValue);
|
||||
RiaApplication::instance()->activeReservoirView()->scaleZ.setValueWithFieldChanged(scaleValue);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1629,11 +1626,7 @@ void RiuMainWindow::slotAddWellCellsToRangeFilterAction(bool doAdd)
|
||||
caf::AppEnum<RimEclipseWellCollection::WellCellsRangeFilterType> rangeAddType;
|
||||
rangeAddType = doAdd ? RimEclipseWellCollection::RANGE_ADD_INDIVIDUAL : RimEclipseWellCollection::RANGE_ADD_NONE;
|
||||
|
||||
caf::PdmUiFieldHandle* pdmUiFieldHandle = riv->wellCollection()->wellCellsToRangeFilterMode.uiCapability();
|
||||
if (pdmUiFieldHandle)
|
||||
{
|
||||
pdmUiFieldHandle->setValueFromUi(static_cast<unsigned int>(rangeAddType.index()));
|
||||
}
|
||||
riv->wellCollection()->wellCellsToRangeFilterMode.setValueWithFieldChanged(rangeAddType);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -404,11 +404,7 @@ void RiuViewerCommands::slotHideFault()
|
||||
RimFault* rimFault = eclipseView->faultCollection()->findFaultByName(faultName);
|
||||
if (rimFault)
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = rimFault->showFault.uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
uiFieldHandle->setValueFromUi(!rimFault->showFault);
|
||||
}
|
||||
rimFault->showFault.setValueWithFieldChanged(!rimFault->showFault);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user