Index: sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml =================================================================== diff -u -rf2e4eba6e85c5d36537be782926f23cc9dc01037 -r04fd28f30e37a09450ff5877ae2f805a92898b44 --- sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision f2e4eba6e85c5d36537be782926f23cc9dc01037) +++ sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision 04fd28f30e37a09450ff5877ae2f805a92898b44) @@ -30,6 +30,21 @@ stackView.initialItem : null + enum StackStep { + Disconnection , + Review , + Disinfection + } + + property var stepNames: [ + qsTr("Disconnection"), + qsTr("Review" ), + qsTr("Disinfection" ), + ] + + property int stepLineLength : 100 + property int stackStepIndex : 0 + signal patientDisconnectionConfirm () signal treatmentReviewConfirm () signal disposablesRemovalConfirm () @@ -44,51 +59,117 @@ onVisibleChanged: { if (visible) { _mainMenu.hidden = true + _headerBar.titleText = qsTr("Post Treatment") } else { stackView.initialItem = null + _headerBar.titleText = "" } } + function confirmClicked() { + switch ( _root.stackStepIndex ) { + case PostTreatmentStack.Disconnection: + _root.patientDisconnectionConfirm() + break + case PostTreatmentStack.Review: + _root.treatmentReviewConfirm() + break + case PostTreatmentStack.Disinfection: + _root.disposablesRemovalConfirm() + break + default: + break + } + } + + function backClicked() { + switch ( _root.stackStepIndex ) { + case PostTreatmentStack.Disconnection: + break + case PostTreatmentStack.Review: + break + case PostTreatmentStack.Disinfection: + _root.disposablesRemovalBack () + break + default: + break + } + } + + function confirmButtonText() { + switch ( _root.stackStepIndex ) { + case PostTreatmentStack.Disconnection: + return qsTr("Auto-Eject") + case PostTreatmentStack.Review: + return qsTr("NEXT") + case PostTreatmentStack.Disinfection: + default: + return qsTr("CONFIRM") + } + } + + StepNavigationTitleBar { id: _titleBar + stepIndex : _root.stackStepIndex + anchors { + top : _root.top + left : parent.left + right : parent.right + leftMargin : Variables.defaultMargin * 2 + rightMargin : anchors.leftMargin + } + confirmText.text: confirmButtonText() + confirmVisible : true + backVisible : stackStepIndex === PostTreatmentStack.Disinfection + width : _root.width + stepNames : _root.stepNames + onBackClicked : _root.backClicked() + onConfirmClicked: _root.confirmClicked() + } + + ExportButton { id: _exportButton + isSmall : true + anchors.top : parent.top + anchors.left : parent.left + visible : stackStepIndex === PostTreatmentStack.Review + enabled : vPostTreatmentAdjustmentTreatmentLog.isIdle && _GuiView.usbIsReady && !_GuiView.exportRunning + onClicked : vPostTreatmentAdjustmentTreatmentLog.doExport() + } + + USBButton { id: _usbButton + anchors.top : _exportButton.top + anchors.left : _exportButton.right + anchors.leftMargin: Variables.minVGap + enabled : _GuiView.usbIsReady && !_GuiView.exportRunning + visible : stackStepIndex === PostTreatmentStack.Review + } + PostTreatmentBase { id: _patientDisconnectionConfirm - objectName :"_patientDisconnectionConfirm" - property int stackStepIndex : 0 - header.confirmVisible : true - title.text : qsTr("Patient Disconnection") - instructionBased : true - onConfirmClicked : _root.patientDisconnectionConfirm() + objectName :"_patientDisconnectionConfirm" + instructionBased : true + onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Disconnection } } PostTreatmentReview { id: _treatmentReviewConfirm objectName :"_treatmentReviewConfirm" - property int stackStepIndex : 1 - header.confirmVisible : true - title.text : qsTr("Treatment Review") - instructionBased : false - onConfirmClicked : _root.treatmentReviewConfirm() - onItemClicked : { + instructionBased : false + onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Review } + + onItemClicked : { _detailTest.title.text = itemsText[vIndex] push(_detailTest) } } PostTreatmentBase { id: _detailTest - objectName :"_detailTest" - property int stackStepIndex : 1 - onBackClicked : pop() - header.backVisible : true - header.confirmVisible : false + objectName :"_detailTest" + onBackClicked : pop() } PostTreatmentBase { id: _disposablesRemovalConfirm - objectName :"_disposablesRemovalConfirm" - property int stackStepIndex : 2 - header. backVisible : true - header.confirmVisible : true - title.text : qsTr("Disposables Removal") - instructionBased : true - onConfirmClicked : _root.disposablesRemovalConfirm() - onBackClicked : _root.disposablesRemovalBack () + objectName :"_disposablesRemovalConfirm" + instructionBased : true + onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Disinfection } } // connections