From aa393dcc726c63878cec15bcc304d4fede00dfc4 Mon Sep 17 00:00:00 2001 From: drbob Date: Wed, 16 Apr 2008 12:35:01 +0000 Subject: [PATCH] disbled new popupchat style stuff - until it works without style files. removed release flag from mainwindow. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@507 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/MainWindow.cpp | 2 - .../src/gui/chat/PopupChatDialog.cpp | 46 ++++++++++--------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 90829d335..8e6376e66 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -91,8 +91,6 @@ * #define RS_RELEASE_VERSION 1 ****/ -#define RS_RELEASE_VERSION 1 - /** Constructor */ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) : QMainWindow(parent, flags) diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index 16032aed4..9577a747b 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -155,16 +155,13 @@ void PopupChatDialog::updateChat() } -void PopupChatDialog::addChatMsg(ChatInfo *ci) -{ - //QTextBrowser *msgWidget = ui.textBrowser; - - //QString message = msgWidget->toHtml(); - - - /* add in lines at the bottom */ - //QString extraTxt; +void PopupChatDialog::addChatMsg(ChatInfo *ci) +{ + QTextBrowser *msgWidget = ui.textBrowser; + QString currenttxt = msgWidget->toHtml(); + /* add in lines at the bottom */ + QString extraTxt; bool offline = true; @@ -184,26 +181,30 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci) { QString line = "
\n ----- PEER OFFLINE (Chat will be lost) ----- \n
"; - //extraTxt += line; + extraTxt += line; } - QString timestamp = "[" + QDateTime::currentDateTime().toString("hh:mm:ss") + "]"; - QString name = QString::fromStdString(ci ->name); - //QString line = "" + timestamp + "" + - // "" + " " + name + ""; - //extraTxt += line; + QString name = QString::fromStdString(ci ->name); + QString line = "" + timestamp + "" + + "" + " " + name + ""; + extraTxt += line; + extraTxt += QString::fromStdWString(ci -> msg); - QString message = QString::fromStdWString(ci -> msg); + //QString message = QString::fromStdWString(ci -> msg); - //currenttxt += extraTxt; - - QHashIterator i(smileys); + QHashIterator i(smileys); while(i.hasNext()) { i.next(); - message.replace(i.key(), ""); - } + extraTxt.replace(i.key(), ""); + //message.replace(i.key(), ""); + } + + currenttxt += extraTxt; + ui.textBrowser->setHtml(currenttxt); + +#if 0 history /*<< nickColor << color << font << fontSize*/ << timestamp << name << message; QString formatMsg = loadEmptyStyle()/*.replace(nickColor) @@ -215,7 +216,8 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci) .replace("%message%", message); ui.textBrowser->setHtml(ui.textBrowser->toHtml() + formatMsg + "\n"); - +#endif + QTextCursor cursor = ui.textBrowser->textCursor(); cursor.movePosition(QTextCursor::End); ui.textBrowser->setTextCursor(cursor);