Commit 2dfe72e5 authored by tstellanova's avatar tstellanova

Change message view styling based on severity

parent e98081fe
......@@ -53,7 +53,7 @@ void QGCMessageView::setActiveUAS(UASInterface* uas)
activeUAS = uas;
}
void QGCMessageView::handleTextMessage(int uasid, int componentid, int severity, QString text)
void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QString text)
{
// XXX color messages according to severity
......@@ -64,7 +64,16 @@ void QGCMessageView::handleTextMessage(int uasid, int componentid, int severity,
QScrollBar *scroller = msgWidget->verticalScrollBar();
UASInterface *uas = UASManager::instance()->getUASForId(uasid);
msgWidget->appendHtml(QString("<font color=\"%1\">[%2:%3] %4</font>\n").arg(uas->getColor().name()).arg(uas->getUASName()).arg(componentid).arg(text));
QString uasName(uas->getUASName());
QString colorName(uas->getColor().name());
//change styling based on severity
if (160 == severity ) { //TODO where is the constant for "critical" severity?
msgWidget->appendHtml(QString("<p style=\"color:#DC143C;background-color:#FFFACD;font-size:larger;font-weight:bold\">[%1:%2] %3</p>").arg(uasName).arg(compId).arg(text));
}
else {
msgWidget->appendHtml(QString("<p style=\"color:%1;font-size:smaller\">[%2:%3] %4</p>").arg(colorName).arg(uasName).arg(compId).arg(text));
}
// 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