diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index eb58211b8..2afc428f4 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -156,15 +156,7 @@ void PopupChatDialog::updateChat() } void PopupChatDialog::addChatMsg(ChatInfo *ci) -{ - //QTextBrowser *msgWidget = ui.textBrowser; - - //QString message = msgWidget->toHtml(); - - - /* add in lines at the bottom */ - //QString extraTxt; - +{ bool offline = true; { @@ -181,23 +173,16 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci) if (offline) { - QString line = "
\n ----- PEER OFFLINE (Chat will be lost) ----- \n
"; - - //extraTxt += line; + QString offlineMsg = "
\n ----- PEER OFFLINE (Chat will be lost) ----- \n
"; + ui.textBrowser->setHtml(ui.textBrowser->toHtml() + offlineMsg); } 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 message = QString::fromStdWString(ci -> msg); - QString message = QString::fromStdWString(ci -> msg); - - //currenttxt += extraTxt; - - QHashIterator i(smileys); + QHashIterator i(smileys); while(i.hasNext()) { i.next(); @@ -218,9 +203,6 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci) QTextCursor cursor = ui.textBrowser->textCursor(); cursor.movePosition(QTextCursor::End); ui.textBrowser->setTextCursor(cursor); - - //QScrollBar *qsb = ui.textBrowser->verticalScrollBar(); - //qsb -> setValue(qsb->maximum()); } void PopupChatDialog::checkChat()