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 @@
- valgrind --tool=memcheck --leak-check=full src/qbittorrent (Looks ok) - valgrind --tool=memcheck --leak-check=full src/qbittorrent (Looks ok)
- 128m 29m 16m S 4.8 2.9 0:02.28 qbittorrent - 128m 29m 16m S 4.8 2.9 0:02.28 qbittorrent
* beta 7 * beta 7
- Add "Mark all as read" feature for RSS
- update doc for plugins (and add screenies) - update doc for plugins (and add screenies)
- update doc for options - update doc for options
- Review torrent content selection - Review torrent content selection
@ -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 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 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 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: In torrent content, it is now easier to filter all torrents using right click menu
- BUGFIX: Updated man page / README / INSTALL - BUGFIX: Updated man page / README / INSTALL
- BUGFIX: Paused torrents could be displayed as connected for a sec after checking - 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{
return listItem.size(); return listItem.size();
} }
void markAllAsRead() {
RssItem *item;
foreach(item, listItem){
if(!item->isRead())
item->setRead();
}
}
unsigned int getNbUnRead() const{ unsigned int getNbUnRead() const{
unsigned int nbUnread=0; unsigned int nbUnread=0;
RssItem *item; RssItem *item;

131
src/rss.ui

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

13
src/rss_imp.cpp

@ -35,6 +35,7 @@
QTreeWidgetItem* item = listStreams->itemAt(pos); QTreeWidgetItem* item = listStreams->itemAt(pos);
QList<QTreeWidgetItem*> selectedItems = listStreams->selectedItems(); QList<QTreeWidgetItem*> selectedItems = listStreams->selectedItems();
if(item != 0) { if(item != 0) {
myFinishedListMenu.addAction(actionMark_all_as_read);
myFinishedListMenu.addAction(actionDelete); myFinishedListMenu.addAction(actionDelete);
if(selectedItems.size() == 1) if(selectedItems.size() == 1)
myFinishedListMenu.addAction(actionRename); myFinishedListMenu.addAction(actionRename);
@ -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 //right-click somewhere, refresh all the streams
void RSSImp::refreshAllStreams() { void RSSImp::refreshAllStreams() {
textBrowser->clear(); textBrowser->clear();
@ -253,6 +265,7 @@
addStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/subscribe.png"))); addStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/subscribe.png")));
delStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/unsubscribe.png"))); delStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/unsubscribe.png")));
refreshAll_button->setIcon(QIcon(QString::fromUtf8(":/Icons/refresh.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 // icons of right-click menu
actionDelete->setIcon(QIcon(QString::fromUtf8(":/Icons/unsubscribe16.png"))); actionDelete->setIcon(QIcon(QString::fromUtf8(":/Icons/unsubscribe16.png")));
actionRename->setIcon(QIcon(QString::fromUtf8(":/Icons/log.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{
void selectFirstFeed(); void selectFirstFeed();
void selectFirstNews(); void selectFirstNews();
void updateFeedNbNews(QString url); void updateFeedNbNews(QString url);
void on_actionMark_all_as_read_triggered();
public: public:
RSSImp(); RSSImp();

Loading…
Cancel
Save