From d4a8efbd2c7bbf6ca87036bd49f7caf3bbb7032d Mon Sep 17 00:00:00 2001 From: Bryant Date: Thu, 20 Feb 2014 16:34:00 -0800 Subject: [PATCH] QGCMessageView: Added timestamps. --- src/ui/uas/QGCMessageView.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ui/uas/QGCMessageView.cc b/src/ui/uas/QGCMessageView.cc index 2bf8963d3..5e234c609 100644 --- a/src/ui/uas/QGCMessageView.cc +++ b/src/ui/uas/QGCMessageView.cc @@ -148,8 +148,9 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr break; } - // Finally append the properly-styled text. - msgWidget->appendHtml(QString("

[%2:%3] %4 - %5

").arg(style).arg(uasName).arg(compId).arg(severityText).arg(text)); + // Finally append the properly-styled text with a timestamp. + QString dateString = QDateTime::currentDateTime().toString(Qt::SystemLocaleShortDate); + msgWidget->appendHtml(QString("

[%2][%3:%4] %5 - %6

").arg(style).arg(dateString).arg(uasName).arg(compId).arg(severityText).arg(text)); qDebug() << msgWidget->document()->toHtml(); // Ensure text area scrolls correctly -- 2.22.0