From f4968ef3c88349414cc649a4f9e566dacb47b064 Mon Sep 17 00:00:00 2001 From: Manjeet Dahiya Date: Sat, 11 Dec 2010 11:42:37 +0000 Subject: eol style --- examples/GuiClient/xmlConsoleDialog.cpp | 114 ++++++++++++++++---------------- 1 file changed, 57 insertions(+), 57 deletions(-) (limited to 'examples/GuiClient/xmlConsoleDialog.cpp') diff --git a/examples/GuiClient/xmlConsoleDialog.cpp b/examples/GuiClient/xmlConsoleDialog.cpp index e915d53b..dd2d4f19 100644 --- a/examples/GuiClient/xmlConsoleDialog.cpp +++ b/examples/GuiClient/xmlConsoleDialog.cpp @@ -1,57 +1,57 @@ -#include "xmlConsoleDialog.h" -#include "ui_xmlConsoleDialog.h" - -#include -#include - -static QString s_colorHexSent("#02aa3f"); -static QString s_colorHexReceived("#aa0000"); - -xmlConsoleDialog::xmlConsoleDialog(QWidget *parent) : - QDialog(parent, Qt::Window), - ui(new Ui::xmlConsoleDialog) -{ - ui->setupUi(this); - setWindowTitle("Debugging Console"); - - ui->label_legend->setText( - QString("

Sent | Received

").arg(s_colorHexSent).arg(s_colorHexReceived)); -} - -xmlConsoleDialog::~xmlConsoleDialog() -{ - delete ui; -} - -void xmlConsoleDialog::message(QXmppLogger::MessageType type, const QString& text) -{ - if(!ui->checkBox_enable->isChecked()) - return; - - QColor color; - switch(type) - { - case QXmppLogger::ReceivedMessage: - color = QColor(s_colorHexReceived); - break; - case QXmppLogger::SentMessage: - color = QColor(s_colorHexSent); - break; - default: - return; - } - - QDomDocument doc; - -// Indent XML string - bool isXml = doc.setContent(text); - QString formattedText; - QTextStream stream(&formattedText); - doc.save(stream, 2); - - ui->textBrowser->setTextColor(color); - if(isXml) - ui->textBrowser->append(formattedText); - else - ui->textBrowser->append(text); -} +#include "xmlConsoleDialog.h" +#include "ui_xmlConsoleDialog.h" + +#include +#include + +static QString s_colorHexSent("#02aa3f"); +static QString s_colorHexReceived("#aa0000"); + +xmlConsoleDialog::xmlConsoleDialog(QWidget *parent) : + QDialog(parent, Qt::Window), + ui(new Ui::xmlConsoleDialog) +{ + ui->setupUi(this); + setWindowTitle("Debugging Console"); + + ui->label_legend->setText( + QString("

Sent | Received

").arg(s_colorHexSent).arg(s_colorHexReceived)); +} + +xmlConsoleDialog::~xmlConsoleDialog() +{ + delete ui; +} + +void xmlConsoleDialog::message(QXmppLogger::MessageType type, const QString& text) +{ + if(!ui->checkBox_enable->isChecked()) + return; + + QColor color; + switch(type) + { + case QXmppLogger::ReceivedMessage: + color = QColor(s_colorHexReceived); + break; + case QXmppLogger::SentMessage: + color = QColor(s_colorHexSent); + break; + default: + return; + } + + QDomDocument doc; + +// Indent XML string + bool isXml = doc.setContent(text); + QString formattedText; + QTextStream stream(&formattedText); + doc.save(stream, 2); + + ui->textBrowser->setTextColor(color); + if(isXml) + ui->textBrowser->append(formattedText); + else + ui->textBrowser->append(text); +} -- cgit v1.2.3