Removed reply in ForumMsgItem in unsubscribed forums.

Set sign checkbox to checked in authenticated forums.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3991 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-01-28 00:51:56 +00:00
parent 24d4a5e6ce
commit 13132fe248
2 changed files with 30 additions and 12 deletions

View File

@ -67,7 +67,6 @@ ForumMsgItem::ForumMsgItem(FeedHolder *parent, uint32_t feedId, const std::strin
textEdit->hide(); textEdit->hide();
sendButton->hide(); sendButton->hide();
signedcheckBox->hide(); signedcheckBox->hide();
} }
@ -82,22 +81,32 @@ void ForumMsgItem::updateItemStatic()
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
canReply = false;
ForumInfo fi; ForumInfo fi;
if (rsForums->getForumInfo(mForumId, fi)) if (rsForums->getForumInfo(mForumId, fi))
{ {
QString title = "Forum Post: "; QString title = tr("Forum Post") + ": ";
title += QString::fromStdWString(fi.forumName); title += QString::fromStdWString(fi.forumName);
titleLabel->setText(title); titleLabel->setText(title);
if (!(fi.forumFlags & RS_DISTRIB_SUBSCRIBED)) if (fi.subscribeFlags & (RS_DISTRIB_ADMIN | RS_DISTRIB_SUBSCRIBED))
{
unsubscribeButton->setEnabled(false);
replyButton->setEnabled(true);
}
else
{ {
unsubscribeButton->setEnabled(true); unsubscribeButton->setEnabled(true);
replyButton->setEnabled(true); replyButton->setEnabled(true);
if (fi.forumFlags & RS_DISTRIB_AUTHEN_REQ)
{
signedcheckBox->setChecked(true);
signedcheckBox->setEnabled(false);
}
canReply = true;
}
else
{
unsubscribeButton->setEnabled(false);
replyButton->setEnabled(false);
} }
} }
else else
@ -238,9 +247,9 @@ void ForumMsgItem::toggle()
if (prevFrame->isHidden()) if (prevFrame->isHidden())
{ {
prevFrame->show(); prevFrame->show();
textEdit->show(); textEdit->setVisible(canReply);
sendButton->show(); sendButton->setVisible(canReply);
signedcheckBox->show(); signedcheckBox->setVisible(canReply);
expandButton->setIcon(QIcon(QString(":/images/edit_remove24.png"))); expandButton->setIcon(QIcon(QString(":/images/edit_remove24.png")));
expandButton->setToolTip("Hide"); expandButton->setToolTip("Hide");
if (!mIsTop) if (!mIsTop)
@ -315,6 +324,10 @@ void ForumMsgItem::subscribeForum()
void ForumMsgItem::replyToPost() void ForumMsgItem::replyToPost()
{ {
if (canReply == false) {
return;
}
#ifdef DEBUG_ITEM #ifdef DEBUG_ITEM
std::cerr << "ForumMsgItem::replyToPost()"; std::cerr << "ForumMsgItem::replyToPost()";
std::cerr << std::endl; std::cerr << std::endl;
@ -329,7 +342,11 @@ void ForumMsgItem::replyToPost()
void ForumMsgItem::sendMsg() void ForumMsgItem::sendMsg()
{ {
QString name = prevSubLabel->text(); if (canReply == false) {
return;
}
QString name = prevSubLabel->text();
QString desc = textEdit->toHtml(); QString desc = textEdit->toHtml();
if(textEdit->toPlainText().isEmpty()) if(textEdit->toPlainText().isEmpty())

View File

@ -60,6 +60,7 @@ private:
FeedHolder *mParent; FeedHolder *mParent;
uint32_t mFeedId; uint32_t mFeedId;
bool canReply;
std::string mForumId; std::string mForumId;
std::string mPostId; std::string mPostId;