Index: sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml =================================================================== diff -u -r3365ef23a278ef93f2bf6ff10b5637ad4f1b9d83 -rf90366dd7a36ac03a4e387550811fe5b8a7fbe80 --- sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision 3365ef23a278ef93f2bf6ff10b5637ad4f1b9d83) +++ sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision f90366dd7a36ac03a4e387550811fe5b8a7fbe80) @@ -58,7 +58,7 @@ // /* After navigation ask for Tx data */ vPostTreatmentAdjustmentTreatmentLog .doRequest( )} onTreatmentReviewConfirm : { vPostTreatmentAdjustmentPatientDisconnectionConfirm .doConfirm( )} // onDisposablesRemovalConfirm : vPostTreatmentAdjustmentDisposablesRemovalConfirm .doConfirm( ) - onDisposablesRemovalBack : page( _treatmentReviewConfirm ) + onDisposablesRemovalBack : setPage( _treatmentReviewConfirm ) onVisibleChanged: { if (visible) { _mainMenu.hidden = true @@ -69,17 +69,23 @@ } } + function setPage(vPage, vCondition) { + _root.stackStepIndex = vPage.stepIndex + page( vPage , vCondition) + if ( vPage.instructionBased ) { vPage.updateModel() } + } + function confirmClicked() { switch ( _root.stackStepIndex ) { case PostTreatmentStack.Disconnect: // _postTreatmentDisconnectStack.continueClicked() - page( _postTreatmentRemove) // TODO REMOVE + setPage( _postTreatmentRemove) // TODO REMOVE break case PostTreatmentStack.Remove: vPostTreatmentAdjustmentDisposablesRemovalConfirm.doConfirm() break case PostTreatmentStack.Review: - page( _postTreatmentDisinfection ) + setPage( _postTreatmentDisinfection ) break case PostTreatmentStack.Disinfection: // Skip button - go back to standby -- Finish Treatment @@ -95,7 +101,7 @@ // _postTreatmentDisconnectStack.backClicked() break case PostTreatmentStack.Disinfection: - page( _postTreatmentReview) + setPage( _postTreatmentReview) break case PostTreatmentStack.Remove: case PostTreatmentStack.Review: @@ -139,23 +145,23 @@ PostTreatmentBase { id: _patientDisconnectionConfirm objectName :"_patientDisconnectionConfirm" instructionBased : true - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Disconnect } + stepIndex : PostTreatmentStack.Disconnect } PostTreatmentBase { id: _postTreatmentRemove objectName : "_postTreatmentRemove" instructionBased : true - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Remove; updateModel() } + stepIndex : PostTreatmentStack.Remove } PostTreatmentReview { id: _postTreatmentReview objectName :"_postTreatmentReview" - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Review; } + stepIndex : PostTreatmentStack.Review } PostTreatmentBase { id: _postTreatmentDisinfection objectName :"_postTreatmentDisinfection" - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Disinfection } + stepIndex : PostTreatmentStack.Disinfection } // connections @@ -167,15 +173,15 @@ } Connections { target: vTDOpMode - function onPostTreatmentChanged ( vValue ) { page( _patientDisconnectionConfirm , vValue )} + function onPostTreatmentChanged ( vValue ) { setPage( _patientDisconnectionConfirm , vValue )} } // Confirm Patient Disconnection Connections { target: vPostTreatmentAdjustmentPatientDisconnectionConfirm function onAdjustmentTriggered ( vValue ) { if ( vPostTreatmentAdjustmentPatientDisconnectionConfirm.adjustment_Accepted ) { _postTreatmentReview.reasonText = "" - page( _postTreatmentDisinfection ) + setPage( _postTreatmentDisinfection ) } else { _postTreatmentReview.reasonText = vPostTreatmentAdjustmentPatientDisconnectionConfirm.text() @@ -189,7 +195,7 @@ if ( vPostTreatmentAdjustmentDisposablesRemovalConfirm.adjustment_Accepted ) { _postTreatmentRemove.reasonText = "" vPostTreatmentAdjustmentTreatmentLog.doRequest() - page( _postTreatmentReview ) + setPage( _postTreatmentReview ) } else { _postTreatmentRemove.reasonText = vPostTreatmentAdjustmentDisposablesRemovalConfirm.text() }