Index: sources/gui/qml/pages/posttreatment/PostTreatmentDisconnectStack.qml =================================================================== diff -u -r7fb13d9e1a453a37ab4dea5536e0f19ed6e272d2 -r70d6ebddd11a5df068f059fd563a0c1d0b50a2a3 --- sources/gui/qml/pages/posttreatment/PostTreatmentDisconnectStack.qml (.../PostTreatmentDisconnectStack.qml) (revision 7fb13d9e1a453a37ab4dea5536e0f19ed6e272d2) +++ sources/gui/qml/pages/posttreatment/PostTreatmentDisconnectStack.qml (.../PostTreatmentDisconnectStack.qml) (revision 70d6ebddd11a5df068f059fd563a0c1d0b50a2a3) @@ -21,11 +21,17 @@ } property int subStepIndex: PostTreatmentDisconnectStack.Step.DisconnectPatient + property int stepIndex: PostTreatmentStack.Disconnect signal goToNextStep() - function initStack() { page ( _postTreatmentDisconnectPatient ) } + function setPage(vPage, vCondition) { + _root.subStepIndex = vPage.stepIndex + page( vPage , vCondition) + } + function initStack() { setPage ( _postTreatmentDisconnectPatient ) } + function continueClicked() { switch ( _root.subStepIndex ) { case PostTreatmentDisconnectStack.Step.DisconnectPatient: @@ -44,7 +50,7 @@ case PostTreatmentDisconnectStack.Step.DisconnectPatient: break case PostTreatmentDisconnectStack.Step.DrainConsumable: - page ( _postTreatmentDisconnectPatient ) + setPage ( _postTreatmentDisconnectPatient ) break default: break @@ -56,22 +62,15 @@ } // ----- Screens definitions - PostTreatmentBase { id: _postTreatmentDisconnectPatient - instructionBased : true - subStepName : qsTr("Disconnect Patient BloodLines") - onVisibleChanged : if (visible) { _root.subStepIndex = PostTreatmentDisconnectStack.Step.DisconnectPatient ; updateModel() } - } + PostTreatmentBase { id: _postTreatmentDisconnectPatient; stepIndex: PostTreatmentDisconnectStack.Step.DisconnectPatient; subStepName: qsTr("Disconnect Patient BloodLines"); instructionBased: true} + PostTreatmentDrainConsumables { id: _postTreatmentDrainConsumables; stepIndex: PostTreatmentDisconnectStack.Step.DrainConsumable; } - PostTreatmentDrainConsumables { id: _postTreatmentDrainConsumables - onVisibleChanged : if (visible) { _root.subStepIndex = PostTreatmentDisconnectStack.Step.DrainConsumable } - } - // Confirm Patient Disconnection Connections { target: vPostTreatmentAdjustmentPatientDisconnectionConfirm function onAdjustmentTriggered ( vValue ) { if ( vPostTreatmentAdjustmentPatientDisconnectionConfirm.adjustment_Accepted ) { _postTreatmentDisconnectPatient.reasonText = "" - page ( _postTreatmentDrainConsumables ) + setPage ( _postTreatmentDrainConsumables ) } else { _postTreatmentDisconnectPatient.reasonText = vPostTreatmentAdjustmentPatientDisconnectionConfirm.text() } @@ -81,6 +80,7 @@ onVisibleChanged: { if (visible) { _headerBar.activeStack = stackView + initStack() } else { stackView.initialItem = null