Added smiley and RetroShare link support for ForumMsgItem and MsgItem.

Added some new translations.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3965 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-01-13 22:19:20 +00:00
parent cdef45d4a3
commit 693bf4dd7c
6 changed files with 64 additions and 34 deletions

View File

@ -26,7 +26,7 @@
#include <retroshare/rsforums.h>
#include "gui/forums/CreateForumMsg.h"
#include "gui/chat/HandleRichText.h"
/****
* #define DEBUG_ITEM 1
@ -89,7 +89,7 @@ void ForumMsgItem::updateItemStatic()
}
else
{
titleLabel->setText("Unknown Forum Post");
titleLabel->setText(tr("Unknown Forum Post"));
}
/* get actual Message */
@ -115,7 +115,7 @@ void ForumMsgItem::updateItemStatic()
{
prevSHLabel->setText("Subject: ");
prevSubLabel->setText(QString::fromStdWString(msg.title));
prevMsgLabel->setText(QString::fromStdWString(msg.msg));
prevMsgLabel->setText(RsHtml::formatText(QString::fromStdWString(msg.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
QDateTime qtime;
qtime.setTime_t(msg.ts);
@ -127,7 +127,7 @@ void ForumMsgItem::updateItemStatic()
else
{
nextSubLabel->setText(QString::fromStdWString(msg.title));
nextMsgLabel->setText(QString::fromStdWString(msg.msg));
nextMsgLabel->setText(RsHtml::formatText(QString::fromStdWString(msg.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
QDateTime qtime;
qtime.setTime_t(msg.ts);
@ -140,7 +140,7 @@ void ForumMsgItem::updateItemStatic()
if (rsForums->getForumMessage(mForumId, msg.parentId, msgParent))
{
prevSubLabel->setText(QString::fromStdWString(msgParent.title));
prevMsgLabel->setText(QString::fromStdWString(msgParent.msg));
prevMsgLabel->setText(RsHtml::formatText(QString::fromStdWString(msgParent.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
}
else
{

View File

@ -64,7 +64,7 @@ border-radius: 10px}</string>
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/konversation.png</pixmap>
<pixmap>:/images/konversation.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@ -144,7 +144,7 @@ border-radius: 10px}</string>
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset>
<normaloff>:/images/edit_add24.png</normaloff>:/images/edit_add24.png</iconset>
</property>
</widget>
@ -164,7 +164,7 @@ border-radius: 10px}</string>
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset>
<normaloff>:/images/close_normal.png</normaloff>:/images/close_normal.png</iconset>
</property>
</widget>
@ -260,7 +260,7 @@ border-radius: 10px}</string>
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset>
<normaloff>:/images/mail_delete.png</normaloff>:/images/mail_delete.png</iconset>
</property>
</widget>
@ -296,7 +296,7 @@ border-radius: 10px}</string>
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset>
<normaloff>:/images/replymail24.png</normaloff>:/images/replymail24.png</iconset>
</property>
</widget>
@ -380,6 +380,9 @@ border-radius: 10px}</string>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -496,6 +499,9 @@ border-radius: 10px}</string>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
@ -508,8 +514,6 @@ border-radius: 10px}</string>
</item>
</layout>
</widget>
<resources>
<include location="../images.qrc"/>
</resources>
<resources/>
<connections/>
</ui>

View File

@ -26,6 +26,7 @@
#include "FeedHolder.h"
#include "SubFileItem.h"
#include "gui/msgs/MessageComposer.h"
#include "gui/chat/HandleRichText.h"
#include <retroshare/rsmsgs.h>
#include <retroshare/rspeers.h>
@ -81,18 +82,18 @@ void MsgItem::updateItemStatic()
mPeerId = mi.srcId;
QString title;
QString timestamp;
QString timestamp;
QString srcName = QString::fromStdString(rsPeers->getPeerName(mi.srcId));
{
QDateTime qtime;
qtime.setTime_t(mi.ts);
timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss");
timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss");
}
if (!mIsHome)
{
title = "Message From: ";
title = tr("Message From") + ": ";
}
else
{
@ -101,15 +102,15 @@ void MsgItem::updateItemStatic()
switch(box)
{
case RS_MSG_SENTBOX:
title = "Sent Msg: ";
title = tr("Sent Msg") + ": ";
replyButton->setEnabled(false);
break;
case RS_MSG_DRAFTBOX:
title = "Draft Msg: ";
title = tr("Draft Msg") + ": ";
replyButton->setEnabled(false);
break;
case RS_MSG_OUTBOX:
title = "Pending Msg: ";
title = tr("Pending Msg") + ": ";
//deleteButton->setEnabled(false);
replyButton->setEnabled(false);
break;
@ -121,11 +122,10 @@ void MsgItem::updateItemStatic()
}
title += srcName + " @ " + timestamp;
titleLabel->setText(title);
subjectLabel->setText(QString::fromStdWString(mi.title));
msgLabel->setText(QString::fromStdWString(mi.msg));
msgLabel->setText(RsHtml::formatText(QString::fromStdWString(mi.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
std::list<FileInfo>::iterator it;
for(it = mi.files.begin(); it != mi.files.end(); it++)

View File

@ -122,7 +122,7 @@ stop: 0 #2291E0, stop: 1 #3EB3FF);
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset>
<normaloff>:/images/edit_add24.png</normaloff>:/images/edit_add24.png</iconset>
</property>
</widget>
@ -142,7 +142,7 @@ stop: 0 #2291E0, stop: 1 #3EB3FF);
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset>
<normaloff>:/images/close_normal.png</normaloff>:/images/close_normal.png</iconset>
</property>
</widget>
@ -174,7 +174,7 @@ stop: 0 #2291E0, stop: 1 #3EB3FF);
<string>Reply Message</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset>
<normaloff>:/images/mail_reply.png</normaloff>:/images/mail_reply.png</iconset>
</property>
<property name="toolButtonStyle">
@ -213,7 +213,7 @@ stop: 0 #2291E0, stop: 1 #3EB3FF);
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset>
<normaloff>:/images/mail_delete.png</normaloff>:/images/mail_delete.png</iconset>
</property>
</widget>
@ -233,7 +233,7 @@ stop: 0 #2291E0, stop: 1 #3EB3FF);
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset>
<normaloff>:/images/startall.png</normaloff>:/images/startall.png</iconset>
</property>
</widget>
@ -262,6 +262,9 @@ stop: 0 #2291E0, stop: 1 #3EB3FF);
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
@ -272,8 +275,6 @@ stop: 0 #2291E0, stop: 1 #3EB3FF);
</item>
</layout>
</widget>
<resources>
<include location="../images.qrc"/>
</resources>
<resources/>
<connections/>
</ui>

View File

@ -2423,7 +2423,7 @@ p, li { white-space: pre-wrap; }
<translation>Als Antwort auf</translation>
</message>
<message>
<location line="+49"/>
<location line="+51"/>
<source>RetroShare</source>
<translation></translation>
</message>
@ -3446,12 +3446,12 @@ p, li { white-space: pre-wrap; }
<message>
<location line="+57"/>
<location line="+134"/>
<location line="+116"/>
<location line="+119"/>
<source>Subject: </source>
<translation>Betreff:</translation>
</message>
<message>
<location line="-191"/>
<location line="-194"/>
<source>Unsubscribe To Forum</source>
<translation>Forum abbestellen</translation>
</message>
@ -3461,7 +3461,12 @@ p, li { white-space: pre-wrap; }
<translation>Antwort</translation>
</message>
<message>
<location filename="../gui/feeds/ForumMsgItem.cpp" line="+137"/>
<location filename="../gui/feeds/ForumMsgItem.cpp" line="+92"/>
<source>Unknown Forum Post</source>
<translation>Unbekannter Forumbeitrag</translation>
</message>
<message>
<location line="+45"/>
<source>In Reply to</source>
<translation>Als Antwort auf</translation>
</message>
@ -6578,7 +6583,27 @@ p, li { white-space: pre-wrap; }
<translation>Auf Nachricht antworten</translation>
</message>
<message>
<location filename="../gui/feeds/MsgItem.cpp" line="-6"/>
<location filename="../gui/feeds/MsgItem.cpp" line="-107"/>
<source>Message From</source>
<translation>Nachricht von</translation>
</message>
<message>
<location line="+9"/>
<source>Sent Msg</source>
<translation>Gesendet</translation>
</message>
<message>
<location line="+4"/>
<source>Draft Msg</source>
<translation>Entwurf</translation>
</message>
<message>
<location line="+4"/>
<source>Pending Msg</source>
<translation>Wartend</translation>
</message>
<message>
<location line="+84"/>
<source>Hide</source>
<translation>Verbergen</translation>
</message>