diff --git a/TODO b/TODO index 125e2e369..1e717735b 100644 --- a/TODO +++ b/TODO @@ -27,6 +27,7 @@ - Allow to set upload limit for each torrent - Option to shutdown computer when downloads are finished - Add a torrent scheduler +- Improve Ipfilter.dat parser (move to a thread ? - too slow to load qBT and more importantly options) // in v0.10 (partial) - WIP - Download from RSS feeds (WIP by gtsoul, clean & finish rss.h, add a tab in mainWindow, debug) @@ -36,11 +37,10 @@ - Use a QListWidget to allow multiple input paths - Possibility to add url seeds - Add IPv6 support (at least start working on it, libtorrent seems to support it, we should limit our code to IPv4 anymore) -- UPnP support (debug, sync with next aMule release, move to a thread?) : seems to be working! - Display Url seeds in torrent properties and allow to edit them -- Improve Ipfilter.dat parser (move to a thread ? - too slow to load qBT and more importantly options) -- Use tooltips to explain options +- Use tooltips to explain options? - Display more info in log (UPnP) - Update to libtorrent SVN (0.13) - Use its UPnP/NAT-PMP built-in support instead of ours - - Use its piece prioritization support \ No newline at end of file + - Use its piece prioritization support +- Tab support in search (maybe a bit later) \ No newline at end of file diff --git a/src/FinishedTorrents.h b/src/FinishedTorrents.h new file mode 100644 index 000000000..d492ef9c1 --- /dev/null +++ b/src/FinishedTorrents.h @@ -0,0 +1,72 @@ +/* + * Bittorrent Client using Qt4 and libtorrent. + * Copyright (C) 2006 Christophe Dumez + * + * 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 SEEDING_H +#define SEEDING_H + +#include "ui_seeding.h" +#include "bittorrent.h" +#include "DLListDelegate.h" +#include + +class FinishedTorrents : public QWidget, public Ui::seeding{ + Q_OBJECT + private: + bittorrent *BTSession; + DLListDelegate *finishedListDelegate; + QStringList finishedSHAs; + QStandardItemModel *finishedListModel; + + public: + FinishedTorrents(bittorrent *BTSession){ + setupUi(this); + this->BTSession = BTSession; + finishedListModel = new QStandardItemModel(0,9); + finishedListModel->setHeaderData(NAME, Qt::Horizontal, tr("Name", "i.e: file name")); + finishedListModel->setHeaderData(SIZE, Qt::Horizontal, tr("Size", "i.e: file size")); + finishedListModel->setHeaderData(PROGRESS, Qt::Horizontal, tr("Progress", "i.e: % downloaded")); + finishedListModel->setHeaderData(DLSPEED, Qt::Horizontal, tr("DL Speed", "i.e: Download speed")); + finishedListModel->setHeaderData(UPSPEED, Qt::Horizontal, tr("UP Speed", "i.e: Upload speed")); + finishedListModel->setHeaderData(SEEDSLEECH, Qt::Horizontal, tr("Seeds/Leechs", "i.e: full/partial sources")); + finishedListModel->setHeaderData(STATUS, Qt::Horizontal, tr("Status")); + finishedListModel->setHeaderData(ETA, Qt::Horizontal, tr("ETA", "i.e: Estimated Time of Arrival / Time left")); + finishedList->setModel(finishedListModel); + // Hide hash column + finishedList->hideColumn(HASH); + finishedListDelegate = new DLListDelegate(); + finishedList->setItemDelegate(finishedListDelegate); + } + + ~FinishedTorrents(){ + delete finishedListDelegate; + delete finishedListModel; + } + + void addFinishedSHA(QString sha){ + if(finishedSHAs.indexOf(sha) == -1) + finishedSHAs << sha; + else + qDebug("Problem: this torrent (%s) has finished twice...", sha.toStdString().c_str()); + } + +}; + +#endif diff --git a/src/GUI.cpp b/src/GUI.cpp index b84993d8e..cbc641da1 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -41,6 +41,7 @@ #include "torrentAddition.h" #include "searchEngine.h" #include "rss_imp.h" +#include "FinishedTorrents.h" /***************************************************** * * @@ -79,7 +80,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){ actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png"))); actionCreate_torrent->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/new.png"))); info_icon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/log.png"))); - tabs->setTabIcon(0, QIcon(QString::fromUtf8(":/Icons/home.png"))); + tabs->setTabIcon(0, QIcon(QString::fromUtf8(":/Icons/skin/downloading.png"))); // Set default ratio lbl_ratio_icon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/stare.png"))); // Fix Tool bar layout @@ -167,14 +168,18 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){ systrayIntegration = false; qDebug("Info: System tray unavailable\n"); } + // Finished torrents tab + finishedTorrentTab = new FinishedTorrents(&BTSession); + tabs->addTab(finishedTorrentTab, tr("Finished")); + tabs->setTabIcon(1, QIcon(QString::fromUtf8(":/Icons/skin/seeding.png"))); // Search engine tab searchEngine = new SearchEngine(&BTSession, myTrayIcon); tabs->addTab(searchEngine, tr("Search")); - tabs->setTabIcon(1, QIcon(QString::fromUtf8(":/Icons/skin/search.png"))); + tabs->setTabIcon(2, QIcon(QString::fromUtf8(":/Icons/skin/search.png"))); // RSS tab rssWidget = new RSSImp(); tabs->addTab(rssWidget, tr("RSS")); - tabs->setTabIcon(2, QIcon(QString::fromUtf8(":/Icons/rss.png"))); + tabs->setTabIcon(3, QIcon(QString::fromUtf8(":/Icons/rss.png"))); // Start download list refresher refresher = new QTimer(this); connect(refresher, SIGNAL(timeout()), this, SLOT(updateDlList())); @@ -202,6 +207,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){ // Destructor GUI::~GUI(){ delete searchEngine; + delete finishedTorrentTab; delete checkConnect; delete refresher; if(systrayIntegration){ diff --git a/src/GUI.h b/src/GUI.h index 19c88d354..2770587cc 100644 --- a/src/GUI.h +++ b/src/GUI.h @@ -43,6 +43,7 @@ class createtorrent; class QTimer; +class FinishedTorrents; class DLListDelegate; class downloadThread; class downloadFromURL; @@ -74,6 +75,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{ about *aboutdlg; QStandardItemModel *DLListModel; DLListDelegate *DLDelegate; + FinishedTorrents *finishedTorrentTab; unsigned int nbTorrents; QLabel *connecStatusLblIcon; bool systrayIntegration; diff --git a/src/MainWindow.ui b/src/MainWindow.ui index 1599d94eb..7aaa187de 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -33,7 +33,7 @@ - Transfers + Downloads diff --git a/src/seeding.ui b/src/seeding.ui new file mode 100644 index 000000000..ff743f21e --- /dev/null +++ b/src/seeding.ui @@ -0,0 +1,48 @@ + + seeding + + + + 0 + 0 + 811 + 453 + + + + Search + + + + 9 + + + 6 + + + + + The following torrents are finished and shared: + + + + + + + + + + + true + + + + <u>Note:</u> It is important that you keep sharing your torrents after they are finished for the well being of the network. + + + + + + + + diff --git a/src/src.pro b/src/src.pro index 29b3e3c05..fd931c51f 100644 --- a/src/src.pro +++ b/src/src.pro @@ -116,11 +116,11 @@ HEADERS += GUI.h misc.h options_imp.h about_imp.h \ downloadThread.h downloadFromURLImp.h \ torrentAddition.h deleteThread.h \ bittorrent.h searchEngine.h \ - rss.h rss_imp.h + rss.h rss_imp.h FinishedTorrents.h FORMS += MainWindow.ui options.ui about.ui \ properties.ui createtorrent.ui preview.ui \ login.ui downloadFromURL.ui addTorrentDialog.ui \ - search.ui rss.ui + search.ui rss.ui seeding.ui SOURCES += GUI.cpp \ main.cpp \ options_imp.cpp \