Added mark everything read action.

This commit is contained in:
Martin Rotter 2013-12-30 23:03:32 +01:00
parent ef06d21ef4
commit b93df8aab3
5 changed files with 33 additions and 2 deletions

View File

@ -175,6 +175,8 @@ void FeedMessageViewer::createConnections() {
SIGNAL(triggered()), m_messagesView, SLOT(openSelectedSourceMessagesInternally())); SIGNAL(triggered()), m_messagesView, SLOT(openSelectedSourceMessagesInternally()));
connect(FormMain::getInstance()->m_ui->m_actionOpenSelectedMessagesInternally, connect(FormMain::getInstance()->m_ui->m_actionOpenSelectedMessagesInternally,
SIGNAL(triggered()), m_messagesView, SLOT(openSelectedMessagesInternally())); SIGNAL(triggered()), m_messagesView, SLOT(openSelectedMessagesInternally()));
connect(FormMain::getInstance()->m_ui->m_actionMarkAllFeedsRead,
SIGNAL(triggered()), m_feedsView, SLOT(markAllFeedsRead()));
connect(FormMain::getInstance()->m_ui->m_actionMarkFeedsAsRead, connect(FormMain::getInstance()->m_ui->m_actionMarkFeedsAsRead,
SIGNAL(triggered()), m_feedsView, SLOT(markSelectedFeedsRead())); SIGNAL(triggered()), m_feedsView, SLOT(markSelectedFeedsRead()));
connect(FormMain::getInstance()->m_ui->m_actionMarkFeedsAsUnread, connect(FormMain::getInstance()->m_ui->m_actionMarkFeedsAsUnread,

View File

@ -126,6 +126,17 @@ void FeedsView::markSelectedFeedsUnread() {
markSelectedFeedsReadStatus(0); markSelectedFeedsReadStatus(0);
} }
void FeedsView::markAllFeedsReadStatus(int read) {
m_sourceModel->markFeedsRead(allFeeds(), read);
updateCountsOfAllFeeds(false);
emit feedsNeedToBeReloaded(read);
}
void FeedsView::markAllFeedsRead() {
markAllFeedsReadStatus(1);
}
void FeedsView::updateCountsOfSelectedFeeds(bool update_total_too) { void FeedsView::updateCountsOfSelectedFeeds(bool update_total_too) {
foreach (FeedsModelFeed *feed, selectedFeeds()) { foreach (FeedsModelFeed *feed, selectedFeeds()) {
feed->updateCounts(update_total_too); feed->updateCounts(update_total_too);
@ -155,7 +166,7 @@ void FeedsView::initializeContextMenuCategoriesFeeds() {
void FeedsView::initializeContextMenuEmptySpace() { void FeedsView::initializeContextMenuEmptySpace() {
m_contextMenuEmptySpace = new QMenu(tr("Context menu for feeds"), this); m_contextMenuEmptySpace = new QMenu(tr("Context menu for feeds"), this);
m_contextMenuEmptySpace->addActions(QList<QAction*>() << m_contextMenuEmptySpace->addActions(QList<QAction*>() <<
FormMain::getInstance()->m_ui->m_actionAddNewFeed); FormMain::getInstance()->m_ui->m_actionUpdateAllFeeds);
} }

View File

@ -39,6 +39,9 @@ class FeedsView : public QTreeView {
void markSelectedFeedsRead(); void markSelectedFeedsRead();
void markSelectedFeedsUnread(); void markSelectedFeedsUnread();
void markAllFeedsReadStatus(int read);
void markAllFeedsRead();
// Feed clearers. // Feed clearers.
void setSelectedFeedsClearStatus(int clear); void setSelectedFeedsClearStatus(int clear);
void clearSelectedFeeds(); void clearSelectedFeeds();

View File

@ -223,6 +223,7 @@ void FormMain::setupIcons() {
m_ui->m_actionAddNewCategory->setIcon(IconThemeFactory::getInstance()->fromTheme("document-new")); m_ui->m_actionAddNewCategory->setIcon(IconThemeFactory::getInstance()->fromTheme("document-new"));
m_ui->m_actionAddNewFeed->setIcon(IconThemeFactory::getInstance()->fromTheme("document-new")); m_ui->m_actionAddNewFeed->setIcon(IconThemeFactory::getInstance()->fromTheme("document-new"));
m_ui->m_actionEditSelectedFeedCategory->setIcon(IconThemeFactory::getInstance()->fromTheme("gnome-other")); m_ui->m_actionEditSelectedFeedCategory->setIcon(IconThemeFactory::getInstance()->fromTheme("gnome-other"));
m_ui->m_actionMarkAllFeedsRead->setIcon(IconThemeFactory::getInstance()->fromTheme("mail-mark-not-junk"));
m_ui->m_actionMarkFeedsAsRead->setIcon(IconThemeFactory::getInstance()->fromTheme("mail-mark-not-junk")); m_ui->m_actionMarkFeedsAsRead->setIcon(IconThemeFactory::getInstance()->fromTheme("mail-mark-not-junk"));
m_ui->m_actionMarkFeedsAsUnread->setIcon(IconThemeFactory::getInstance()->fromTheme("mail-mark-important")); m_ui->m_actionMarkFeedsAsUnread->setIcon(IconThemeFactory::getInstance()->fromTheme("mail-mark-important"));
m_ui->m_actionMarkFeedsAsRead->setIcon(IconThemeFactory::getInstance()->fromTheme("mail-mark-not-junk")); m_ui->m_actionMarkFeedsAsRead->setIcon(IconThemeFactory::getInstance()->fromTheme("mail-mark-not-junk"));

View File

@ -102,6 +102,7 @@
<addaction name="m_actionEditSelectedFeedCategory"/> <addaction name="m_actionEditSelectedFeedCategory"/>
<addaction name="m_actionDeleteSelectedFeedsCategories"/> <addaction name="m_actionDeleteSelectedFeedsCategories"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="m_actionMarkAllFeedsRead"/>
<addaction name="m_actionMarkFeedsAsRead"/> <addaction name="m_actionMarkFeedsAsRead"/>
<addaction name="m_actionMarkFeedsAsUnread"/> <addaction name="m_actionMarkFeedsAsUnread"/>
<addaction name="m_actionClearFeeds"/> <addaction name="m_actionClearFeeds"/>
@ -123,7 +124,7 @@
<addaction name="m_menuTools"/> <addaction name="m_menuTools"/>
<addaction name="m_menuHelp"/> <addaction name="m_menuHelp"/>
</widget> </widget>
<widget class="QStatusBar" name="m_statusBar"/> <widget class="StatusBar" name="m_statusBar"/>
<action name="m_actionImport"> <action name="m_actionImport">
<property name="text"> <property name="text">
<string>&amp;Import</string> <string>&amp;Import</string>
@ -383,6 +384,14 @@
<string>No actions are available right now.</string> <string>No actions are available right now.</string>
</property> </property>
</action> </action>
<action name="m_actionMarkAllFeedsRead">
<property name="text">
<string>Mark all &amp;items read</string>
</property>
<property name="toolTip">
<string>Mark all messages in all feeds read. This does not take message filters into account.</string>
</property>
</action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
@ -391,6 +400,11 @@
<header>tabwidget.h</header> <header>tabwidget.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>StatusBar</class>
<extends>QStatusBar</extends>
<header>statusbar.h</header>
</customwidget>
</customwidgets> </customwidgets>
<resources/> <resources/>
<connections/> <connections/>