--- a/QTfrontend/chatwidget.cpp Tue Jan 06 14:18:09 2009 +0000
+++ b/QTfrontend/chatwidget.cpp Tue Jan 06 14:29:34 2009 +0000
@@ -22,6 +22,7 @@
#include <QLineEdit>
#include <QAction>
#include <QApplication>
+#include <QTextDocument>
#include "chatwidget.h"
@@ -74,6 +75,18 @@
if (chatStrings.size() > 250)
chatStrings.removeFirst();
+ chatStrings.append(Qt::escape(str));
+
+ chatText->setHtml(chatStrings.join("<br>"));
+
+ chatText->moveCursor(QTextCursor::End);
+}
+
+void HWChatWidget::onServerMessage(const QString& str)
+{
+ if (chatStrings.size() > 250)
+ chatStrings.removeFirst();
+
chatStrings.append(str);
chatText->setHtml(chatStrings.join("<br>"));