From 8103b0c372bf98185148023f4109aae414408e42 Mon Sep 17 00:00:00 2001 From: drbob Date: Sat, 7 Jun 2008 17:52:53 +0000 Subject: [PATCH] Restored 'Peer Offline' notification to Chat Window. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@585 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../src/gui/chat/PopupChatDialog.cpp | 30 ++++--------------- 1 file changed, 6 insertions(+), 24 deletions(-) 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()