Index: sources/gui/qml/PowerItem.qml =================================================================== diff -u -rc66898d4ac69b72f1b9cc59e3039e7d9a1e59154 -r213b9fed4fc569eb85a0647bde9869a3c82c0db3 --- sources/gui/qml/PowerItem.qml (.../PowerItem.qml) (revision c66898d4ac69b72f1b9cc59e3039e7d9a1e59154) +++ 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,37 +89,24 @@ ) } - // ---- 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 ) { if ( vValue ) open () else close () } - function onPoweroffTriggered ( vValue ) { - switch ( vValue ) { - case GuiActions.Command : open (); break; - case GuiActions.Timeout : close (); break; - case GuiActions.Rejected: reject(); break; - } - } function onAdjustmentTriggered ( vValue ) { // DEBUG: // console.debug('\n' +