mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
FeedReader:
- Recalculate message count of the user notify when a feed with new items is deleted. - Set deleted message to read and !new. - Added test feed item in notify settings. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6072 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6f7c424b1f
commit
ddc4a37a93
11 changed files with 78 additions and 2 deletions
|
@ -409,6 +409,24 @@ void NewsFeed::testFeeds(uint notifyFlags)
|
|||
}
|
||||
}
|
||||
|
||||
void NewsFeed::testFeed(FeedNotify *feedNotify)
|
||||
{
|
||||
if (!instance) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!feedNotify) {
|
||||
return;
|
||||
}
|
||||
|
||||
QWidget *feedItem = feedNotify->testFeedItem(instance);
|
||||
if (!feedItem) {
|
||||
return;
|
||||
}
|
||||
|
||||
instance->addFeedItem(feedItem);
|
||||
}
|
||||
|
||||
void NewsFeed::addFeedItem(QWidget *item)
|
||||
{
|
||||
item->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
|
|
|
@ -31,6 +31,7 @@ class RsFeedItem;
|
|||
class ForumNewItem;
|
||||
class ChanMsgItem;
|
||||
class ChatMsgItem;
|
||||
class FeedNotify;
|
||||
|
||||
class NewsFeed : public MainPage, public FeedHolder, private Ui::NewsFeed
|
||||
{
|
||||
|
@ -48,6 +49,7 @@ public:
|
|||
virtual void openChat(std::string peerId);
|
||||
|
||||
static void testFeeds(uint notifyFlags);
|
||||
static void testFeed(FeedNotify *feedNotify);
|
||||
|
||||
signals:
|
||||
void newsFeedChanged(int count);
|
||||
|
|
|
@ -48,3 +48,8 @@ QWidget *FeedNotify::feedItem(FeedHolder */*parent*/)
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
QWidget *FeedNotify::testFeedItem(FeedHolder */*parent*/)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ public:
|
|||
virtual bool notifyEnabled();
|
||||
virtual void setNotifyEnabled(bool /*enabled*/);
|
||||
virtual QWidget *feedItem(FeedHolder */*parent*/);
|
||||
virtual QWidget *testFeedItem(FeedHolder */*parent*/);
|
||||
};
|
||||
|
||||
#endif // FEEDNOTIFY_H
|
||||
|
|
|
@ -285,6 +285,14 @@ void NotifyPage::notifyToggled()
|
|||
void NotifyPage::testNotify()
|
||||
{
|
||||
NewsFeed::testFeeds(getNewsFlags());
|
||||
|
||||
/* notify of plugins */
|
||||
QList<FeedNotifySetting>::iterator feedNotifyIt;
|
||||
for (feedNotifyIt = mFeedNotifySettingList.begin(); feedNotifyIt != mFeedNotifySettingList.end(); ++feedNotifyIt) {
|
||||
if (feedNotifyIt->mEnabledCheckBox->isChecked()) {
|
||||
NewsFeed::testFeed(feedNotifyIt->mFeedNotify);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void NotifyPage::testToaster()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue