mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-10 23:07:59 +00:00
- Added a new tab for finished torrents (WIP, not used yet)
This commit is contained in:
parent
c832d91f79
commit
13aa2cfa6e
6
TODO
6
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
|
||||
- Tab support in search (maybe a bit later)
|
72
src/FinishedTorrents.h
Normal file
72
src/FinishedTorrents.h
Normal file
@ -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
12
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){
|
||||
|
@ -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;
|
||||
|
@ -33,7 +33,7 @@
|
||||
</property>
|
||||
<widget class="QWidget" name="tab" >
|
||||
<attribute name="title" >
|
||||
<string>Transfers</string>
|
||||
<string>Downloads</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
|
48
src/seeding.ui
Normal file
48
src/seeding.ui
Normal file
@ -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><u>Note:</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>
|
@ -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 \
|
||||
|
Loading…
Reference in New Issue
Block a user