Index: sources/gui/qml/main.qml =================================================================== diff -u -rd4befd2d92ee54b57de33867a1e2517cafdd89d3 -rc933552983a659ca4cc351ff4d43d07319adab1e --- sources/gui/qml/main.qml (.../main.qml) (revision d4befd2d92ee54b57de33867a1e2517cafdd89d3) +++ sources/gui/qml/main.qml (.../main.qml) (revision c933552983a659ca4cc351ff4d43d07319adab1e) @@ -26,9 +26,6 @@ import "qrc:/components" import "qrc:/dialogs" -// TODO : -// 3 - Version - /* * \brief Initialization and start point of the QML */ @@ -38,20 +35,20 @@ property alias powerOffDialog: _powerOffDialog - GuiView { id: _guiView - onActionEvaluated: { - if (vAction === GuiActions.ActBack) { - if (vAccepted) { - _stackView.pop() - } + GuiView { id: _GuiView + onDidActionReceive: { + switch(vAction) { + case GuiActions.PowerOff: + if (vData[GuiActions.PowerOff_ShowHide] === GuiActions.Command) + _powerOffDialog.open() + if (vData[GuiActions.PowerOff_ShowHide] === GuiActions.Timeout) + _powerOffDialog.close() + break; } - if (vAction === GuiActions.ActConfirm) { - // NoOp - } } } - // ----- Follow the Z order ----- + // ----- Follow the below Z order ----- // 1 - Screens // 1 - 1 SettingsStack { id: _settingsStack } @@ -66,6 +63,9 @@ // 3 - Footer MainMenu { id: _mainMenu titles: [ qsTr("Treatment") , qsTr("Manager") , qsTr("Settings") ] + Component.onCompleted: { + _treatmentStack.visible = true + } onItemPressed: { _treatmentStack .visible = vIndex == 0; _mansagerStack .visible = vIndex == 1; @@ -74,16 +74,23 @@ } // 4 - Modals - PowerOff { id: _powerOffDialog } + PowerOff { id: _powerOffDialog + onAccepted: { + _GuiView.doActionTransmit(GuiActions.PowerOff, GuiActions.Accepted) + } + onRejected: { + _GuiView.doActionTransmit(GuiActions.PowerOff, GuiActions.Rejected) + } + } // 9 - Others - Text { //NOTE: Test Code : Must be removed when implemented + Text { // TODO : Test Code color: Colors.textMain x: 1172 y: 767 width: 104 height: 27 - text: qsTr("0.1") + text: Qt.application.version horizontalAlignment: Text.AlignRight anchors.bottom: parent.bottom anchors.bottomMargin: 6