mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-24 22:30:42 -04: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
3 changed files with 43 additions and 31 deletions
|
@ -50,13 +50,14 @@ PostedListWidget::PostedListWidget(const RsGxsGroupId &postedId, QWidget *parent
|
||||||
mStateHelper->addWidget(mTokenTypePosts, ui->topSortButton);
|
mStateHelper->addWidget(mTokenTypePosts, ui->topSortButton);
|
||||||
|
|
||||||
mStateHelper->addWidget(mTokenTypeGroupData, ui->submitPostButton);
|
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->hotSortButton, SIGNAL(clicked()), this, SLOT(getRankings()));
|
||||||
connect(ui->newSortButton, SIGNAL(clicked()), this, SLOT(getRankings()));
|
connect(ui->newSortButton, SIGNAL(clicked()), this, SLOT(getRankings()));
|
||||||
connect(ui->topSortButton, SIGNAL(clicked()), this, SLOT(getRankings()));
|
connect(ui->topSortButton, SIGNAL(clicked()), this, SLOT(getRankings()));
|
||||||
connect(ui->nextButton, SIGNAL(clicked()), this, SLOT(showNext()));
|
connect(ui->nextButton, SIGNAL(clicked()), this, SLOT(showNext()));
|
||||||
connect(ui->prevButton, SIGNAL(clicked()), this, SLOT(showPrev()));
|
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()));
|
connect(ui->toolButton_NewId, SIGNAL(clicked()), this, SLOT(createNewGxsId()));
|
||||||
|
|
||||||
|
@ -274,6 +275,17 @@ void PostedListWidget::createNewGxsId()
|
||||||
ui->idChooser->setDefaultId(dlg.getLastIdName());
|
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)
|
void PostedListWidget::acknowledgeVoteMsg(const uint32_t &token)
|
||||||
|
@ -302,7 +314,7 @@ void PostedListWidget::insertPostedDetails(const RsPostedGroup &group)
|
||||||
mStateHelper->setWidgetEnabled(ui->submitPostButton, false);
|
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)
|
bool PostedListWidget::insertGroupData(const uint32_t &token, RsGroupMetaData &metaData)
|
||||||
{
|
{
|
||||||
std::vector<RsPostedGroup> groups;
|
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;
|
// std::cerr << "Error, unexpected anstype:" << req.mAnsType << std::endl;
|
||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
// case TOKEN_USER_TYPE_SUBSCRIBE_CHANGE:
|
|
||||||
// acknowledgeSubscribeChange(req.mToken);
|
|
||||||
// break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GxsMessageFramePostWidget::loadRequest(queue, req);
|
GxsMessageFramePostWidget::loadRequest(queue, req);
|
||||||
|
|
|
@ -73,8 +73,7 @@ private slots:
|
||||||
|
|
||||||
void getRankings();
|
void getRankings();
|
||||||
|
|
||||||
// void subscribeTopic();
|
void subscribeGroup(bool subscribe);
|
||||||
// void unsubscribeTopic();
|
|
||||||
|
|
||||||
void showNext();
|
void showNext();
|
||||||
void showPrev();
|
void showPrev();
|
||||||
|
|
|
@ -228,7 +228,23 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<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">
|
<property name="text">
|
||||||
<string>Submit a new Post</string>
|
<string>Submit a new Post</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -236,6 +252,12 @@
|
||||||
<iconset resource="Posted_images.qrc">
|
<iconset resource="Posted_images.qrc">
|
||||||
<normaloff>:/images/posted_24.png</normaloff>:/images/posted_24.png</iconset>
|
<normaloff>:/images/posted_24.png</normaloff>:/images/posted_24.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolButtonStyle">
|
||||||
|
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||||
|
</property>
|
||||||
|
<property name="autoRaise">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -323,6 +345,11 @@
|
||||||
<extends>QComboBox</extends>
|
<extends>QComboBox</extends>
|
||||||
<header>gui/gxs/GxsIdChooser.h</header>
|
<header>gui/gxs/GxsIdChooser.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>SubscribeToolButton</class>
|
||||||
|
<extends>QToolButton</extends>
|
||||||
|
<header>gui/common/SubscribeToolButton.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../images.qrc"/>
|
<include location="../images.qrc"/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue