Index: sources/gui/qml/PowerItem.qml =================================================================== diff -u -rd95ed86d997208024ec79422e350a86a2c52fd85 -r213b9fed4fc569eb85a0647bde9869a3c82c0db3 --- sources/gui/qml/PowerItem.qml (.../PowerItem.qml) (revision d95ed86d997208024ec79422e350a86a2c52fd85) +++ sources/gui/qml/PowerItem.qml (.../PowerItem.qml) (revision 213b9fed4fc569eb85a0647bde9869a3c82c0db3) @@ -45,29 +45,22 @@ cancelText : vConfirm.cancel confirmVisible : ! vConfirm.isReject notificationText: vConfirm.adjustment_ReasonText - autoClose : vConfirm.isPowerOff || vConfirm.isReject + autoClose : vConfirm.isReject onVisibleChanged: { _root.isOpen = visible if (visible) _alarmItem.alarmHide() else _alarmItem.alarmMaximize() } + onAccepted: { - if ( vConfirm.isPowerOff ) { + if ( ! vConfirm.isReject ) { vConfirm.doConfirm( true ) + shutdownWait() } - else { - if ( ! vConfirm.isReject ) vConfirm.doConfirm( true ) - } } - onRejected: { - if ( vConfirm.isPowerOff ) { - vConfirm.doConfirm( false ) - } - else { - if ( ! vConfirm.isReject ) vConfirm.doConfirm( false ) - } - } + + onRejected: if ( ! vConfirm.isReject ) vConfirm.doConfirm( false ) } function open() { @@ -96,23 +89,17 @@ ) } - // ---- Connections - Connections { target: _GuiView - function onDidActionReceive( vAction, vData ) { - switch(vAction) { - case GuiActions.ID_ShuttingDown: - _autoHideInfo.showDialog ( - qsTr("System is shutting down"), - 5000 // if any error happens and shutdown is not successful then after 5 seconds dialog hides. - ) - break; - } - } + function shutdownWait() { + _autoHideInfo.showDialog ( + qsTr("System is shutting down"), + 5000 // if any error happens and shutdown is not successful then after 5 seconds dialog hides. + ) } Connections { target: vConfirm function onIsRejectChanged ( vValue ) { _powerOffDialog.footerUpdate() + if ( vValue ) _root.reject() } function onVisibleChanged ( vValue ) {