diff --git a/loggingwindow.cpp b/loggingwindow.cpp index 6282650..5b9c972 100644 --- a/loggingwindow.cpp +++ b/loggingwindow.cpp @@ -58,10 +58,21 @@ void loggingWindow::setInitialDebugState(bool debugModeEnabled) ui->debugBtn->blockSignals(false); } -void loggingWindow::acceptLogText(QString text) +void loggingWindow::acceptLogText(QPair text) { QMutexLocker lock(&textMutex); - ui->logTextDisplay->appendPlainText(text); + QString colour = "white"; + if (text.first == QtDebugMsg) + { + colour = "grey"; + } else if (text.first == QtWarningMsg) + { + colour = "yellow"; + } else if (text.first == QtCriticalMsg || text.first == QtFatalMsg) + { + colour = "red"; + } + ui->logTextDisplay->appendHtml(QString("

%1

").arg(colour).arg(text.second)); if(vertLogScroll->value() == vertLogScroll->maximum()) { horizLogScroll->setValue(horizLogScroll->minimum()); diff --git a/loggingwindow.h b/loggingwindow.h index d453eb7..3e6a5f7 100644 --- a/loggingwindow.h +++ b/loggingwindow.h @@ -27,7 +27,7 @@ class loggingWindow : public QWidget public: explicit loggingWindow(QString logFilename, QWidget *parent = 0); ~loggingWindow(); - void acceptLogText(QString text); + void acceptLogText(QPair text); public slots: void setInitialDebugState(bool debugModeEnabled); diff --git a/rigcommander.cpp b/rigcommander.cpp index 9e1f5a8..3ca6af4 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -803,7 +803,7 @@ void rigCommander::parseCommand() } case funcVFOBandMS: - value.setValue(payloadIn[0]); + value.setValue(static_cast(payloadIn[0])); break; case funcSatelliteMemory: memParser=rigCaps.satParser; diff --git a/wfmain.cpp b/wfmain.cpp index ba4f0d3..f8d2f1d 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -14,7 +14,7 @@ QScopedPointer m_logFile; QMutex logMutex; QMutex logTextMutex; -QVector logStringBuffer; +QVector> logStringBuffer; #ifdef QT_DEBUG bool debugModeLogging = true; #else @@ -5116,10 +5116,10 @@ void wfmain::logCheck() } } -void wfmain::handleLogText(QString text) +void wfmain::handleLogText(QPair logMessage) { // This function is just a pass-through - logWindow->acceptLogText(text); + logWindow->acceptLogText(logMessage); } void wfmain::setDebugLogging(bool debugModeOn) @@ -5177,7 +5177,7 @@ void wfmain::messageHandler(QtMsgType type, const QMessageLogContext& context, c text.append(": "); text.append(msg); logTextMutex.lock(); - logStringBuffer.push_front(text); + logStringBuffer.push_front(QPair(type,text)); logTextMutex.unlock(); } diff --git a/wfmain.h b/wfmain.h index eb80b2e..d42bb88 100644 --- a/wfmain.h +++ b/wfmain.h @@ -95,7 +95,7 @@ public: explicit wfmain(const QString settingsFile, const QString logFile, bool debugMode, QWidget *parent = 0); ~wfmain(); static void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg); - void handleLogText(QString text); + void handleLogText(QPair logMessage); #ifdef USB_HOTPLUG #if defined(Q_OS_WIN)