Comment and Vote update now functional

Voting and comment count update in gui added via msg notification
clarified comments in RsTokenService

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5958 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2012-12-09 22:38:49 +00:00
parent 62176264d3
commit 30b48c59ef
12 changed files with 339 additions and 36 deletions

View file

@ -43,6 +43,18 @@ PostedItem::PostedItem(PostedHolder *postHolder, const RsPostedPost &post)
setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
setContent(mPost);
connect( commentButton, SIGNAL( clicked() ), this, SLOT( loadComments() ) );
connect( voteUpButton, SIGNAL(clicked()), this, SLOT(makeUpVote()));
connect( voteDownButton, SIGNAL(clicked()), this, SLOT( makeDownVote()));
return;
}
void PostedItem::setContent(const RsPostedPost &post)
{
mPost = post;
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
@ -57,16 +69,20 @@ PostedItem::PostedItem(PostedHolder *postHolder, const RsPostedPost &post)
uint32_t up, down, nComments;
rsPosted->retrieveScores(mPost.mMeta.mServiceString, up, down, nComments);
bool ok = rsPosted->retrieveScores(mPost.mMeta.mServiceString, up, down, nComments);
int32_t vote = up - down;
scoreLabel->setText(QString::number(vote));
if(ok)
{
int32_t vote = up - down;
scoreLabel->setText(QString::number(vote));
connect( commentButton, SIGNAL( clicked() ), this, SLOT( loadComments() ) );
connect( voteUpButton, SIGNAL(clicked()), this, SLOT(makeUpVote()));
connect( voteDownButton, SIGNAL(clicked()), this, SLOT( makeDownVote()));
numCommentsLabel->setText("<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px;"
"margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span"
"style=\" font-size:10pt; font-weight:600;\">#</span><span "
"style=\" font-size:8pt; font-weight:600;\"> Comments: "
+ QString::number(nComments) + "</span></p>");
}
return;
}
RsPostedPost PostedItem::getPost() const