Commit b9c0958a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to show red text when error

parent ec500df6
Pipeline #202282 passed with stage
in 13 minutes and 24 seconds
......@@ -47,6 +47,11 @@ void AkonadiDatabaseToolsDialog::appendText(const QString &text)
mAkonadiDatabaseToolsWidget->appendText(text);
}
void AkonadiDatabaseToolsDialog::appendErrorText(const QString &text)
{
mAkonadiDatabaseToolsWidget->appendText(QStringLiteral("<font color=#FF0000>%1</font>").arg(text));
}
void AkonadiDatabaseToolsDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
......
......@@ -17,6 +17,7 @@ public:
~AkonadiDatabaseToolsDialog() override;
void appendText(const QString &text);
void appendErrorText(const QString &text);
private:
void writeConfig();
......
......@@ -56,7 +56,7 @@ void AkonadiDatabaseToolsPluginInterface::exec()
dlg->show();
auto job = new AkonadiDatabaseToolsJob(this);
job->setTool(mTool);
connect(job, &AkonadiDatabaseToolsJob::receivedStandardError, dlg, &AkonadiDatabaseToolsDialog::appendText);
connect(job, &AkonadiDatabaseToolsJob::receivedStandardError, dlg, &AkonadiDatabaseToolsDialog::appendErrorText);
connect(job, &AkonadiDatabaseToolsJob::receivedStandardOutput, dlg, &AkonadiDatabaseToolsDialog::appendText);
connect(job, &AkonadiDatabaseToolsJob::finished, dlg, [this, dlg]() {
dlg->appendText(QStringLiteral("---------"));
......
......@@ -24,5 +24,5 @@ AkonadiDatabaseToolsWidget::~AkonadiDatabaseToolsWidget() = default;
void AkonadiDatabaseToolsWidget::appendText(const QString &text)
{
mPlainTextEdit->insertPlainText(text);
mPlainTextEdit->appendHtml(text);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment