- Auto-scroll standard aktiv
- Tag-Filter wird gespeichert - Tag Monitor kann bei einem Tag jetzt pro Key mehrere Werte in einer Tabelle anzeigen - Bug für Clear behoben
This commit is contained in:
@@ -24,7 +24,6 @@ void RawView::setupUi()
|
||||
mainLayout->setContentsMargins(4, 4, 4, 4);
|
||||
mainLayout->setSpacing(4);
|
||||
|
||||
// ── Toolbar ──────────────────────────────────────────────────────────────
|
||||
auto *toolbar = new QHBoxLayout();
|
||||
|
||||
m_searchEdit = new QLineEdit(this);
|
||||
@@ -33,7 +32,7 @@ void RawView::setupUi()
|
||||
connect(m_searchEdit, &QLineEdit::textChanged, this, &RawView::onSearch);
|
||||
|
||||
m_autoScrollCb = new QCheckBox(tr("Auto-scroll"), this);
|
||||
m_autoScrollCb->setChecked(true);
|
||||
m_autoScrollCb->setChecked(true); // default ON
|
||||
connect(m_autoScrollCb, &QCheckBox::toggled, this, &RawView::onAutoScrollToggled);
|
||||
|
||||
m_lineCountLbl = new QLabel(tr("Lines: 0"), this);
|
||||
@@ -54,11 +53,10 @@ void RawView::setupUi()
|
||||
toolbar->addWidget(m_clearBtn);
|
||||
mainLayout->addLayout(toolbar);
|
||||
|
||||
// ── Text area ─────────────────────────────────────────────────────────────
|
||||
m_textEdit = new QPlainTextEdit(this);
|
||||
m_textEdit->setReadOnly(true);
|
||||
m_textEdit->setLineWrapMode(QPlainTextEdit::NoWrap);
|
||||
m_textEdit->setMaximumBlockCount(0); // unlimited
|
||||
m_textEdit->setMaximumBlockCount(0);
|
||||
|
||||
QFont monoFont("Monospace");
|
||||
monoFont.setStyleHint(QFont::Monospace);
|
||||
@@ -84,39 +82,27 @@ void RawView::applyColorScheme()
|
||||
|
||||
void RawView::appendLine(const QString &line, const QSet<QString> &suppressedTags)
|
||||
{
|
||||
// Check whether this line belongs to a suppressed tag
|
||||
if (!suppressedTags.isEmpty()) {
|
||||
const auto match = s_tagRe.match(line);
|
||||
if (match.hasMatch()) {
|
||||
if (suppressedTags.contains(match.captured(1).toUpper()))
|
||||
return; // silently drop – it goes to the Tag Monitor only
|
||||
}
|
||||
if (match.hasMatch() && suppressedTags.contains(match.captured(1).toUpper()))
|
||||
return;
|
||||
}
|
||||
|
||||
++m_lineCount;
|
||||
m_lineCountLbl->setText(tr("Lines: %1").arg(m_lineCount));
|
||||
|
||||
// Prepend timestamp
|
||||
const QString ts = QDateTime::currentDateTime().toString("hh:mm:ss.zzz");
|
||||
const QString displayLine = QStringLiteral("[%1] %2").arg(ts, line);
|
||||
|
||||
// Colour tag lines cyan, everything else default
|
||||
const bool hasTag = s_tagRe.match(line).hasMatch();
|
||||
|
||||
QTextCursor cursor(m_textEdit->document());
|
||||
cursor.movePosition(QTextCursor::End);
|
||||
|
||||
QTextCharFormat fmt;
|
||||
if (hasTag)
|
||||
fmt.setForeground(QColor(0x56, 0xb6, 0xc2)); // cyan
|
||||
else
|
||||
fmt.setForeground(QColor(0xd4, 0xd4, 0xd4)); // default
|
||||
|
||||
// Dim the timestamp portion
|
||||
QTextCharFormat tsFmt;
|
||||
tsFmt.setForeground(QColor(0x60, 0x60, 0x60));
|
||||
|
||||
cursor.insertText(QStringLiteral("[%1] ").arg(ts), tsFmt);
|
||||
|
||||
QTextCharFormat fmt;
|
||||
fmt.setForeground(hasTag ? QColor(0x56, 0xb6, 0xc2) : QColor(0xd4, 0xd4, 0xd4));
|
||||
cursor.insertText(line + '\n', fmt);
|
||||
|
||||
if (m_autoScroll)
|
||||
|
||||
Reference in New Issue
Block a user