@ -506,15 +506,15 @@ ApplicationWindow {
@@ -506,15 +506,15 @@ ApplicationWindow {
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - C r i t i c a l V e h i c l e M e s s a g e P o p u p
property var _vehicleMessageQueue : [ ]
property string _vehicleMessage : ""
function showCriticalVehicleMessage ( message ) {
indicatorPopup . close ( )
if ( criticalVehicleMessagePopup . visible || QGroundControl . videoManager . fullScreen ) {
_vehicleMessageQueue . push ( message )
/ / W e r e c e i v e d a d d i t i o n a l w a n r i n g m e s s a g e w h i l e a n o l d e r w a r n i n g m e s s a g e w a s s t i l l d i s p l a y e d .
/ / W h e n t h e u s e r c l o s e t h e o l d e r o n e d r o p t h e m e s s a g e i n d i c a t o r t o o l s o t h e y c a n s e e t h e r e s t o f t h e m .
criticalVehicleMessagePopup . dropMessageIndicatorOnClose = true
} else {
_vehicleMessage = message
criticalVehicleMessagePopup . criticalVehicleMessage = message
criticalVehicleMessagePopup . dropMessageIndicatorOnClose = false
criticalVehicleMessagePopup . open ( )
}
}
@ -524,100 +524,85 @@ ApplicationWindow {
@@ -524,100 +524,85 @@ ApplicationWindow {
y: ScreenTools . defaultFontPixelHeight
x: Math . round ( ( mainWindow . width - width ) * 0.5 )
width: mainWindow . width * 0.55
height: ScreenTools . defaultFontPixelHeight * 6
height: criticalVehicleMessageText . contentHeight + ScreenTools . defaultFontPixelHeight * 2
modal: false
focus: true
closePolicy: Popup . CloseOnEscape
property alias criticalVehicleMessage: criticalVehicleMessageText . text
property bool dropMessageIndicatorOnClose: false
background: Rectangle {
anchors.fill: parent
color: qgcPal . alertBackground
radius: ScreenTools . defaultFontPixelHeight * 0.5
border.color: qgcPal . alertBorder
border.width: 2
}
onOpened: {
criticalVehicleMessageText . text = mainWindow . _vehicleMessage
}
Rectangle {
anchors.horizontalCenter: parent . horizontalCenter
anchors.top: parent . top
anchors.topMargin: - ( height / 2 )
color: qgcPal . alertBackground
radius: ScreenTools . defaultFontPixelHeight * 0.25
border.color: qgcPal . alertBorder
border.width: 1
width: vehicleWarningLabel . contentWidth + _margins
height: vehicleWarningLabel . contentHeight + _margins
property real _margins : ScreenTools . defaultFontPixelHeight * 0.25
onClosed: {
/ / - - A r e t h e r e m e s s a g e s i n t h e w a i t i n g q u e u e ?
if ( mainWindow . _vehicleMessageQueue . length ) {
mainWindow . _vehicleMessage = ""
/ / - - S h o w a l l m e s s a g e s i n q u e u e
for ( var i = 0 ; i < mainWindow . _vehicleMessageQueue . length ; i ++ ) {
var text = mainWindow . _vehicleMessageQueue [ i ]
if ( i ) mainWindow . _vehicleMessage += "<br>"
mainWindow . _vehicleMessage += text
QGCLabel {
id: vehicleWarningLabel
anchors.centerIn: parent
text: qsTr ( "Vehicle Error" )
font.pointSize: ScreenTools . smallFontPointSize
color: qgcPal . alertText
}
/ / - - C l e a r i t
mainWindow . _vehicleMessageQueue = [ ]
criticalVehicleMessagePopup . open ( )
} else {
mainWindow . _vehicleMessage = ""
}
}
Flickable {
id: criticalVehicleMessageFlick
anchors.margins: ScreenTools . defaultFontPixelHeight * 0.5
anchors.fill: parent
contentHeight: criticalVehicleMessageText . height
contentWidth: criticalVehicleMessageText . width
boundsBehavior: Flickable . StopAtBounds
pixelAligned: true
clip: true
TextEdit {
id: criticalVehicleMessageText
width: criticalVehicleMessagePopup . width - criticalVehicleMessageClose . width - ( ScreenTools . defaultFontPixelHeight * 2 )
anchors.centerIn: parent
readOnly: true
textFormat: TextEdit . RichText
font.pointSize: ScreenTools . defaultFontPointSize
font.family: ScreenTools . demiboldFontFamily
wrapMode: TextEdit . WordWrap
color: qgcPal . alertText
}
}
Rectangle {
id: additionalErrorsIndicator
anchors.horizontalCenter: parent . horizontalCenter
anchors.bottom: parent . bottom
anchors.bottomMargin: - ( height / 2 )
color: qgcPal . alertBackground
radius: ScreenTools . defaultFontPixelHeight * 0.25
border.color: qgcPal . alertBorder
border.width: 1
width: additionalErrorsLabel . contentWidth + _margins
height: additionalErrorsLabel . contentHeight + _margins
visible: criticalVehicleMessagePopup . dropMessageIndicatorOnClose
property real _margins : ScreenTools . defaultFontPixelHeight * 0.25
/ / - - D i s m i s s V e h i c l e M e s s a g e
QGCColoredImage {
id: criticalVehicleMessageClose
anchors.margins: ScreenTools . defaultFontPixelHeight * 0.5
anchors.top: parent . top
anchors.right: parent . right
width: ScreenTools . isMobile ? ScreenTools . defaultFontPixelHeight * 1.5 : ScreenTools . defaultFontPixelHeight
height: width
sourceSize.height: width
source: "/res/XDelete.svg"
fillMode: Image . PreserveAspectFit
color: qgcPal . alertText
MouseArea {
anchors.fill: parent
anchors.margins: - ScreenTools . defaultFontPixelHeight
onClicked: {
criticalVehicleMessagePopup . close ( )
QGCLabel {
id: additionalErrorsLabel
anchors.centerIn: parent
text: qsTr ( "Additional errors received" )
font.pointSize: ScreenTools . smallFontPointSize
color: qgcPal . alertText
}
}
}
/ / - - M o r e t e x t b e l o w i n d i c a t o r
QGCColoredImage {
anchors.margins: ScreenTools . defaultFontPixelHeight * 0.5
anchors.bottom: parent . bottom
anchors.right: parent . right
width: ScreenTools . isMobile ? ScreenTools . defaultFontPixelHeight * 1.5 : ScreenTools . defaultFontPixelHeight
height: width
sourceSize.height: width
source: "/res/ArrowDown.svg"
fillMode: Image . PreserveAspectFit
visible: criticalVehicleMessageText . lineCount > 5
QGCLabel {
id: criticalVehicleMessageText
width: criticalVehicleMessagePopup . width - ScreenTools . defaultFontPixelHeight
anchors.centerIn: parent
wrapMode: Text . WordWrap
color: qgcPal . alertText
MouseArea {
anchors.fill: parent
onClicked: {
criticalVehicleMessageFlick . flick ( 0 , - 500 )
}
MouseArea {
anchors.fill: parent
onClicked: {
criticalVehicleMessagePopup . close ( )
console . log ( "Clicked" , criticalVehicleMessagePopup . dropMessageIndicatorOnClose ) ;
if ( criticalVehicleMessagePopup . dropMessageIndicatorOnClose ) {
criticalVehicleMessagePopup . dropMessageIndicatorOnClose = false ;
QGroundControl . multiVehicleManager . activeVehicle . resetErrorLevelMessages ( ) ;
toolbar . dropMessageIndicatorTool ( ) ;
}
}
}