highlight error and warning messages in output window
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
|
||||
#include "logwindow.h"
|
||||
|
||||
#include "flagwarnings.h"
|
||||
#include "lammpsgui.h"
|
||||
|
||||
#include <QAction>
|
||||
@ -33,11 +34,13 @@ const QString LogWindow::yaml_regex =
|
||||
QStringLiteral("^(keywords:.*$|data:$|---$|\\.\\.\\.$| - \\[.*\\]$)");
|
||||
|
||||
LogWindow::LogWindow(const QString &_filename, QWidget *parent) :
|
||||
QPlainTextEdit(parent), filename(_filename)
|
||||
QPlainTextEdit(parent), filename(_filename), warnings(nullptr)
|
||||
{
|
||||
QSettings settings;
|
||||
resize(settings.value("logx", 500).toInt(), settings.value("logy", 320).toInt());
|
||||
|
||||
warnings = new FlagWarnings(document());
|
||||
|
||||
auto *action = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_S), this);
|
||||
connect(action, &QShortcut::activated, this, &LogWindow::save_as);
|
||||
action = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Y), this);
|
||||
@ -50,6 +53,11 @@ LogWindow::LogWindow(const QString &_filename, QWidget *parent) :
|
||||
installEventFilter(this);
|
||||
}
|
||||
|
||||
LogWindow::~LogWindow()
|
||||
{
|
||||
delete warnings;
|
||||
}
|
||||
|
||||
void LogWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
Reference in New Issue
Block a user