mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-16 09:03:51 -05:00
disable the newthread and reply button when forum is not own or subscribed
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3195 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c40bb75062
commit
f3c2f0eaf0
1 changed files with 20 additions and 5 deletions
|
|
@ -324,9 +324,9 @@ void ForumsDialog::threadListCustomPopupMenu( QPoint point )
|
||||||
replyAct->setDisabled (true);
|
replyAct->setDisabled (true);
|
||||||
connect( replyAct , SIGNAL( triggered() ), this, SLOT( createmessage() ) );
|
connect( replyAct , SIGNAL( triggered() ), this, SLOT( createmessage() ) );
|
||||||
|
|
||||||
QAction *viewAct = new QAction(QIcon(IMAGE_DOWNLOADALL), tr( "Start New Thread" ), this );
|
QAction *newthreadAct = new QAction(QIcon(IMAGE_DOWNLOADALL), tr( "Start New Thread" ), this );
|
||||||
viewAct->setDisabled (true);
|
newthreadAct->setDisabled (true);
|
||||||
connect( viewAct , SIGNAL( triggered() ), this, SLOT( showthread() ) );
|
connect( newthreadAct , SIGNAL( triggered() ), this, SLOT( showthread() ) );
|
||||||
|
|
||||||
QAction *replyauthorAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr( "Reply to Author" ), this );
|
QAction *replyauthorAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr( "Reply to Author" ), this );
|
||||||
replyauthorAct->setDisabled (true);
|
replyauthorAct->setDisabled (true);
|
||||||
|
|
@ -339,7 +339,7 @@ void ForumsDialog::threadListCustomPopupMenu( QPoint point )
|
||||||
connect( collapseAll , SIGNAL( triggered() ), ui.threadTreeWidget, SLOT(collapseAll()) );
|
connect( collapseAll , SIGNAL( triggered() ), ui.threadTreeWidget, SLOT(collapseAll()) );
|
||||||
|
|
||||||
if (!mCurrForumId.empty ()) {
|
if (!mCurrForumId.empty ()) {
|
||||||
viewAct->setEnabled (true);
|
newthreadAct->setEnabled (true);
|
||||||
if (!mCurrPostId.empty ()) {
|
if (!mCurrPostId.empty ()) {
|
||||||
replyAct->setEnabled (true);
|
replyAct->setEnabled (true);
|
||||||
replyauthorAct->setEnabled (true);
|
replyauthorAct->setEnabled (true);
|
||||||
|
|
@ -347,7 +347,7 @@ void ForumsDialog::threadListCustomPopupMenu( QPoint point )
|
||||||
}
|
}
|
||||||
|
|
||||||
contextMnu.addAction( replyAct);
|
contextMnu.addAction( replyAct);
|
||||||
contextMnu.addAction( viewAct);
|
contextMnu.addAction( newthreadAct);
|
||||||
contextMnu.addAction( replyauthorAct);
|
contextMnu.addAction( replyauthorAct);
|
||||||
contextMnu.addSeparator();
|
contextMnu.addSeparator();
|
||||||
contextMnu.addAction( expandAll);
|
contextMnu.addAction( expandAll);
|
||||||
|
|
@ -396,6 +396,21 @@ void ForumsDialog::checkUpdate()
|
||||||
insertThreads();
|
insertThreads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ForumInfo fi;
|
||||||
|
if (rsForums && !mCurrForumId.empty ()) {
|
||||||
|
if (rsForums->getForumInfo (mCurrForumId, fi)) {
|
||||||
|
if (fi.subscribeFlags & (RS_DISTRIB_ADMIN | RS_DISTRIB_SUBSCRIBED)) {
|
||||||
|
ui.newmessageButton->setEnabled (true);
|
||||||
|
ui.newthreadButton->setEnabled (true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui.newmessageButton->setEnabled (false);
|
||||||
|
ui.newthreadButton->setEnabled (false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue