Browse Source

- FEATURE: Added 'Mark all as read' function for RSS feeds

adaptive-webui-19844
Christophe Dumez 17 years ago
parent
commit
07dc182053
  1. 2
      TODO
  2. 8
      src/rss.h
  3. 131
      src/rss.ui
  4. 13
      src/rss_imp.cpp
  5. 1
      src/rss_imp.h

2
TODO

@ -61,7 +61,6 @@ @@ -61,7 +61,6 @@
- valgrind --tool=memcheck --leak-check=full src/qbittorrent (Looks ok)
- 128m 29m 16m S 4.8 2.9 0:02.28 qbittorrent
* beta 7
- Add "Mark all as read" feature for RSS
- update doc for plugins (and add screenies)
- update doc for options
- Review torrent content selection
@ -104,6 +103,7 @@ beta6->beta7 changelog: @@ -104,6 +103,7 @@ beta6->beta7 changelog:
- FEATURE: Added an option to set the max number of uploads per torrent
- FEATURE: Added an option to automatically delete torrents when they reach a given ratio (>= 1.0)
- FEATURE: Added an option to display current transfer speeds in title bar
- FEATURE: Added "Mark all as read" function for RSS feeds
- BUGFIX: In torrent content, it is now easier to filter all torrents using right click menu
- BUGFIX: Updated man page / README / INSTALL
- BUGFIX: Paused torrents could be displayed as connected for a sec after checking

8
src/rss.h

@ -242,6 +242,14 @@ class RssStream : public QObject{ @@ -242,6 +242,14 @@ class RssStream : public QObject{
return listItem.size();
}
void markAllAsRead() {
RssItem *item;
foreach(item, listItem){
if(!item->isRead())
item->setRead();
}
}
unsigned int getNbUnRead() const{
unsigned int nbUnread=0;
RssItem *item;

131
src/rss.ui

@ -13,28 +13,55 @@ @@ -13,28 +13,55 @@
<string>Search</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QTreeWidget" name="listStreams" >
<property name="contextMenuPolicy" >
@ -60,12 +87,21 @@ @@ -60,12 +87,21 @@
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<spacer>
<property name="orientation" >
@ -87,29 +123,23 @@ @@ -87,29 +123,23 @@
<height>32</height>
</size>
</property>
<property name="iconSize" >
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolTip" >
<string>Delete selected streams</string>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="refreshAll_button" >
<property name="minimumSize" >
<property name="iconSize" >
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="iconSize" >
</widget>
</item>
<item>
<widget class="QPushButton" name="refreshAll_button" >
<property name="minimumSize" >
<size>
<width>32</width>
<height>32</height>
@ -121,6 +151,12 @@ @@ -121,6 +151,12 @@
<property name="text" >
<string/>
</property>
<property name="iconSize" >
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item>
@ -131,18 +167,18 @@ @@ -131,18 +167,18 @@
<height>32</height>
</size>
</property>
<property name="iconSize" >
<size>
<width>55</width>
<height>32</height>
</size>
</property>
<property name="toolTip" >
<string>Add a new RSS stream</string>
</property>
<property name="text" >
<string/>
</property>
<property name="iconSize" >
<size>
<width>55</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item>
@ -164,12 +200,21 @@ @@ -164,12 +200,21 @@
</item>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QLabel" name="news_lbl" >
<property name="font" >
@ -198,12 +243,21 @@ @@ -198,12 +243,21 @@
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
</layout>
</item>
</layout>
@ -236,6 +290,11 @@ @@ -236,6 +290,11 @@
<string>Refresh all streams</string>
</property>
</action>
<action name="actionMark_all_as_read" >
<property name="text" >
<string>Mark all as read</string>
</property>
</action>
</widget>
<resources/>
<connections/>

13
src/rss_imp.cpp

@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
QTreeWidgetItem* item = listStreams->itemAt(pos);
QList<QTreeWidgetItem*> selectedItems = listStreams->selectedItems();
if(item != 0) {
myFinishedListMenu.addAction(actionMark_all_as_read);
myFinishedListMenu.addAction(actionDelete);
if(selectedItems.size() == 1)
myFinishedListMenu.addAction(actionRename);
@ -118,6 +119,17 @@ @@ -118,6 +119,17 @@
}
}
void RSSImp::on_actionMark_all_as_read_triggered() {
QList<QTreeWidgetItem*> selectedItems = listStreams->selectedItems();
QTreeWidgetItem* item;
foreach(item, selectedItems){
QString url = item->text(1);
RssStream *feed = rssmanager->getFeed(url);
feed->markAllAsRead();
item->setData(0, Qt::DisplayRole, stream->getAliasOrUrl()+ QString::fromUtf8(" (0)"));
}
}
//right-click somewhere, refresh all the streams
void RSSImp::refreshAllStreams() {
textBrowser->clear();
@ -253,6 +265,7 @@ @@ -253,6 +265,7 @@
addStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/subscribe.png")));
delStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/unsubscribe.png")));
refreshAll_button->setIcon(QIcon(QString::fromUtf8(":/Icons/refresh.png")));
actionMark_all_as_read->setIcon(QIcon(QString::fromUtf8(":/Icons/button_ok.png")));
// icons of right-click menu
actionDelete->setIcon(QIcon(QString::fromUtf8(":/Icons/unsubscribe16.png")));
actionRename->setIcon(QIcon(QString::fromUtf8(":/Icons/log.png")));

1
src/rss_imp.h

@ -57,6 +57,7 @@ class RSSImp : public QWidget, public Ui::RSS{ @@ -57,6 +57,7 @@ class RSSImp : public QWidget, public Ui::RSS{
void selectFirstFeed();
void selectFirstNews();
void updateFeedNbNews(QString url);
void on_actionMark_all_as_read_triggered();
public:
RSSImp();

Loading…
Cancel
Save