Improve text coloring in log

This commit is contained in:
2024-06-04 16:41:50 +02:00
parent 342e5cc5db
commit 9519c9830c
2 changed files with 4 additions and 2 deletions
+3 -2
View File
@@ -90,6 +90,8 @@ BatchProcessing::BatchProcessing(QWidget *parent) : QDialog(parent)
connect(_ui->browseButton, &QPushButton::released, this, &BatchProcessing::browse); connect(_ui->browseButton, &QPushButton::released, this, &BatchProcessing::browse);
connect(_ui->openScriptsButton, &QPushButton::released, this, &BatchProcessing::openScriptDir); connect(_ui->openScriptsButton, &QPushButton::released, this, &BatchProcessing::openScriptDir);
_textColor = _ui->log->textColor();
QSettings settings; QSettings settings;
_ui->outputPath->setText(settings.value("batchprocessing/outputpath", QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).first()).toString()); _ui->outputPath->setText(settings.value("batchprocessing/outputpath", QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).first()).toString());
} }
@@ -214,8 +216,7 @@ void BatchProcessing::scriptFinished()
void BatchProcessing::newMessage(const QString &message, bool error) void BatchProcessing::newMessage(const QString &message, bool error)
{ {
QColor color = _ui->log->textColor();
if(error)_ui->log->setTextColor(Qt::red); if(error)_ui->log->setTextColor(Qt::red);
else _ui->log->setTextColor(_textColor);
_ui->log->append(message); _ui->log->append(message);
if(error)_ui->log->setTextColor(color);
} }
+1
View File
@@ -13,6 +13,7 @@ class BatchProcessing : public QDialog
QString _scriptBasePath; QString _scriptBasePath;
QFileSystemWatcher _fileWatcher; QFileSystemWatcher _fileWatcher;
Script::ScriptEngineThread *_engineThread = nullptr; Script::ScriptEngineThread *_engineThread = nullptr;
QColor _textColor;
private slots: private slots:
void scanScriptDir(); void scanScriptDir();
public: public: