diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.ui b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.ui index 31db6c1f7..1b5e31a6c 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.ui +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.ui @@ -100,6 +100,22 @@ 2 + + + + + 0 + 0 + + + + Subscribe + + + true + + + @@ -123,22 +139,6 @@ - - - - - 0 - 0 - - - - Subscribe - - - true - - - diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index bb357fdc0..8120e9873 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -99,6 +99,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mStateHelper->addWidget(TOKEN_TYPE_CURRENTFORUM, ui->progressBar, UISTATE_LOADING_VISIBLE); mStateHelper->addWidget(TOKEN_TYPE_CURRENTFORUM, ui->progressText, UISTATE_LOADING_VISIBLE); + mStateHelper->addWidget(TOKEN_TYPE_CURRENTFORUM, ui->subscribeToolButton); mStateHelper->addWidget(TOKEN_TYPE_CURRENTFORUM, ui->newthreadButton); mStateHelper->addWidget(TOKEN_TYPE_CURRENTFORUM, ui->threadTreeWidget, UISTATE_ACTIVE_ENABLED); @@ -131,6 +132,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget connect(ui->threadTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(threadListCustomPopupMenu(QPoint))); + connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool))); connect(ui->newmessageButton, SIGNAL(clicked()), this, SLOT(createmessage())); connect(ui->newthreadButton, SIGNAL(clicked()), this, SLOT(createthread())); @@ -919,6 +921,8 @@ void GxsForumThreadWidget::insertForumThreads(const RsGxsForumGroup &group) ui->forumName->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str())); mForumDescription = QString::fromUtf8(group.mDescription.c_str()); + ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(mSubscribeFlags)); + ui->progressBar->reset(); mStateHelper->setActive(TOKEN_TYPE_CURRENTFORUM, true); @@ -1523,6 +1527,17 @@ void GxsForumThreadWidget::copyMessageLink() QMessageBox::warning(this, "RetroShare", "ToDo"); } +void GxsForumThreadWidget::subscribeGroup(bool subscribe) +{ + if (mForumId.isNull()) { + return; + } + + uint32_t token; + rsGxsForums->subscribeToGroup(token, mForumId, subscribe); +// mThreadQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, TOKEN_TYPE_SUBSCRIBE_CHANGE); +} + void GxsForumThreadWidget::createmessage() { if (mForumId.isNull () || !IS_GROUP_SUBSCRIBED(mSubscribeFlags)) { diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index cdf9d7402..4e402d4ba 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -85,6 +85,7 @@ private slots: /* handle splitter */ void togglethreadview(); + void subscribeGroup(bool subscribe); void createthread(); void createmessage(); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui index 81a7e30f8..003b0c50c 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui @@ -42,6 +42,22 @@ 2 + + + + + 0 + 0 + + + + Subscribe + + + true + + + @@ -520,16 +536,21 @@ - - RSTextBrowser - QTextBrowser -
gui/common/RSTextBrowser.h
-
LineEditClear QLineEdit
gui/common/LineEditClear.h
+ + SubscribeToolButton + QToolButton +
gui/common/SubscribeToolButton.h
+
+ + RSTextBrowser + QTextBrowser +
gui/common/RSTextBrowser.h
+
GxsIdRSTreeWidget QTreeWidget