diff options
| author | Manjeet Dahiya <manjeetdahiya@gmail.com> | 2010-10-11 07:32:37 +0000 |
|---|---|---|
| committer | Manjeet Dahiya <manjeetdahiya@gmail.com> | 2010-10-11 07:32:37 +0000 |
| commit | 3b056816598df8c156718a4df1ce8cd4aced1cb9 (patch) | |
| tree | 818997e35dc0d37cfd1f517f51dcf885f8b51dfa /examples/GuiClient/xmlConsoleDialog.cpp | |
| parent | 9ff92ee5fcc20dc2138c14287256512953378094 (diff) | |
| download | qxmpp-3b056816598df8c156718a4df1ce8cd4aced1cb9.tar.gz | |
color scheme for console
Diffstat (limited to 'examples/GuiClient/xmlConsoleDialog.cpp')
| -rw-r--r-- | examples/GuiClient/xmlConsoleDialog.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/GuiClient/xmlConsoleDialog.cpp b/examples/GuiClient/xmlConsoleDialog.cpp index 6f674de3..9bb53e7a 100644 --- a/examples/GuiClient/xmlConsoleDialog.cpp +++ b/examples/GuiClient/xmlConsoleDialog.cpp @@ -19,6 +19,19 @@ xmlConsoleDialog::~xmlConsoleDialog() void xmlConsoleDialog::message(QXmppLogger::MessageType type, const QString& text)
{
+ QColor color;
+ switch(type)
+ {
+ case QXmppLogger::ReceivedMessage:
+ color = QColor("#aa0000");
+ break;
+ case QXmppLogger::SentMessage:
+ color = QColor("#02aa3f");
+ break;
+ default:
+ return;
+ }
+
QDomDocument doc;
// Indent XML string
@@ -27,6 +40,7 @@ void xmlConsoleDialog::message(QXmppLogger::MessageType type, const QString& tex QTextStream stream(&formattedText);
doc.save(stream, 2);
+ ui->textBrowser->setTextColor(color);
if(isXml)
ui->textBrowser->append(formattedText);
else
|
