Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml =================================================================== diff -u -r914308e6f87b8074bff379371379d238e7781ed3 -rdd02afaf66a118eb50deb9313e6a809dd17b5864 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml (.../TreatmentAdjustmentDuration.qml) (revision 914308e6f87b8074bff379371379d238e7781ed3) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml (.../TreatmentAdjustmentDuration.qml) (revision dd02afaf66a118eb50deb9313e6a809dd17b5864) @@ -28,7 +28,7 @@ * To adjust the treatment duration */ TreatmentAdjustmentBase { id: _root - objectName: "_TreatmentAdjustmentDuration" // SquishQt testability + objectName : "_TreatmentAdjustmentDuration" // SquishQt testability closeVisible : true confirmVisible : false @@ -41,10 +41,10 @@ StackItem { id: _treatmentDurationStack objectName : "_treatmentDurationStack" anchors { - top: parent.top - bottom: notification.top - left: parent.left - right: parent.right + top : parent.top + bottom : notification.top + left : parent.left + right : parent.right } visible : true stackView { @@ -56,13 +56,12 @@ } TreatmentAdjustmentDurationEdit { id: _treatmentAdjustmentDurationEdit - objectName: "_treatmentAdjustmentDurationEdit" - visible: false + objectName : "_treatmentAdjustmentDurationEdit" + visible : false StackView.onActivating : { _root.titleText = qsTr("Edit Treatment Duration") _root.notificationText = "" - reset() } onContinueClicked : function(vNewTreatmentDuration) { @@ -73,13 +72,48 @@ } TreatmentAdjustmentDurationConfirm { id: _treatmentAdjustmentDurationConfirm - objectName: "_treatmentAdjustmentDurationConfirm" - visible: false + objectName : "_treatmentAdjustmentDurationConfirm" + visible : false StackView.onActivating : { _root.titleText = qsTr("Confirm Treatment Duration") _root.notificationText = "" } + + onConfirmClicked : function(vNewTreatmentDuration) { + // send new duration to TD and wait + // if accepted moves to confirm screen, otherwise show error in notification + vTreatmentAdjustmentDurationConfirm.doConfirm(vNewTreatmentDuration) + } } + + Connections { target: vTreatmentAdjustmentDurationEdit + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentDurationEdit.adjustment_Accepted) { + notification.text = "" + + _treatmentAdjustmentDurationConfirm.newTreatmentDuration = vTreatmentAdjustmentDurationEdit.duration + _treatmentAdjustmentDurationConfirm.ufVolumeGoal = vTreatmentAdjustmentDurationEdit.ufVolumeGoal + _treatmentAdjustmentDurationConfirm.ufRate = vTreatmentAdjustmentDurationEdit.ufRate + + _treatmentDurationStack.page(_treatmentAdjustmentDurationConfirm) + } + else { + notification.text = vTreatmentAdjustmentDurationEdit.adjustment_ReasonText + } + } + } + + Connections { target: vTreatmentAdjustmentDurationConfirm + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentDurationConfirm.adjustment_Accepted) { + notification.text = "" + close() + } + else { + notification.text = vTreatmentAdjustmentDurationConfirm.adjustment_ReasonText + } + } + } } }