Index: sources/gui/qml/dialogs/AcidConcentrateAdjustment.qml =================================================================== diff -u -r9c818f9b2600fa0fb9375f5923bf01ffcbb17e0f -r9ea6aa3bf4e8c4b5ef8970a6c19ad12b5765c58d --- sources/gui/qml/dialogs/AcidConcentrateAdjustment.qml (.../AcidConcentrateAdjustment.qml) (revision 9c818f9b2600fa0fb9375f5923bf01ffcbb17e0f) +++ sources/gui/qml/dialogs/AcidConcentrateAdjustment.qml (.../AcidConcentrateAdjustment.qml) (revision 9ea6aa3bf4e8c4b5ef8970a6c19ad12b5765c58d) @@ -27,15 +27,16 @@ ModalDialog { id : _root property int controlWidth : 770 property int controlHeight : 86 - readonly property string adjustment: ("%1 %2, %3 %4, 1 Mg") .arg(_potassiumVolumeControl.value.toFixed(Variables.potassiumPrecision)) + readonly property string adjustment: ("%1 %2, %3 %4, 1 Mg") .arg(_potassiumValueControl.value.toFixed(Variables.potassiumPrecision)) .arg(Variables.unitTextPotassium) - .arg(_calciumVolumeControl.value.toFixed(Variables.calciumPrecision)) + .arg(_calciumValueControl.value.toFixed(Variables.calciumPrecision)) .arg(Variables.unitTextCalcium) width : 1000 height : 600 padding : Variables.defaultMargin - onVisibleChanged: notificationText = "" + onVisibleChanged: vTreatmentRanges.doCheckAcidConcentrate(vTreatmentCreate.acidConcentrateSet, + vTreatmentCreate.acidConcentrate) Item { id : _contentItem anchors.fill: parent @@ -59,8 +60,8 @@ margins : 0 } onClicked: { - _potassiumVolumeControl.clear() - _calciumVolumeControl.clear() + _potassiumValueControl.clear() + _calciumValueControl.clear() _root.close() } } @@ -77,7 +78,7 @@ width : _root.controlWidth height : _root.controlHeight - contentItem : ValueAdjuster{ id: _potassiumVolumeControl + contentItem : ValueAdjuster{ id: _potassiumValueControl minimum : vTreatmentRanges.acidConcentratePotassiumMin maximum : vTreatmentRanges.acidConcentratePotassiumMax step : vTreatmentRanges.acidConcentratePotassiumRes @@ -98,7 +99,7 @@ width : _root.controlWidth height : _root.controlHeight - contentItem : ValueAdjuster { id: _calciumVolumeControl + contentItem : ValueAdjuster { id: _calciumValueControl minimum : vTreatmentRanges.acidConcentrateCalciumMin maximum : vTreatmentRanges.acidConcentrateCalciumMax step : vTreatmentRanges.acidConcentrateCalciumRes @@ -118,7 +119,7 @@ width : 250 height : 75 pixelSize : 30 - enabled : _potassiumVolumeControl.isActive && _calciumVolumeControl.isActive + enabled : _potassiumValueControl.isActive && _calciumValueControl.isActive onClicked : { if ( vTreatmentCreate.acidConcentrateRejectReason ) { vTreatmentCreate.acidConcentrateRejectReason = Variables.noRejectReason } @@ -131,14 +132,28 @@ Connections { target: vTreatmentRanges function onAcidConcentrateAcceptedChanged ( vAccepted ) { if ( vAccepted ) { - _potassiumVolumeControl.clear() - _calciumVolumeControl.clear() + _potassiumValueControl.clear() + _calciumValueControl.clear() + vTreatmentCreate.acidConcentrateSet = true _root.accept() } else { notificationText = qsTr("Duplicate Acid Concentrate Entry") } } + + function onDidCheckAcidConcentrate ( vChecked ) { + if ( vChecked ) { + _potassiumValueControl.isActive = true + _calciumValueControl.isActive = true + _calciumValueControl.value = vTreatmentRanges.calcium + _potassiumValueControl.value = vTreatmentRanges.potassium + notificationText = qsTr("Duplicate Acid Concentrate Entry") + } + else { + notificationText = "" + } + } } } }