mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-18 10:02:41 -05:00
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
This commit is contained in:
parent
3b03f084fa
commit
8103b0c372
1 changed files with 6 additions and 24 deletions
|
|
@ -156,15 +156,7 @@ void PopupChatDialog::updateChat()
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupChatDialog::addChatMsg(ChatInfo *ci)
|
void PopupChatDialog::addChatMsg(ChatInfo *ci)
|
||||||
{
|
{
|
||||||
//QTextBrowser *msgWidget = ui.textBrowser;
|
|
||||||
|
|
||||||
//QString message = msgWidget->toHtml();
|
|
||||||
|
|
||||||
|
|
||||||
/* add in lines at the bottom */
|
|
||||||
//QString extraTxt;
|
|
||||||
|
|
||||||
bool offline = true;
|
bool offline = true;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -181,23 +173,16 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci)
|
||||||
|
|
||||||
if (offline)
|
if (offline)
|
||||||
{
|
{
|
||||||
QString line = "<br>\n<span style=\"color:#1D84C9\"><strong> ----- PEER OFFLINE (Chat will be lost) -----</strong></span> \n<br>";
|
QString offlineMsg = "<br>\n<span style=\"color:#1D84C9\"><strong> ----- PEER OFFLINE (Chat will be lost) -----</strong></span> \n<br>";
|
||||||
|
ui.textBrowser->setHtml(ui.textBrowser->toHtml() + offlineMsg);
|
||||||
//extraTxt += line;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString timestamp = "[" + QDateTime::currentDateTime().toString("hh:mm:ss") + "]";
|
QString timestamp = "[" + QDateTime::currentDateTime().toString("hh:mm:ss") + "]";
|
||||||
QString name = QString::fromStdString(ci ->name);
|
QString name = QString::fromStdString(ci ->name);
|
||||||
//QString line = "<span style=\"color:#C00000\"><strong>" + timestamp + "</strong></span>" +
|
QString message = QString::fromStdWString(ci -> msg);
|
||||||
// "<span style=\"color:#2D84C9\"><strong>" + " " + name + "</strong></span>";
|
|
||||||
//extraTxt += line;
|
|
||||||
|
|
||||||
QString message = QString::fromStdWString(ci -> msg);
|
QHashIterator<QString, QString> i(smileys);
|
||||||
|
|
||||||
//currenttxt += extraTxt;
|
|
||||||
|
|
||||||
QHashIterator<QString, QString> i(smileys);
|
|
||||||
while(i.hasNext())
|
while(i.hasNext())
|
||||||
{
|
{
|
||||||
i.next();
|
i.next();
|
||||||
|
|
@ -218,9 +203,6 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci)
|
||||||
QTextCursor cursor = ui.textBrowser->textCursor();
|
QTextCursor cursor = ui.textBrowser->textCursor();
|
||||||
cursor.movePosition(QTextCursor::End);
|
cursor.movePosition(QTextCursor::End);
|
||||||
ui.textBrowser->setTextCursor(cursor);
|
ui.textBrowser->setTextCursor(cursor);
|
||||||
|
|
||||||
//QScrollBar *qsb = ui.textBrowser->verticalScrollBar();
|
|
||||||
//qsb -> setValue(qsb->maximum());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupChatDialog::checkChat()
|
void PopupChatDialog::checkChat()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue