Added basic widget RSFeedWidget for showing feed items in a QTreeWidget as replacement for the QScrollArea.

- Use sort of QTreeWidget
- Filter items
- Open/collapse selected item with +/-
- Remove selecteds item with dselete key

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7478 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2014-08-01 14:49:58 +00:00
parent e588b25b67
commit d13aa90b2b
20 changed files with 841 additions and 183 deletions

View file

@ -423,12 +423,8 @@ void PostedListWidget::applyRanking()
QLayout *alayout = ui->scrollAreaWidgetContents->layout();
int counter = 0;
time_t min_ts = 0;
foreach (GxsFeedItem *feedItem, mPostItems)
foreach (PostedItem *item, mPostItems)
{
PostedItem *item = dynamic_cast<PostedItem*>(feedItem);
if (!item) {
continue;
}
std::cerr << "PostedListWidget::applyRanking() Item: " << item;
std::cerr << std::endl;
@ -472,8 +468,11 @@ void PostedListWidget::applyRanking()
void PostedListWidget::clearPosts()
{
GxsMessageFramePostWidget::clearPosts();
/* clear all messages */
foreach (PostedItem *item, mPostItems) {
delete(item);
}
mPostItems.clear();
mPosts.clear();
}
@ -585,12 +584,18 @@ void PostedListWidget::insertRelatedPosts(const uint32_t &token)
applyRanking();
}
void PostedListWidget::setMessageRead(GxsFeedItem *item, bool read)
void PostedListWidget::setAllMessagesRead(bool read)
{
RsGxsGrpMsgIdPair msgPair = std::make_pair(item->groupId(), item->messageId());
if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(subscribeFlags())) {
return;
}
uint32_t token;
rsPosted->setMessageReadStatus(token, msgPair, read);
foreach (PostedItem *item, mPostItems) {
RsGxsGrpMsgIdPair msgPair = std::make_pair(item->groupId(), item->messageId());
uint32_t token;
rsPosted->setMessageReadStatus(token, msgPair, read);
}
}
/*********************** **** **** **** ***********************/