Index: sources/gui/qml/main.qml =================================================================== diff -u -r4209e0f69d1639b9f9255a2e9209c4287b155593 -r057d3ef4e29c63235040c5cfe8c6421ef7787d6a --- sources/gui/qml/main.qml (.../main.qml) (revision 4209e0f69d1639b9f9255a2e9209c4287b155593) +++ sources/gui/qml/main.qml (.../main.qml) (revision 057d3ef4e29c63235040c5cfe8c6421ef7787d6a) @@ -20,9 +20,20 @@ // C++ imports import Gui.View 0.1; import Gui.Actions 0.1; + +// TODO : When Testing data on Setting screen is removed +// This needs to be moved into the TreatmentFlows.qml +import VTreatmentBloodFlow 0.1; +import VTreatmentDialysateFlow 0.1; +import VTreatmentUltrafiltration 0.1; +import VTreatmentTime 0.1; +import VAlarmStatus 0.1; +import VPowerOff 0.1; + // Qml imports import "qrc:/globals" import "qrc:/pages" +import "qrc:/pages/treatment" import "qrc:/components" import "qrc:/dialogs" @@ -39,16 +50,47 @@ onDidActionReceive: { //console.debug(vData) switch(vAction) { - case GuiActions.PowerOff: - if (vData[GuiActions.PowerOff_ShowHide] === GuiActions.Command) - _powerOffDialog.open() - if (vData[GuiActions.PowerOff_ShowHide] === GuiActions.Timeout) - _powerOffDialog.close() + case GuiActions.PowerOffBroadcast: + _autoHideInfo.showDialog( + qsTr("System is shutting down"), + 5000 // if there is any error happening then after 5 seconds dialog hides. + ) break; + } } } + // TODO : When Testing data on Setting screen is removed + // This needs to be moved into the TreatmentFlows.qml + VTreatmentBloodFlow { id: vTreatmentBloodFlow } + VTreatmentDialysateFlow { id: vTreatmentDialysateFlow } + VTreatmentUltrafiltration { id: vTreatmentUltrafiltration } + VTreatmentTime { id: vTreatmentTime } + VAlarmStatus { id: vAlarmStatus } + VPowerOff { id: vPowerOff + onPoweroff_statusChanged: { + console.debug("vpoweroff_status", vpoweroff_status) + switch (vpoweroff_status) { + case GuiActions.Command: + _powerOffDialog.open() + break; + + case GuiActions.Timeout: + _powerOffDialog.close() + break; + + case GuiActions.Rejected: + _autoHideInfo.showDialog( + qsTr("Cannot shutdown during 'Treatment'"), // '%1').arg() + 1000 // if there is any error happening then after 5 seconds dialog hides. + ) + break; + + } + } + } + // ----- Follow the below Z order ----- // 1 - Screens // 1 - 1 @@ -72,6 +114,8 @@ } // 4 - Modals + AutoHideInfo { id: _autoHideInfo } + PowerOff { id: _powerOffDialog onAccepted: { _GuiView.doActionTransmit(GuiActions.PowerOff, GuiActions.Accepted)