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

View File

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

View File

@ -26,6 +26,7 @@
#include "FeedHolder.h" #include "FeedHolder.h"
#include "SubFileItem.h" #include "SubFileItem.h"
#include "gui/msgs/MessageComposer.h" #include "gui/msgs/MessageComposer.h"
#include "gui/chat/HandleRichText.h"
#include <retroshare/rsmsgs.h> #include <retroshare/rsmsgs.h>
#include <retroshare/rspeers.h> #include <retroshare/rspeers.h>
@ -92,7 +93,7 @@ void MsgItem::updateItemStatic()
if (!mIsHome) if (!mIsHome)
{ {
title = "Message From: "; title = tr("Message From") + ": ";
} }
else else
{ {
@ -101,15 +102,15 @@ void MsgItem::updateItemStatic()
switch(box) switch(box)
{ {
case RS_MSG_SENTBOX: case RS_MSG_SENTBOX:
title = "Sent Msg: "; title = tr("Sent Msg") + ": ";
replyButton->setEnabled(false); replyButton->setEnabled(false);
break; break;
case RS_MSG_DRAFTBOX: case RS_MSG_DRAFTBOX:
title = "Draft Msg: "; title = tr("Draft Msg") + ": ";
replyButton->setEnabled(false); replyButton->setEnabled(false);
break; break;
case RS_MSG_OUTBOX: case RS_MSG_OUTBOX:
title = "Pending Msg: "; title = tr("Pending Msg") + ": ";
//deleteButton->setEnabled(false); //deleteButton->setEnabled(false);
replyButton->setEnabled(false); replyButton->setEnabled(false);
break; break;
@ -121,11 +122,10 @@ void MsgItem::updateItemStatic()
} }
title += srcName + " @ " + timestamp; title += srcName + " @ " + timestamp;
titleLabel->setText(title); titleLabel->setText(title);
subjectLabel->setText(QString::fromStdWString(mi.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; std::list<FileInfo>::iterator it;
for(it = mi.files.begin(); it != mi.files.end(); it++) for(it = mi.files.begin(); it != mi.files.end(); it++)

View File

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

View File

@ -2423,7 +2423,7 @@ p, li { white-space: pre-wrap; }
<translation>Als Antwort auf</translation> <translation>Als Antwort auf</translation>
</message> </message>
<message> <message>
<location line="+49"/> <location line="+51"/>
<source>RetroShare</source> <source>RetroShare</source>
<translation></translation> <translation></translation>
</message> </message>
@ -3446,12 +3446,12 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location line="+57"/> <location line="+57"/>
<location line="+134"/> <location line="+134"/>
<location line="+116"/> <location line="+119"/>
<source>Subject: </source> <source>Subject: </source>
<translation>Betreff:</translation> <translation>Betreff:</translation>
</message> </message>
<message> <message>
<location line="-191"/> <location line="-194"/>
<source>Unsubscribe To Forum</source> <source>Unsubscribe To Forum</source>
<translation>Forum abbestellen</translation> <translation>Forum abbestellen</translation>
</message> </message>
@ -3461,7 +3461,12 @@ p, li { white-space: pre-wrap; }
<translation>Antwort</translation> <translation>Antwort</translation>
</message> </message>
<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> <source>In Reply to</source>
<translation>Als Antwort auf</translation> <translation>Als Antwort auf</translation>
</message> </message>
@ -6578,7 +6583,27 @@ p, li { white-space: pre-wrap; }
<translation>Auf Nachricht antworten</translation> <translation>Auf Nachricht antworten</translation>
</message> </message>
<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> <source>Hide</source>
<translation>Verbergen</translation> <translation>Verbergen</translation>
</message> </message>