Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -ra6586ea871f21a08e7d50552983360fb5e344b3a -rc875558052c57819f270f3af970e12016d325fce --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision a6586ea871f21a08e7d50552983360fb5e344b3a) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision c875558052c57819f270f3af970e12016d325fce) @@ -38,8 +38,31 @@ _treatmentAdjustmentPressuresLimits .close() _treatmentAdjustmentDuration .close() _treatmentUltrafiltrationItem .close() + + // When the current view is not the treatment screen (ie: rinseback, recirculation, end), + // the visible bool is false, so stop the timer, else returning back from those screens + // start the timer. + if(!visible) { + vTreatmentVitals.doTimerStop() + } else { + vTreatmentVitals.doTimerStart() + } } + Connections{ target: stackView + function onCurrentItemChanged(){ + // For cases navigating from the dialysis treatment state to the + // blood priming state, the stackview currentItem changes away from the + // _treatmentHome item. So need to stop the timer and start the timer again + // when the current stack view has the dialysis state screen item as the current. + if(!stackView.empty && stackView.currentItem == _treatmentHome){ + vTreatmentVitals.doTimerStart() + } else { + vTreatmentVitals.doTimerStop() + } + } + } + stackView.initialItem : null // ultrafiltration state information bar properties @@ -82,6 +105,7 @@ } function onSectionVitalsClicked ( vValue ) { _vitalEntry.open() + _bphrEntry.setFocus() } function onSectionPressuresClicked ( vValue ) { _treatmentAdjustmentPressuresLimits.open() @@ -163,7 +187,7 @@ onOpened : { vTreatmentVitals.doTimerStop() // Can't be moved to C++, and has to be handled here because it can manually being opened by the user - _bphrEntry.setFocus() + _keyboard.setVisible(true) } onClosed : { @@ -178,8 +202,10 @@ Connections { target: vTreatmentVitals function onDidTrigger ( vSystolic, vDiastolic, vHeartRate ) { if ( vTreatmentVitals.enableDialog ) { - _vitalEntry.update ( vSystolic, vDiastolic, vHeartRate ) - _vitalEntry.open () + if(_root.visible) { + _vitalEntry.update ( vSystolic, vDiastolic, vHeartRate ) + _vitalEntry.open () + } } } }