Improve text coloring in log
This commit is contained in:
+3
-2
@@ -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);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user