diff --git a/src/Gui/DlgReportView.ui b/src/Gui/DlgReportView.ui index 45e2a5d682..58e835cb04 100644 --- a/src/Gui/DlgReportView.ui +++ b/src/Gui/DlgReportView.ui @@ -7,7 +7,7 @@ 0 0 432 - 411 + 500 @@ -166,6 +166,25 @@ on-screen while displaying the log message + + + + Include a timecode for each report + + + Include a timecode for each entry + + + true + + + checkShowReportTimecode + + + OutputWindow + + + @@ -553,6 +572,7 @@ from Python console to Report view panel checkShowReportViewOnError checkShowReportViewOnNormalMessage checkShowReportViewOnLogMessage + checkShowReportTimecode colorText colorLogging colorWarning diff --git a/src/Gui/DlgReportViewImp.cpp b/src/Gui/DlgReportViewImp.cpp index a53adb767c..9da5eb8dbe 100644 --- a/src/Gui/DlgReportViewImp.cpp +++ b/src/Gui/DlgReportViewImp.cpp @@ -65,6 +65,7 @@ void DlgReportViewImp::saveSettings() ui->checkShowReportViewOnError->onSave(); ui->checkShowReportViewOnNormalMessage->onSave(); ui->checkShowReportViewOnLogMessage->onSave(); + ui->checkShowReportTimecode->onSave(); ui->colorText->onSave(); ui->colorLogging->onSave(); ui->colorWarning->onSave(); @@ -82,6 +83,7 @@ void DlgReportViewImp::loadSettings() ui->checkShowReportViewOnError->onRestore(); ui->checkShowReportViewOnNormalMessage->onRestore(); ui->checkShowReportViewOnLogMessage->onRestore(); + ui->checkShowReportTimecode->onRestore(); ui->colorText->onRestore(); ui->colorLogging->onRestore(); ui->colorWarning->onRestore(); diff --git a/src/Gui/ReportView.cpp b/src/Gui/ReportView.cpp index e290178dc5..0c35e0c426 100644 --- a/src/Gui/ReportView.cpp +++ b/src/Gui/ReportView.cpp @@ -29,6 +29,7 @@ # include # include # include +# include # include # include #endif @@ -415,7 +416,17 @@ void ReportOutput::SendLog(const std::string& msg, Base::LogStyle level) break; } - QString qMsg = QString::fromUtf8(msg.c_str()); + QString qMsg; + + bool showTimecode = getWindowParameter()->GetBool("checkShowReportTimecode", true); + if (showTimecode) { + QTime time = QTime::currentTime(); + qMsg = time.toString(QLatin1String("hh:mm:ss ")); + qMsg += QString::fromUtf8(msg.c_str()); + } + else { + qMsg = QString::fromUtf8(msg.c_str()); + } // This truncates log messages that are too long if (style == ReportHighlighter::LogText) {