Changed style of the reply/forwarded message.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5141 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-05-04 23:39:36 +00:00
parent 173ce82099
commit 2611da2f72
10 changed files with 296 additions and 175 deletions

View file

@ -1517,6 +1517,27 @@ void ForumsDialog::editForumDetails()
editUi.exec();
}
static QString buildReplyHeader(const ForumMsgInfo &msgInfo)
{
RetroShareLink link;
link.createMessage(msgInfo.srcId, "");
QString from = link.toHtml();
QDateTime qtime;
qtime.setTime_t(msgInfo.ts);
QString header = QString("<span>-----%1-----").arg(QApplication::translate("ForumsDialog", "Original Message"));
header += QString("<br><font size='3'><strong>%1: </strong>%2</font><br>").arg(QApplication::translate("ForumsDialog", "From"), from);
header += QString("<br><font size='3'><strong>%1: </strong>%2</font><br>").arg(QApplication::translate("ForumsDialog", "Sent"), qtime.toString(Qt::SystemLocaleLongDate));
header += QString("<font size='3'><strong>%1: </strong>%2</font></span><br>").arg(QApplication::translate("ForumsDialog", "Subject"), QString::fromStdWString(msgInfo.title));
header += "<br>";
header += QApplication::translate("ForumsDialog", "On %1, %2 wrote:").arg(qtime.toString(Qt::SystemLocaleShortDate), from);
return header;
}
void ForumsDialog::replytomessage()
{
if (mCurrForumId.empty()) {
@ -1532,13 +1553,11 @@ void ForumsDialog::replytomessage()
if (rsPeers->getPeerName(msgInfo.srcId) !="")
{
MessageComposer *nMsgDialog = MessageComposer::newMsg();
nMsgDialog->insertTitleText(QString::fromStdWString(msgInfo.title), MessageComposer::REPLY);
nMsgDialog->setTitleText(QString::fromStdWString(msgInfo.title), MessageComposer::REPLY);
QTextDocument doc ;
doc.setHtml(QString::fromStdWString(msgInfo.msg)) ;
nMsgDialog->insertPastedText(doc.toPlainText());
nMsgDialog->setQuotedMsg(QString::fromStdWString(msgInfo.msg), buildReplyHeader(msgInfo));
nMsgDialog->addRecipient(MessageComposer::TO, msgInfo.srcId, false);
nMsgDialog->show();
nMsgDialog->activateWindow();