Browse Source

- Added a new tab for finished torrents (WIP, not used yet)

adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
13aa2cfa6e
  1. 6
      TODO
  2. 72
      src/FinishedTorrents.h
  3. 12
      src/GUI.cpp
  4. 2
      src/GUI.h
  5. 2
      src/MainWindow.ui
  6. 48
      src/seeding.ui
  7. 4
      src/src.pro

6
TODO

@ -27,6 +27,7 @@
- Allow to set upload limit for each torrent - Allow to set upload limit for each torrent
- Option to shutdown computer when downloads are finished - Option to shutdown computer when downloads are finished
- Add a torrent scheduler - 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 // in v0.10 (partial) - WIP
- Download from RSS feeds (WIP by gtsoul, clean & finish rss.h, add a tab in mainWindow, debug) - 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 - Use a QListWidget to allow multiple input paths
- Possibility to add url seeds - 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) - 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 - 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) - Display more info in log (UPnP)
- Update to libtorrent SVN (0.13) - Update to libtorrent SVN (0.13)
- Use its UPnP/NAT-PMP built-in support instead of ours - Use its UPnP/NAT-PMP built-in support instead of ours
- Use its piece prioritization support - Use its piece prioritization support
- Tab support in search (maybe a bit later)

72
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 <QStandardItemModel>
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

12
src/GUI.cpp

@ -41,6 +41,7 @@
#include "torrentAddition.h" #include "torrentAddition.h"
#include "searchEngine.h" #include "searchEngine.h"
#include "rss_imp.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"))); actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png")));
actionCreate_torrent->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/new.png"))); actionCreate_torrent->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/new.png")));
info_icon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/log.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 // Set default ratio
lbl_ratio_icon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/stare.png"))); lbl_ratio_icon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/stare.png")));
// Fix Tool bar layout // Fix Tool bar layout
@ -167,14 +168,18 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){
systrayIntegration = false; systrayIntegration = false;
qDebug("Info: System tray unavailable\n"); 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 // Search engine tab
searchEngine = new SearchEngine(&BTSession, myTrayIcon); searchEngine = new SearchEngine(&BTSession, myTrayIcon);
tabs->addTab(searchEngine, tr("Search")); 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 // RSS tab
rssWidget = new RSSImp(); rssWidget = new RSSImp();
tabs->addTab(rssWidget, tr("RSS")); 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 // Start download list refresher
refresher = new QTimer(this); refresher = new QTimer(this);
connect(refresher, SIGNAL(timeout()), this, SLOT(updateDlList())); connect(refresher, SIGNAL(timeout()), this, SLOT(updateDlList()));
@ -202,6 +207,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){
// Destructor // Destructor
GUI::~GUI(){ GUI::~GUI(){
delete searchEngine; delete searchEngine;
delete finishedTorrentTab;
delete checkConnect; delete checkConnect;
delete refresher; delete refresher;
if(systrayIntegration){ if(systrayIntegration){

2
src/GUI.h

@ -43,6 +43,7 @@
class createtorrent; class createtorrent;
class QTimer; class QTimer;
class FinishedTorrents;
class DLListDelegate; class DLListDelegate;
class downloadThread; class downloadThread;
class downloadFromURL; class downloadFromURL;
@ -74,6 +75,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
about *aboutdlg; about *aboutdlg;
QStandardItemModel *DLListModel; QStandardItemModel *DLListModel;
DLListDelegate *DLDelegate; DLListDelegate *DLDelegate;
FinishedTorrents *finishedTorrentTab;
unsigned int nbTorrents; unsigned int nbTorrents;
QLabel *connecStatusLblIcon; QLabel *connecStatusLblIcon;
bool systrayIntegration; bool systrayIntegration;

2
src/MainWindow.ui

@ -33,7 +33,7 @@
</property> </property>
<widget class="QWidget" name="tab" > <widget class="QWidget" name="tab" >
<attribute name="title" > <attribute name="title" >
<string>Transfers</string> <string>Downloads</string>
</attribute> </attribute>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" >
<property name="margin" > <property name="margin" >

48
src/seeding.ui

@ -0,0 +1,48 @@
<ui version="4.0" >
<class>seeding</class>
<widget class="QWidget" name="seeding" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>811</width>
<height>453</height>
</rect>
</property>
<property name="windowTitle" >
<string>Search</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="lbl_finished" >
<property name="text" >
<string>The following torrents are finished and shared:</string>
</property>
</widget>
</item>
<item>
<widget class="QTreeView" name="finishedList" />
</item>
<item>
<widget class="QLabel" name="lbl_note" >
<property name="font" >
<font>
<italic>true</italic>
</font>
</property>
<property name="text" >
<string>&lt;u>Note:&lt;/u> It is important that you keep sharing your torrents after they are finished for the well being of the network.</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

4
src/src.pro

@ -116,11 +116,11 @@ HEADERS += GUI.h misc.h options_imp.h about_imp.h \
downloadThread.h downloadFromURLImp.h \ downloadThread.h downloadFromURLImp.h \
torrentAddition.h deleteThread.h \ torrentAddition.h deleteThread.h \
bittorrent.h searchEngine.h \ bittorrent.h searchEngine.h \
rss.h rss_imp.h rss.h rss_imp.h FinishedTorrents.h
FORMS += MainWindow.ui options.ui about.ui \ FORMS += MainWindow.ui options.ui about.ui \
properties.ui createtorrent.ui preview.ui \ properties.ui createtorrent.ui preview.ui \
login.ui downloadFromURL.ui addTorrentDialog.ui \ login.ui downloadFromURL.ui addTorrentDialog.ui \
search.ui rss.ui search.ui rss.ui seeding.ui
SOURCES += GUI.cpp \ SOURCES += GUI.cpp \
main.cpp \ main.cpp \
options_imp.cpp \ options_imp.cpp \

Loading…
Cancel
Save