Added translation for "[ ... Missing Message ... ]".

Fixed german language.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4934 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-02-13 20:40:36 +00:00
parent d26be6c05c
commit 8675eb9225
6 changed files with 99 additions and 37 deletions

View file

@ -872,9 +872,6 @@ void ForumsDialog::insertThreads()
subscribeFlags = fi.subscribeFlags;
ui.forumName->setText(QString::fromStdWString(fi.forumName));
ui.progressBarLayOut->setEnabled(true);
ui.progLayOutTxt->show();
@ -1068,6 +1065,24 @@ void ForumsDialog::FillChildren(QTreeWidgetItem *Parent, QTreeWidgetItem *NewPar
}
}
QString ForumsDialog::titleFromInfo(ForumMsgInfo &msgInfo)
{
if (msgInfo.msgflags & RS_DISTRIB_MISSING_MSG) {
return QApplication::translate("ForumsDialog", "[ ... Missing Message ... ]");
}
return QString::fromStdWString(msgInfo.title);
}
QString ForumsDialog::messageFromInfo(ForumMsgInfo &msgInfo)
{
if (msgInfo.msgflags & RS_DISTRIB_MISSING_MSG) {
return QApplication::translate("ForumsDialog", "Placeholder for missing Message");
}
return QString::fromStdWString(msgInfo.msg);
}
void ForumsDialog::insertPost()
{
if ((mCurrForumId == "") || (mCurrThreadId == ""))
@ -1124,10 +1139,10 @@ void ForumsDialog::insertPost()
}
}
QString extraTxt = RsHtml::formatText(QString::fromStdWString(msg.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS);
QString extraTxt = RsHtml::formatText(messageFromInfo(msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS);
ui.postText->setHtml(extraTxt);
ui.threadTitle->setText(QString::fromStdWString(msg.title));
ui.threadTitle->setText(titleFromInfo(msg));
}
void ForumsDialog::previousMessage ()
@ -1814,7 +1829,7 @@ void ForumsFillThread::run()
item->setText(COLUMN_THREAD_DATE, text);
}
item->setText(COLUMN_THREAD_TITLE, QString::fromStdWString(tit->title));
item->setText(COLUMN_THREAD_TITLE, ForumsDialog::titleFromInfo(msginfo));
text = QString::fromUtf8(rsPeers->getPeerName(msginfo.srcId).c_str());
if (text.isEmpty())
@ -1928,7 +1943,7 @@ void ForumsFillThread::run()
child->setText(COLUMN_THREAD_DATE, text);
}
child->setText(COLUMN_THREAD_TITLE, QString::fromStdWString(mit->title));
child->setText(COLUMN_THREAD_TITLE, ForumsDialog::titleFromInfo(msginfo));
text = QString::fromUtf8(rsPeers->getPeerName(msginfo.srcId).c_str());
if (text.isEmpty())
@ -1954,7 +1969,7 @@ void ForumsFillThread::run()
if (filterColumn == COLUMN_THREAD_CONTENT) {
// need content for filter
QTextDocument doc;
doc.setHtml(QString::fromStdWString(msginfo.msg));
doc.setHtml(ForumsDialog::messageFromInfo(msginfo));
child->setText(COLUMN_THREAD_CONTENT, doc.toPlainText().replace(QString("\n"), QString(" ")));
}

View file

@ -30,6 +30,7 @@
class ForumInfo;
class ForumsFillThread;
class ForumMsgInfo;
class ForumsDialog : public RsAutoUpdatePage
{
@ -44,6 +45,9 @@ public:
/* overloaded from RsAuthUpdatePage */
virtual void updateDisplay();
static QString titleFromInfo(ForumMsgInfo &msgInfo);
static QString messageFromInfo(ForumMsgInfo &msgInfo);
protected:
bool eventFilter(QObject *obj, QEvent *ev);

View file

@ -346,7 +346,7 @@ bool RetroShareLink::createForum(const std::string& id, const std::string& msgId
} else {
ForumMsgInfo mi;
if (rsForums->getForumMessage(id, msgId, mi)) {
_name = QString::fromStdWString(mi.title);
_name = ForumsDialog::titleFromInfo(mi);
}
}
}

View file

@ -34,6 +34,7 @@
#include "gui/chat/HandleRichText.h"
#include "gui/common/AvatarDefs.h"
#include "gui/notifyqt.h"
#include "gui/ForumsDialog.h"
//#include "gui/settings/rsharesettings.h"
/****
@ -154,8 +155,8 @@ void ForumMsgItem::updateItemStatic()
}
prevSubLabel->setText(link.toHtml());
prevMsgLabel->setText(RsHtml::formatText(QString::fromStdWString(msg.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
prevMsgLabel->setText(RsHtml::formatText(ForumsDialog::messageFromInfo(msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
QDateTime qtime;
qtime.setTime_t(msg.ts);
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
@ -179,7 +180,7 @@ void ForumMsgItem::updateItemStatic()
}
nextSubLabel->setText(link.toHtml());
nextMsgLabel->setText(RsHtml::formatText(QString::fromStdWString(msg.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
nextMsgLabel->setText(RsHtml::formatText(ForumsDialog::messageFromInfo(msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
QDateTime qtime;
qtime.setTime_t(msg.ts);
@ -196,7 +197,7 @@ void ForumMsgItem::updateItemStatic()
RetroShareLink linkParent;
linkParent.createForum(msgParent.forumId, msgParent.msgId);
prevSubLabel->setText(linkParent.toHtml());
prevMsgLabel->setText(RsHtml::formatText(QString::fromStdWString(msgParent.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
prevMsgLabel->setText(RsHtml::formatText(ForumsDialog::messageFromInfo(msgParent), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
if (rsPeers->getPeerName(msgParent.srcId) !="")
{
@ -217,7 +218,7 @@ void ForumMsgItem::updateItemStatic()
}
/* header stuff */
subjectLabel->setText(QString::fromStdWString(msg.title));
subjectLabel->setText(ForumsDialog::titleFromInfo(msg));
//srcLabel->setText(QString::fromStdString(msg.srcId));
}