BUG: Fix issue when non-error messages were incorrectly colored red.
This commit is contained in:
parent
629afe07ce
commit
3052d2c854
@ -138,6 +138,7 @@ CMakeSetupDialog::CMakeSetupDialog()
|
|||||||
// fixed pitch font in output window
|
// fixed pitch font in output window
|
||||||
QFont outputFont("Courier");
|
QFont outputFont("Courier");
|
||||||
this->Output->setFont(outputFont);
|
this->Output->setFont(outputFont);
|
||||||
|
this->ErrorFormat.setForeground(QBrush(Qt::red));
|
||||||
|
|
||||||
// start the cmake worker thread
|
// start the cmake worker thread
|
||||||
this->CMakeThread = new QCMakeThread(this);
|
this->CMakeThread = new QCMakeThread(this);
|
||||||
@ -512,32 +513,17 @@ void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent)
|
|||||||
{
|
{
|
||||||
this->ProgressBar->setValue(qRound(percent * 100));
|
this->ProgressBar->setValue(qRound(percent * 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeSetupDialog::error(const QString& message)
|
void CMakeSetupDialog::error(const QString& message)
|
||||||
{
|
{
|
||||||
QStringList messages = message.split('\n');
|
this->Output->setCurrentCharFormat(this->ErrorFormat);
|
||||||
foreach(QString m, messages)
|
this->Output->append(message);
|
||||||
{
|
|
||||||
// make sure we escape html tags in the cmake messages
|
|
||||||
m.replace(QString("&"), QString("&"));
|
|
||||||
m.replace(QString("<"), QString("<"));
|
|
||||||
m.replace(QString(">"), QString(">"));
|
|
||||||
m.replace(QString(" "), QString(" "));
|
|
||||||
this->Output->append(QString("<b><font color=red>%1</font></b>").arg(m));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeSetupDialog::message(const QString& message)
|
void CMakeSetupDialog::message(const QString& message)
|
||||||
{
|
{
|
||||||
QStringList messages = message.split('\n');
|
this->Output->setCurrentCharFormat(this->MessageFormat);
|
||||||
foreach(QString m, messages)
|
this->Output->append(message);
|
||||||
{
|
|
||||||
// make sure we escape html tags in the cmake messages
|
|
||||||
m.replace(QString("&"), QString("&"));
|
|
||||||
m.replace(QString("<"), QString("<"));
|
|
||||||
m.replace(QString(">"), QString(">"));
|
|
||||||
this->Output->append(m);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeSetupDialog::setEnabledState(bool enabled)
|
void CMakeSetupDialog::setEnabledState(bool enabled)
|
||||||
|
@ -99,6 +99,9 @@ protected:
|
|||||||
QAction* InstallForCommandLineAction;
|
QAction* InstallForCommandLineAction;
|
||||||
State CurrentState;
|
State CurrentState;
|
||||||
|
|
||||||
|
QTextCharFormat ErrorFormat;
|
||||||
|
QTextCharFormat MessageFormat;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// QCMake instance on a thread
|
// QCMake instance on a thread
|
||||||
|
Loading…
x
Reference in New Issue
Block a user