mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 13:24:15 -05:00
Added subscribe button to Posted.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7467 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1de9e4a842
commit
0bcc8697ef
@ -50,13 +50,14 @@ PostedListWidget::PostedListWidget(const RsGxsGroupId &postedId, QWidget *parent
|
||||
mStateHelper->addWidget(mTokenTypePosts, ui->topSortButton);
|
||||
|
||||
mStateHelper->addWidget(mTokenTypeGroupData, ui->submitPostButton);
|
||||
// mStateHelper->addWidget(mTokenTypeGroupData, ui->subscribeToolButton);
|
||||
mStateHelper->addWidget(mTokenTypeGroupData, ui->subscribeToolButton);
|
||||
|
||||
connect(ui->hotSortButton, SIGNAL(clicked()), this, SLOT(getRankings()));
|
||||
connect(ui->newSortButton, SIGNAL(clicked()), this, SLOT(getRankings()));
|
||||
connect(ui->topSortButton, SIGNAL(clicked()), this, SLOT(getRankings()));
|
||||
connect(ui->nextButton, SIGNAL(clicked()), this, SLOT(showNext()));
|
||||
connect(ui->prevButton, SIGNAL(clicked()), this, SLOT(showPrev()));
|
||||
connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool)));
|
||||
|
||||
connect(ui->toolButton_NewId, SIGNAL(clicked()), this, SLOT(createNewGxsId()));
|
||||
|
||||
@ -274,6 +275,17 @@ void PostedListWidget::createNewGxsId()
|
||||
ui->idChooser->setDefaultId(dlg.getLastIdName());
|
||||
}
|
||||
|
||||
void PostedListWidget::subscribeGroup(bool subscribe)
|
||||
{
|
||||
if (groupId().isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t token;
|
||||
rsPosted->subscribeToGroup(token, groupId(), subscribe);
|
||||
// mTokenQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, TOKEN_TYPE_SUBSCRIBE_CHANGE);
|
||||
}
|
||||
|
||||
/*****************************************************************************************/
|
||||
|
||||
void PostedListWidget::acknowledgeVoteMsg(const uint32_t &token)
|
||||
@ -302,7 +314,7 @@ void PostedListWidget::insertPostedDetails(const RsPostedGroup &group)
|
||||
mStateHelper->setWidgetEnabled(ui->submitPostButton, false);
|
||||
}
|
||||
|
||||
// ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags));
|
||||
ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags));
|
||||
}
|
||||
|
||||
/*********************** **** **** **** ***********************/
|
||||
@ -504,29 +516,6 @@ void PostedListWidget::shallowClearPosts()
|
||||
}
|
||||
}
|
||||
|
||||
//void PostedListWidget::subscribeGroup(bool subscribe)
|
||||
//{
|
||||
// if (mChannelId.isNull()) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// uint32_t token;
|
||||
// rsGxsChannels->subscribeToGroup(token, mChannelId, subscribe);
|
||||
//// mChannelQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, TOKEN_TYPE_SUBSCRIBE_CHANGE);
|
||||
//}
|
||||
|
||||
//void PostedListWidget::acknowledgeSubscribeChange(const uint32_t &token)
|
||||
//{
|
||||
// std::cerr << "PostedListWidget::acknowledgeSubscribeChange()";
|
||||
// std::cerr << std::endl;
|
||||
|
||||
// std::vector<RsPostedPost> posts;
|
||||
// RsGxsGroupId groupId;
|
||||
// rsPosted->acknowledgeGrp(token, groupId);
|
||||
|
||||
// insertGroups();
|
||||
//}
|
||||
|
||||
bool PostedListWidget::insertGroupData(const uint32_t &token, RsGroupMetaData &metaData)
|
||||
{
|
||||
std::vector<RsPostedGroup> groups;
|
||||
@ -636,9 +625,6 @@ void PostedListWidget::loadRequest(const TokenQueue *queue, const TokenRequest &
|
||||
// std::cerr << "Error, unexpected anstype:" << req.mAnsType << std::endl;
|
||||
// break;
|
||||
// }
|
||||
// case TOKEN_USER_TYPE_SUBSCRIBE_CHANGE:
|
||||
// acknowledgeSubscribeChange(req.mToken);
|
||||
// break;
|
||||
}
|
||||
|
||||
GxsMessageFramePostWidget::loadRequest(queue, req);
|
||||
|
@ -73,8 +73,7 @@ private slots:
|
||||
|
||||
void getRankings();
|
||||
|
||||
// void subscribeTopic();
|
||||
// void unsubscribeTopic();
|
||||
void subscribeGroup(bool subscribe);
|
||||
|
||||
void showNext();
|
||||
void showPrev();
|
||||
|
@ -228,7 +228,23 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="submitPostButton">
|
||||
<widget class="SubscribeToolButton" name="subscribeToolButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Subscribe</string>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="submitPostButton">
|
||||
<property name="text">
|
||||
<string>Submit a new Post</string>
|
||||
</property>
|
||||
@ -236,6 +252,12 @@
|
||||
<iconset resource="Posted_images.qrc">
|
||||
<normaloff>:/images/posted_24.png</normaloff>:/images/posted_24.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -323,6 +345,11 @@
|
||||
<extends>QComboBox</extends>
|
||||
<header>gui/gxs/GxsIdChooser.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>SubscribeToolButton</class>
|
||||
<extends>QToolButton</extends>
|
||||
<header>gui/common/SubscribeToolButton.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user