Added user type interogation of tokenQueue

fix for posteditem serialisation
added voting to gui, but no feedback yet
post and topic generation code added for testing 

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5945 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2012-12-05 22:45:44 +00:00
parent 694885963e
commit de757cfcae
16 changed files with 621 additions and 318 deletions

View file

@ -40,26 +40,28 @@
PostedItem::PostedItem(PostedHolder *postHolder, const RsPostedPost &post)
:QWidget(NULL), mPostHolder(postHolder), mPost(post)
{
setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
dateLabel->setText(timestamp);
fromLabel->setText(QString::fromUtf8(post.mMeta.mAuthorId.c_str()));
titleLabel->setText("<a href=" + QString::fromStdString(post.mLink) +
"><span style=\" text-decoration: underline; color:#0000ff;\">" +
QString::fromStdString(post.mMeta.mMsgName) + "</span></a>");
siteLabel->setText("<a href=" + QString::fromStdString(post.mLink) +
"><span style=\" text-decoration: underline; color:#0000ff;\">" +
QString::fromStdString(post.mLink) + "</span></a>");
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
dateLabel->setText(timestamp);
fromLabel->setText(QString::fromUtf8(post.mMeta.mAuthorId.c_str()));
titleLabel->setText("<a href=" + QString::fromStdString(post.mLink) +
"><span style=\" text-decoration: underline; color:#0000ff;\">" +
QString::fromStdString(post.mMeta.mMsgName) + "</span></a>");
siteLabel->setText("<a href=" + QString::fromStdString(post.mLink) +
"><span style=\" text-decoration: underline; color:#0000ff;\">" +
QString::fromStdString(post.mLink) + "</span></a>");
scoreLabel->setText(QString("1"));
scoreLabel->setText(QString("1"));
connect( commentButton, SIGNAL( clicked() ), this, SLOT( loadComments() ) );
connect( commentButton, SIGNAL( clicked() ), this, SLOT( loadComments() ) );
connect( voteUpButton, SIGNAL(clicked()), this, SLOT(makeUpVote()));
connect( voteDownButton, SIGNAL(clicked()), this, SLOT( makeDownVote()));
return;
return;
}
RsPostedPost PostedItem::getPost() const
@ -67,9 +69,25 @@ RsPostedPost PostedItem::getPost() const
return mPost;
}
void PostedItem::makeDownVote()
{
RsGxsGrpMsgIdPair msgId;
msgId.first = mPost.mMeta.mMsgId;
msgId.second = mPost.mMeta.mGroupId;
emit vote(msgId, false);
}
void PostedItem::makeUpVote()
{
RsGxsGrpMsgIdPair msgId;
msgId.first = mPost.mMeta.mMsgId;
msgId.second = mPost.mMeta.mGroupId;
emit vote(msgId, true);
}
void PostedItem::loadComments()
{
std::cerr << "PostedItem::loadComments() Requesting for " << mThreadId;
std::cerr << std::endl;
mPostHolder->showComments(mPost);
std::cerr << "PostedItem::loadComments() Requesting for " << mThreadId;
std::cerr << std::endl;
mPostHolder->showComments(mPost);
}