Added "Mark all as read/unread" to channels.

Updated open points for forums and channels.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7440 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2014-07-06 19:25:51 +00:00
parent 199c38b2b8
commit 6c3b6c6880
4 changed files with 19 additions and 44 deletions

View File

@ -28,10 +28,6 @@
#include "gui/settings/rsharesettings.h"
#include "gui/notifyqt.h"
/****
* #define DEBUG_CHANNEL
***/
/** Constructor */
GxsChannelDialog::GxsChannelDialog(QWidget *parent)
: GxsGroupFrameDialog(rsGxsChannels, parent)
@ -62,10 +58,8 @@ QString GxsChannelDialog::text(TextType type)
"<li>Threaded load of messages"
"<li>Share key"
"<li>Restore channel keys"
"<li>Copy/navigate channel link"
"<li>Display count of unread messages"
"<li>Set all as read"
"<li>Set read/unread status"
"<li>Navigate channel link"
"<li>Don't show own posts as unread"
"</ul>";
case TEXT_YOUR_GROUP:

View File

@ -92,6 +92,7 @@ GxsChannelPostsWidget::GxsChannelPostsWidget(const RsGxsGroupId &channelId, QWid
ui->nameLabel->setMinimumWidth(20);
mSubscribeFlags = 0;
mInProcessSettings = false;
/* load settings */
@ -162,11 +163,6 @@ void GxsChannelPostsWidget::updateDisplay(bool complete)
}
}
//UserNotify *GxsChannelPostsWidget::getUserNotify(QObject *parent)
//{
// return new ChannelUserNotify(parent);
//}
void GxsChannelPostsWidget::processSettings(bool load)
{
mInProcessSettings = true;
@ -266,6 +262,8 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
{
mStateHelper->setActive(TOKEN_TYPE_GROUP_DATA, true);
mSubscribeFlags = group.mMeta.mSubscribeFlags;
/* IMAGE */
QPixmap chanImage;
if (group.mImage.mData != NULL) {
@ -278,7 +276,7 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
/* set Channel name */
ui->nameLabel->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str()));
if (group.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH)
if (mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH)
{
mStateHelper->setWidgetEnabled(ui->postButton, true);
}
@ -287,7 +285,7 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
mStateHelper->setWidgetEnabled(ui->postButton, false);
}
ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags));
ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(mSubscribeFlags));
bool autoDownload = rsGxsChannels->getChannelAutoDownload(group.mMeta.mGroupId);
setAutoDownload(autoDownload);
@ -557,31 +555,18 @@ void GxsChannelPostsWidget::fillThreadAddMsg(const QString &channelId, const QSt
void GxsChannelPostsWidget::setAllMessagesRead(bool read)
{
#if 0
if (mChannelId.isNull()) {
if (mChannelId.isNull() || !IS_GROUP_SUBSCRIBED(mSubscribeFlags)) {
return;
}
if (!rsChannels) {
return;
QList<GxsChannelPostItem *>::iterator mit;
for (mit = mChannelPostItems.begin(); mit != mChannelPostItems.end(); ++mit) {
GxsChannelPostItem *item = *mit;
RsGxsGrpMsgIdPair msgPair = std::make_pair(item->groupId(), item->messageId());
uint32_t token;
rsGxsChannels->setMessageReadStatus(token, msgPair, read);
}
ChannelInfo ci;
if (rsChannels->getChannelInfo(mChannelId, ci) == false) {
return;
}
if (ci.channelFlags & RS_DISTRIB_SUBSCRIBED) {
std::list<ChannelMsgSummary> msgs;
std::list<ChannelMsgSummary>::iterator it;
rsChannels->getChannelMsgList(mChannelId, msgs);
for(it = msgs.begin(); it != msgs.end(); it++) {
rsChannels->setMessageStatus(mChannelId, it->msgId, CHANNEL_MSG_STATUS_READ, CHANNEL_MSG_STATUS_READ | CHANNEL_MSG_STATUS_UNREAD_BY_USER);
}
}
#endif
}
void GxsChannelPostsWidget::subscribeGroup(bool subscribe)
@ -641,6 +626,8 @@ void GxsChannelPostsWidget::requestGroupData(const RsGxsGroupId &grpId)
std::cerr << std::endl;
#endif
mSubscribeFlags = 0;
mChannelQueue->cancelActiveRequestTokens(TOKEN_TYPE_GROUP_DATA);
if (grpId.isNull()) {

View File

@ -103,6 +103,7 @@ private:
bool filterItem(GxsChannelPostItem *pItem, const QString &text, const int filter);
RsGxsGroupId mChannelId; /* current Channel */
int mSubscribeFlags;
TokenQueue *mChannelQueue;
/* Layout Pointers */

View File

@ -27,11 +27,6 @@
#include "gui/notifyqt.h"
#include "gui/channels/ShareKey.h"
// These should be in retroshare/ folder.
//#include "retroshare/rsgxsflags.h"
//#define DEBUG_FORUMS
/** Constructor */
GxsForumsDialog::GxsForumsDialog(QWidget *parent)
: GxsGroupFrameDialog(rsGxsForums, parent)
@ -61,9 +56,7 @@ QString GxsForumsDialog::text(TextType type)
return "<b>Open points:</b><ul>"
"<li>Restore forum keys"
"<li>Display AUTHD"
"<li>Copy/navigate forum link"
"<li>Display author of post"
"<li>Display count of unread messages"
"<li>Navigate forum link"
"<li>Don't show own posts as unread"
"<li>Remove messages"
"</ul>";