Commit cfe2cf55 authored by dogmaphobic's avatar dogmaphobic

Message Window Cleanup

parent 2896a075
......@@ -126,8 +126,6 @@
<file alias="MapSyncChanged.svg">src/FlightMap/Images/MapSyncChanged.svg</file>
<file alias="MapType.svg">src/FlightMap/Images/MapType.svg</file>
<file alias="MapTypeBlack.svg">src/FlightMap/Images/MapTypeBlack.svg</file>
<file alias="TrashDelete.svg">src/FlightMap/Images/TrashDelete.svg</file>
<file alias="TrashDeleteBlack.svg">src/FlightMap/Images/TrashDeleteBlack.svg</file>
<file alias="Armed.svg">src/ui/toolbar/Images/Armed.svg</file>
<file alias="Battery.svg">src/ui/toolbar/Images/Battery.svg</file>
<file alias="Connect.svg">src/ui/toolbar/Images/Connect.svg</file>
......@@ -174,6 +172,7 @@
<file alias="QGroundControlConnect">resources/QGroundControlConnect.svg</file>
<file alias="SplashScreen">resources/SplashScreen.png</file>
<file alias="Stop">resources/Stop.svg</file>
<file alias="TrashDelete.svg">resources/TrashDelete.svg</file>
<file alias="XDelete.svg">resources/XDelete.svg</file>
<file alias="XDeleteBlack.svg">resources/XDeleteBlack.svg</file>
</qresource>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="-89 46 72 72" enable-background="new -89 46 72 72" xml:space="preserve">
<g>
<path fill="none" d="M-71.309,68.986"/>
</g>
<rect x="-64.709" y="65.8" fill="#FFFFFF" width="23.417" height="4.797"/>
<path fill="#FFFFFF" d="M-41.291,72.001h-23.417V98.2h23.417L-41.291,72.001L-41.291,72.001z M-44.381,94.749h-3.24V75.731h3.24
V94.749z M-51.38,94.749h-3.24V75.731h3.24V94.749z M-58.081,94.749h-3.24V75.731h3.24V94.749z"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="-89 46 72 72" enable-background="new -89 46 72 72" xml:space="preserve">
<rect x="-78.911" y="46" fill="#FFFFFF" width="51.822" height="10.66"/>
<path fill="#FFFFFF" d="M-27.089,59.781h-51.822V118h51.822L-27.089,59.781L-27.089,59.781z M-33.927,110.332h-7.17V68.068h7.17
V110.332z M-49.416,110.332h-7.17V68.068h7.17V110.332z M-64.245,110.332h-7.17V68.068h7.17V110.332z"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="-89 46 72 72" enable-background="new -89 46 72 72" xml:space="preserve">
<g>
<path fill="none" d="M-71.309,68.986"/>
</g>
<rect x="-64.709" y="65.8" fill="#231F20" width="23.417" height="4.797"/>
<path fill="#231F20" d="M-41.291,72.001h-23.417V98.2h23.417L-41.291,72.001L-41.291,72.001z M-44.381,94.749h-3.24V75.731h3.24
V94.749z M-51.38,94.749h-3.24V75.731h3.24V94.749z M-58.081,94.749h-3.24V75.731h3.24V94.749z"/>
</svg>
......@@ -922,6 +922,11 @@ QString Vehicle::formatedMessages()
return messages;
}
void Vehicle::clearMessages()
{
qgcApp()->toolbox()->uasMessageHandler()->clearMessages();
}
void Vehicle::_handletextMessageReceived(UASMessage* message)
{
if(message)
......
......@@ -363,6 +363,9 @@ public:
/// Reboot vehicle
Q_INVOKABLE void rebootVehicle();
/// Clear Messages
Q_INVOKABLE void clearMessages();
bool guidedModeSupported(void) const;
bool pauseVehicleSupported(void) const;
......
......@@ -349,13 +349,11 @@ Item {
//-- System Message Area
Rectangle {
id: messageArea
function close() {
currentPopUp = null
messageText.text = ""
messageArea.visible = false
}
width: mainWindow.width * 0.5
height: mainWindow.height * 0.5
color: Qt.rgba(0,0,0,0.8)
......@@ -366,6 +364,13 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: tbHeight + ScreenTools.defaultFontPixelHeight
MouseArea {
// This MouseArea prevents the Map below it from getting Mouse events. Without this
// things like mousewheel will scroll the Flickable and then scroll the map as well.
anchors.fill: parent
preventStealing: true
onWheel: wheel.accepted = true
}
QGCFlickable {
id: messageFlick
anchors.margins: ScreenTools.defaultFontPixelHeight
......@@ -383,7 +388,7 @@ Item {
}
//-- Dismiss System Message
Image {
//anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5
anchors.top: parent.top
anchors.right: parent.right
width: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 1.5 : ScreenTools.defaultFontPixelHeight
......@@ -400,7 +405,30 @@ Item {
}
}
}
//-- Clear Messages
Image {
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5
height: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 1.5 : ScreenTools.defaultFontPixelHeight
width: height
sourceSize.height: height
source: "/res/TrashDelete.svg"
fillMode: Image.PreserveAspectFit
mipmap: true
smooth: true
MouseArea {
anchors.fill: parent
onClicked: {
if(QGroundControl.multiVehicleManager.activeVehicleAvailable) {
activeVehicle.clearMessages();
messageArea.close()
}
}
}
}
}
//-------------------------------------------------------------------------
//-- Critical Message Area
Rectangle {
......@@ -468,7 +496,7 @@ Item {
//-- Dismiss Critical Message
QGCColoredImage {
id: criticalClose
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5
anchors.top: parent.top
anchors.right: parent.right
width: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 1.5 : ScreenTools.defaultFontPixelHeight
......@@ -487,7 +515,7 @@ Item {
//-- More text below indicator
QGCColoredImage {
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5
anchors.bottom: parent.bottom
anchors.right: parent.right
width: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 1.5 : ScreenTools.defaultFontPixelHeight
......
......@@ -87,7 +87,11 @@ void UASMessageViewWidget::handleTextMessage(UASMessage *message)
// Turn off updates while we're appending content to avoid breaking the autoscroll behavior
msgWidget->setUpdatesEnabled(false);
QScrollBar *scroller = msgWidget->verticalScrollBar();
msgWidget->appendHtml(message->getFormatedText());
QString messages = message->getFormatedText();
messages = messages.replace("<#E>", "color: #f95e5e; font: monospace;");
messages = messages.replace("<#I>", "color: #f9b55e; font: monospace;");
messages = messages.replace("<#N>", "color: #ffffff; font: monospace;");
msgWidget->appendHtml(messages);
// Ensure text area scrolls correctly
scroller->setValue(scroller->maximum());
msgWidget->setUpdatesEnabled(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment