summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2008-04-14 20:15:28 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2008-04-14 20:15:28 (GMT)
commit3052d2c85412fba525efcc3e3cda2cac4426ff4b (patch)
tree20afebd678823560f48ffe35734aa2b4fa51d137 /Source/QtDialog
parent629afe07ce50d027b26cf9a62986a08cb4dac578 (diff)
downloadCMake-3052d2c85412fba525efcc3e3cda2cac4426ff4b.zip
CMake-3052d2c85412fba525efcc3e3cda2cac4426ff4b.tar.gz
CMake-3052d2c85412fba525efcc3e3cda2cac4426ff4b.tar.bz2
BUG: Fix issue when non-error messages were incorrectly colored red.
Diffstat (limited to 'Source/QtDialog')
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx26
-rw-r--r--Source/QtDialog/CMakeSetupDialog.h3
2 files changed, 9 insertions, 20 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 1c5e25d..56ee7ac 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -138,6 +138,7 @@ CMakeSetupDialog::CMakeSetupDialog()
// fixed pitch font in output window
QFont outputFont("Courier");
this->Output->setFont(outputFont);
+ this->ErrorFormat.setForeground(QBrush(Qt::red));
// start the cmake worker thread
this->CMakeThread = new QCMakeThread(this);
@@ -512,32 +513,17 @@ void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent)
{
this->ProgressBar->setValue(qRound(percent * 100));
}
-
+
void CMakeSetupDialog::error(const QString& message)
{
- QStringList messages = message.split('\n');
- foreach(QString m, messages)
- {
- // make sure we escape html tags in the cmake messages
- m.replace(QString("&"), QString("&amp;"));
- m.replace(QString("<"), QString("&lt;"));
- m.replace(QString(">"), QString("&gt;"));
- m.replace(QString(" "), QString("&nbsp;"));
- this->Output->append(QString("<b><font color=red>%1</font></b>").arg(m));
- }
+ this->Output->setCurrentCharFormat(this->ErrorFormat);
+ this->Output->append(message);
}
void CMakeSetupDialog::message(const QString& message)
{
- QStringList messages = message.split('\n');
- foreach(QString m, messages)
- {
- // make sure we escape html tags in the cmake messages
- m.replace(QString("&"), QString("&amp;"));
- m.replace(QString("<"), QString("&lt;"));
- m.replace(QString(">"), QString("&gt;"));
- this->Output->append(m);
- }
+ this->Output->setCurrentCharFormat(this->MessageFormat);
+ this->Output->append(message);
}
void CMakeSetupDialog::setEnabledState(bool enabled)
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 211dfcb..c942d15 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -99,6 +99,9 @@ protected:
QAction* InstallForCommandLineAction;
State CurrentState;
+ QTextCharFormat ErrorFormat;
+ QTextCharFormat MessageFormat;
+
};
// QCMake instance on a thread