mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-19 14:30:43 -04:00
show forum author in gui
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8207 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
451718660a
commit
c080609168
3 changed files with 33 additions and 6 deletions
|
@ -681,11 +681,28 @@ static void cleanupItems (QList<QTreeWidgetItem *> &items)
|
|||
items.clear();
|
||||
}
|
||||
|
||||
void GxsForumThreadWidget::insertGroupData(const RsGxsForumGroup &group)
|
||||
void GxsForumThreadWidget::insertGroupData()
|
||||
{
|
||||
#ifdef DEBUG_FORUMS
|
||||
std::cerr << "GxsForumThreadWidget::insertGroupData" << std::endl;
|
||||
#endif
|
||||
const RsGxsForumGroup& group = mForumGroup;
|
||||
|
||||
QString author;
|
||||
if(group.mMeta.mAuthorId.isNull())
|
||||
author = tr("no author");
|
||||
else
|
||||
{
|
||||
RsIdentityDetails details;
|
||||
if(!rsIdentity->getIdDetails(group.mMeta.mAuthorId, details))
|
||||
{
|
||||
// try again later
|
||||
QTimer::singleShot(200, this, SLOT(insertGroupData()));
|
||||
author = tr("loading...");
|
||||
}
|
||||
else
|
||||
author = QString::fromUtf8(details.mNickname.c_str());
|
||||
}
|
||||
|
||||
mSubscribeFlags = group.mMeta.mSubscribeFlags;
|
||||
ui->forumName->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str()));
|
||||
|
@ -693,6 +710,7 @@ void GxsForumThreadWidget::insertGroupData(const RsGxsForumGroup &group)
|
|||
mForumDescription = QString("<b>%1: \t</b>%2<br/>").arg(tr("Forum name"), QString::fromUtf8( group.mMeta.mGroupName.c_str()));
|
||||
mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Subscribers")).arg(group.mMeta.mPop);
|
||||
mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Posts (at neighbor nodes)")).arg(group.mMeta.mVisibleMsgCount);
|
||||
mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Author"), author);
|
||||
mForumDescription += QString("<b>%1: </b><br/><br/>%2").arg(tr("Description"), QString::fromUtf8(group.mDescription.c_str()));
|
||||
|
||||
ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(mSubscribeFlags));
|
||||
|
@ -1792,7 +1810,8 @@ void GxsForumThreadWidget::loadGroupData(const uint32_t &token)
|
|||
|
||||
if (groups.size() == 1)
|
||||
{
|
||||
insertGroupData(groups[0]);
|
||||
mForumGroup = groups[0];
|
||||
insertGroupData();
|
||||
|
||||
mStateHelper->setActive(mTokenTypeGroupData, true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue