From 6c8f0bff135919dac8316da65fb430484929ec86 Mon Sep 17 00:00:00 2001 From: Arnaud Demaiziere Date: Thu, 29 Mar 2007 15:43:08 +0000 Subject: [PATCH] - Added a rss tab (still not functional) --- TODO | 5 +- src/GUI.cpp | 5 ++ src/GUI.h | 3 + src/downloadThread.h | 1 + src/rss.ui | 191 +++++++++++++++++++++++++++++++++++++++++++ src/rss_imp.h | 38 +++++++++ src/src.pro | 7 +- 7 files changed, 245 insertions(+), 5 deletions(-) create mode 100644 src/rss.ui create mode 100644 src/rss_imp.h diff --git a/TODO b/TODO index 6319f684e..4d3e8f1e0 100644 --- a/TODO +++ b/TODO @@ -29,7 +29,7 @@ - Add a torrent scheduler // in v0.10 (partial) - WIP -- Download from RSS feeds (WIP by gtsoul in RSS_SUPPORT branch, clean & finish rss.h, merge with trunk, add a tab in mainWindow, debug) +- Download from RSS feeds (WIP by gtsoul, clean & finish rss.h, add a tab in mainWindow, debug) - Move finished torrent to another tab and keep on seeding them even after restart (better for sharing) - Improve torrent creation dialog (look & features) : - Add Private combobox (allow to share on DHT or not) @@ -44,4 +44,5 @@ - Exit confirmation only if there are active downloads (display number of downloads) - SMARTER - Make use of QNetworkInterface (could be useful ?) - Display more info in log (UPnP successful) -- Possibility to disable the trayicon \ No newline at end of file +- Possibility to disable the trayicon +- Bring mainWindow to foreground when asking for exit confirmation \ No newline at end of file diff --git a/src/GUI.cpp b/src/GUI.cpp index 2eff51191..0df8f59c8 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -40,6 +40,7 @@ #include "downloadFromURLImp.h" #include "torrentAddition.h" #include "searchEngine.h" +#include "rss_imp.h" /***************************************************** * * @@ -163,6 +164,10 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){ searchEngine = new SearchEngine(&BTSession, myTrayIcon); tabs->addTab(searchEngine, tr("Search")); tabs->setTabIcon(1, QIcon(QString::fromUtf8(":/Icons/skin/search.png"))); + // RSS tab + rssWidget = new RSSImp(); + tabs->addTab(rssWidget, tr("RSS")); + tabs->setTabIcon(2, QIcon(QString::fromUtf8(":/Icons/skin/search.png"))); // Start download list refresher refresher = new QTimer(this); connect(refresher, SIGNAL(timeout()), this, SLOT(updateDlList())); diff --git a/src/GUI.h b/src/GUI.h index 0479a1336..085bb5139 100644 --- a/src/GUI.h +++ b/src/GUI.h @@ -50,6 +50,7 @@ class SearchEngine; class QTcpServer; class QTcpSocket; class QCloseEvent; +class RSSImp; using namespace libtorrent; namespace fs = boost::filesystem; @@ -80,6 +81,8 @@ class GUI : public QMainWindow, private Ui::MainWindow{ QProcess *previewProcess; // Search SearchEngine *searchEngine; + // RSS + RSSImp *rssWidget; // Misc QTcpServer *tcpServer; QTcpSocket *clientConnection; diff --git a/src/downloadThread.h b/src/downloadThread.h index 20ea996d1..049a707e0 100644 --- a/src/downloadThread.h +++ b/src/downloadThread.h @@ -156,6 +156,7 @@ class downloadThread : public QThread { curl_easy_cleanup(curl); // Close tmp file fclose(file); + qDebug("##### chemin "+filePath.toUtf8()); emit downloadFinished(url, filePath, return_code, QString(errorBuffer)); qDebug("In Download thread RUN, signal emitted, ErrorBuffer: %s", errorBuffer); }else{ diff --git a/src/rss.ui b/src/rss.ui new file mode 100644 index 000000000..0b776e97d --- /dev/null +++ b/src/rss.ui @@ -0,0 +1,191 @@ + + RSS + + + + 0 + 0 + 811 + 453 + + + + Search + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + 0 + + + 6 + + + + + + 75 + true + + + + RSS streams: + + + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 0 + + + 6 + + + + + + 75 + true + + + + News: + + + + + + + + 600 + 0 + + + + + + + + + + + + + + + + diff --git a/src/rss_imp.h b/src/rss_imp.h new file mode 100644 index 000000000..bdb3ed2bb --- /dev/null +++ b/src/rss_imp.h @@ -0,0 +1,38 @@ +/* + * Bittorrent Client using Qt4 and libtorrent. + * Copyright (C) 2006 Christophe Dumez, Arnaud Demaiziere + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contact : chris@qbittorrent.org + */ +#ifndef __RSS_IMP_H__ +#define __RSS_IMP_H__ + +#include "ui_rss.h" +#include "rss.h" + +class RSSImp : public QWidget, public Ui::RSS{ + Q_OBJECT + + public: + RSSImp() : QWidget(){ + setupUi(this); + } + + ~RSSImp(){} +}; + +#endif diff --git a/src/src.pro b/src/src.pro index 4f95f7849..29139b229 100644 --- a/src/src.pro +++ b/src/src.pro @@ -30,7 +30,7 @@ QMAKE_CXXFLAGS_DEBUG += -fwrapv #LIBS += -lcurl -lupnp #CONFIG += link_pkgconfig #PKGCONFIG += libtorrent -QT += network +QT += network xml DEFINES += QT_NO_CAST_TO_ASCII @@ -115,11 +115,12 @@ HEADERS += GUI.h misc.h options_imp.h about_imp.h \ PreviewListDelegate.h trackerLogin.h \ downloadThread.h downloadFromURLImp.h \ torrentAddition.h deleteThread.h \ - bittorrent.h searchEngine.h + bittorrent.h searchEngine.h \ + rss.h rss_imp.h FORMS += MainWindow.ui options.ui about.ui \ properties.ui createtorrent.ui preview.ui \ login.ui downloadFromURL.ui addTorrentDialog.ui \ - search.ui + search.ui rss.ui SOURCES += GUI.cpp \ main.cpp \ options_imp.cpp \