Compare commits
77 Commits
release-1.
...
release-1.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6930ac8c8c | ||
![]() |
79d5ae18a6 | ||
![]() |
5cce0c53bf | ||
![]() |
681b8c14ad | ||
![]() |
443567486e | ||
![]() |
c10ebc3086 | ||
![]() |
42a2acefd3 | ||
![]() |
c781545609 | ||
![]() |
ba06affec7 | ||
![]() |
6140d69fcb | ||
![]() |
71a81fd1b7 | ||
![]() |
4e05b62bbe | ||
![]() |
9d366c8c7d | ||
![]() |
940744b0bf | ||
![]() |
6c2518a704 | ||
![]() |
ef51fabf63 | ||
![]() |
1aedd97d4d | ||
![]() |
ff26ea94f5 | ||
![]() |
c7a289d183 | ||
![]() |
2a70c8f4d8 | ||
![]() |
e27b08d970 | ||
![]() |
48ec57604f | ||
![]() |
db1bbea26a | ||
![]() |
7bbb2f542b | ||
![]() |
5563e24781 | ||
![]() |
f131f6210f | ||
![]() |
0356fa4538 | ||
![]() |
b9c4a434c9 | ||
![]() |
a4318cc060 | ||
![]() |
d6e7161eff | ||
![]() |
e428489ebc | ||
![]() |
fa4cffe3d4 | ||
![]() |
a355a87ec5 | ||
![]() |
39749620a4 | ||
![]() |
e7674bfaf8 | ||
![]() |
3e8ad9eb83 | ||
![]() |
6a95f9170c | ||
![]() |
cc4a542e9d | ||
![]() |
fed63b0b85 | ||
![]() |
bf7b11d87d | ||
![]() |
bb959ba465 | ||
![]() |
b77e28fb12 | ||
![]() |
261f981a9a | ||
![]() |
93ad7e889e | ||
![]() |
b79e2906e8 | ||
![]() |
99e8ac3d36 | ||
![]() |
badd36e81e | ||
![]() |
c835502692 | ||
![]() |
4fe7fd537d | ||
![]() |
88ea548eaf | ||
![]() |
360c8500bb | ||
![]() |
7a925f15ba | ||
![]() |
15ce9a7369 | ||
![]() |
4b8532ea2d | ||
![]() |
8e7d0f4dc1 | ||
![]() |
de0ac5cda4 | ||
![]() |
9a9fd4e2d1 | ||
![]() |
4be0cbd2e4 | ||
![]() |
5fef86ec18 | ||
![]() |
1acd05794a | ||
![]() |
5a61b7543b | ||
![]() |
b6b74752a5 | ||
![]() |
27a71ba123 | ||
![]() |
20ae3d997c | ||
![]() |
b73d0548c8 | ||
![]() |
ca118697e9 | ||
![]() |
600308aaa1 | ||
![]() |
9b1ea66659 | ||
![]() |
d29cc3325b | ||
![]() |
9f6e28b741 | ||
![]() |
4c5f349f49 | ||
![]() |
9a321adfb1 | ||
![]() |
e233f27d1c | ||
![]() |
1cadf73a40 | ||
![]() |
77c97b5b43 | ||
![]() |
0054a330fb | ||
![]() |
8ba05c57b0 |
26
Changelog
@@ -1,4 +1,27 @@
|
||||
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.1.0
|
||||
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.2.0
|
||||
- FEATURE: Torrent queueing system (with priorities)
|
||||
- FEATURE: DHT is always ON (no longer used as fallback)
|
||||
- FEATURE: The number of DHT nodes is displayed
|
||||
- FEATURE: RSS can now be disabled from program preferences
|
||||
- BUGFIX: Disable ETA calculation when ETA column is hidden
|
||||
- BUGFIX: Removed "disconnected" connection state, detection was far from perfect
|
||||
- COSMETIC: Transfer speed, ratio, connection status and DHT nodes are displayed in status bar
|
||||
- COSMETIC: RSS Tab is now hidden as a default
|
||||
- COSMETIC: Allow to hide or display top toolbar
|
||||
- COSMETIC: Top toolbar is now hidden as a default
|
||||
|
||||
* Tue Aug 26 2008 - Christophe Dumez <chris@qbittorrent.org> - v1.1.3
|
||||
- BUGFIX: Fixed ratio saving for seeding torrents
|
||||
- I18N: Added czech and traditional chinese translations
|
||||
|
||||
* Sun Aug 17 2008 - Christophe Dumez <chris@qbittorrent.org> - v1.1.2
|
||||
- BUGFIX: Fixed progress calculation
|
||||
- BUGFIX: Fixed finished torrent detection
|
||||
|
||||
* Fri Aug 01 2008 - Christophe Dumez <chris@qbittorrent.org> - v1.1.1
|
||||
- BUGFIX: Fixed bad resource file for icons
|
||||
|
||||
* Fri Aug 01 2008 - Christophe Dumez <chris@qbittorrent.org> - v1.1.0
|
||||
- FEATURE: Web interface to control qbittorrent (Ishan Arora)
|
||||
- FEATURE: Can spoof Azureus peer id to avoid ban
|
||||
- FEATURE: Allow to hide/show some columns in download and seeding lists
|
||||
@@ -27,6 +50,7 @@
|
||||
- COSMETIC: Display "unpaused/total_torrent" in download/upload tabs
|
||||
- COSMETIC: Allow to resize RSS column
|
||||
- COSMETIC: Global UP/DL speeds and ratio are displayed above tabs
|
||||
- COSMETIC: Use infinity symbol for ETA when time is infinite
|
||||
|
||||
* Fri Apr 11 2008 - Christophe Dumez <chris@qbittorrent.org> - v1.0.0
|
||||
- FEATURE: Based on new libtorrent v0.13
|
||||
|
45
TODO
@@ -1,45 +1,4 @@
|
||||
// Easy
|
||||
- Translations into as many languages as possible
|
||||
- Use Launchpad/Rosetta for translations once it supports TS files
|
||||
|
||||
// Intermediate
|
||||
- Port on MacOS, Windows (and create an installer for Windows) - Slow progress
|
||||
- Add some transparency (menus,...), improve look / usabilty
|
||||
- Skins support? (contact Mateusz)
|
||||
|
||||
// Harder
|
||||
- Torrent scheduler ala µtorrent/Bitcomet
|
||||
|
||||
// Waiting for libtorrent
|
||||
- Allow to prioritize torrents (may code this in qBittorrent?)
|
||||
|
||||
// Unsure
|
||||
- Display the peers we are connected to for each torrent with infos (like flag, dl/up speeds, ...)
|
||||
- Azureus spoofing to prevent ban from trackers?
|
||||
- Option to shutdown computer when downloads are finished
|
||||
- NAT checker/Tester
|
||||
- Display hard drive space left?
|
||||
- Make use of dbus on Linux for the single instance instead of socket communication?
|
||||
(http://techbase.kde.org/Development/Tutorials/D-Bus/Accessing_Interfaces)
|
||||
- When favicon can't be downloaded, try to parse the webpage for:
|
||||
<link rel="icon" href="http://example.com/favicon.ico" type="image/vnd.microsoft.icon">
|
||||
* Be careful, the link can be relative
|
||||
- Improve search plugin install (choose in a list taken from plugins.qbittorrent.org)
|
||||
- support zipped torrents? (useful?)
|
||||
- Allow to limit the number of downloading torrents simultaneously (other are paused until a download finishes)
|
||||
See https://blueprints.launchpad.net/qbittorrent/
|
||||
|
||||
// in v1.2.0
|
||||
- Allow user to organize the downloads into categories/folders?
|
||||
|
||||
// in v1.1.0
|
||||
- Stop calculating ETAs when ETA column is hidden
|
||||
-> See https://blueprints.launchpad.net/qbittorrent
|
||||
|
||||
Translations updated:
|
||||
- French
|
||||
- Chinese
|
||||
- Polish
|
||||
- Portuguese
|
||||
- Brazilian
|
||||
- Slovak
|
||||
- Swedish
|
||||
- Split download and uploads in Web UI (Ishan Ahora)
|
||||
|
@@ -40,7 +40,8 @@
|
||||
#define SEEDSLEECH 5
|
||||
#define RATIO 6
|
||||
#define ETA 7
|
||||
#define HASH 8
|
||||
#define PRIORITY 8
|
||||
#define HASH 9
|
||||
|
||||
class DLListDelegate: public QItemDelegate {
|
||||
Q_OBJECT
|
||||
|
@@ -37,7 +37,8 @@
|
||||
#define F_UPSPEED 2
|
||||
#define F_LEECH 3
|
||||
#define F_RATIO 4
|
||||
#define F_HASH 5
|
||||
#define F_PRIORITY 5
|
||||
#define F_HASH 6
|
||||
|
||||
class FinishedListDelegate: public QItemDelegate {
|
||||
Q_OBJECT
|
||||
|
@@ -38,14 +38,17 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
|
||||
actionStart->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/play.png")));
|
||||
actionPause->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/pause.png")));
|
||||
connect(BTSession, SIGNAL(addedTorrent(QString, QTorrentHandle&, bool)), this, SLOT(torrentAdded(QString, QTorrentHandle&, bool)));
|
||||
finishedListModel = new QStandardItemModel(0,6);
|
||||
finishedListModel = new QStandardItemModel(0,7);
|
||||
finishedListModel->setHeaderData(F_NAME, Qt::Horizontal, tr("Name", "i.e: file name"));
|
||||
finishedListModel->setHeaderData(F_SIZE, Qt::Horizontal, tr("Size", "i.e: file size"));
|
||||
finishedListModel->setHeaderData(F_UPSPEED, Qt::Horizontal, tr("UP Speed", "i.e: Upload speed"));
|
||||
finishedListModel->setHeaderData(F_LEECH, Qt::Horizontal, tr("Leechers", "i.e: full/partial sources"));
|
||||
finishedListModel->setHeaderData(F_RATIO, Qt::Horizontal, tr("Ratio"));
|
||||
finishedListModel->setHeaderData(F_PRIORITY, Qt::Horizontal, tr("Priority"));
|
||||
finishedList->setModel(finishedListModel);
|
||||
loadHiddenColumns();
|
||||
// Hide priority column
|
||||
finishedList->hideColumn(F_PRIORITY);
|
||||
// Hide hash column
|
||||
finishedList->hideColumn(F_HASH);
|
||||
// Load last columns width for download list
|
||||
@@ -61,8 +64,8 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
|
||||
connect(finishedList, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayFinishedListMenu(const QPoint&)));
|
||||
finishedList->header()->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(finishedList->header(), SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayFinishedHoSMenu(const QPoint&)));
|
||||
|
||||
connect(finishedList, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(notifyTorrentDoubleClicked(const QModelIndex&)));
|
||||
connect(BTSession, SIGNAL(forceFinishedListUpdate()), this, SLOT(updateFinishedList()));
|
||||
actionDelete->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete.png")));
|
||||
actionPreview_file->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/preview.png")));
|
||||
actionDelete_Permanently->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete_perm.png")));
|
||||
@@ -71,6 +74,8 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
|
||||
connect(actionPause, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionPause_triggered()));
|
||||
connect(actionStart, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionStart_triggered()));
|
||||
connect(actionDelete, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionDelete_triggered()));
|
||||
connect(actionIncreasePriority, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionIncreasePriority_triggered()));
|
||||
connect(actionDecreasePriority, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionDecreasePriority_triggered()));
|
||||
connect(actionPreview_file, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionPreview_file_triggered()));
|
||||
connect(actionDelete_Permanently, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionDelete_Permanently_triggered()));
|
||||
connect(actionOpen_destination_folder, SIGNAL(triggered()), (GUI*)parent, SLOT(openDestinationFolder()));
|
||||
@@ -82,6 +87,7 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
|
||||
connect(actionHOSColUpSpeed, SIGNAL(triggered()), this, SLOT(hideOrShowColumnUpSpeed()));
|
||||
connect(actionHOSColLeechers, SIGNAL(triggered()), this, SLOT(hideOrShowColumnLeechers()));
|
||||
connect(actionHOSColRatio, SIGNAL(triggered()), this, SLOT(hideOrShowColumnRatio()));
|
||||
connect(actionHOSColPriority, SIGNAL(triggered()), this, SLOT(hideOrShowColumnPriority()));
|
||||
}
|
||||
|
||||
FinishedTorrents::~FinishedTorrents(){
|
||||
@@ -97,6 +103,14 @@ void FinishedTorrents::notifyTorrentDoubleClicked(const QModelIndex& index) {
|
||||
emit torrentDoubleClicked(hash, true);
|
||||
}
|
||||
|
||||
void FinishedTorrents::hidePriorityColumn(bool hide) {
|
||||
finishedList->setColumnHidden(F_PRIORITY, hide);
|
||||
if(hide)
|
||||
getActionHoSCol(F_PRIORITY)->setIcon(QIcon(QString::fromUtf8(":/Icons/button_cancel.png")));
|
||||
else
|
||||
getActionHoSCol(F_PRIORITY)->setIcon(QIcon(QString::fromUtf8(":/Icons/button_ok.png")));
|
||||
}
|
||||
|
||||
void FinishedTorrents::addTorrent(QString hash){
|
||||
if(!BTSession->isFinished(hash)){
|
||||
BTSession->setFinishedTorrent(hash);
|
||||
@@ -112,6 +126,8 @@ void FinishedTorrents::addTorrent(QString hash){
|
||||
finishedListModel->setData(finishedListModel->index(row, F_UPSPEED), QVariant((double)0.));
|
||||
finishedListModel->setData(finishedListModel->index(row, F_LEECH), QVariant("0"));
|
||||
finishedListModel->setData(finishedListModel->index(row, F_RATIO), QVariant(QString::fromUtf8(misc::toString(BTSession->getRealRatio(hash)).c_str())));
|
||||
if(BTSession->isQueueingEnabled())
|
||||
finishedListModel->setData(finishedListModel->index(row, F_PRIORITY), QVariant((int)BTSession->getUpTorrentPriority(hash)));
|
||||
finishedListModel->setData(finishedListModel->index(row, F_HASH), QVariant(hash));
|
||||
if(h.is_paused()) {
|
||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QIcon(":/Icons/skin/paused.png"), Qt::DecorationRole);
|
||||
@@ -237,6 +253,14 @@ void FinishedTorrents::updateFinishedList(){
|
||||
row = getRowFromHash(hash);
|
||||
}
|
||||
Q_ASSERT(row != -1);
|
||||
// Update priority
|
||||
if(BTSession->isQueueingEnabled()) {
|
||||
finishedListModel->setData(finishedListModel->index(row, F_PRIORITY), QVariant((int)BTSession->getUpTorrentPriority(hash)));
|
||||
if(h.is_paused() && BTSession->isUploadQueued(hash)) {
|
||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/queued.png"))), Qt::DecorationRole);
|
||||
setRowColor(row, QString::fromUtf8("grey"));
|
||||
}
|
||||
}
|
||||
if(h.is_paused()) continue;
|
||||
if(BTSession->getTorrentsToPauseAfterChecking().indexOf(hash) != -1) {
|
||||
continue;
|
||||
@@ -247,7 +271,7 @@ void FinishedTorrents::updateFinishedList(){
|
||||
if (reponse == QMessageBox::Yes) {
|
||||
qDebug("Info: a torrent was moved from finished to download tab");
|
||||
deleteTorrent(hash);
|
||||
BTSession->setFinishedTorrent(hash);
|
||||
BTSession->setUnfinishedTorrent(hash);
|
||||
emit torrentMovedFromFinishedList(hash);
|
||||
}
|
||||
else if (reponse == QMessageBox::No) {
|
||||
@@ -389,12 +413,17 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){
|
||||
myFinishedListMenu.addSeparator();
|
||||
myFinishedListMenu.addAction(actionOpen_destination_folder);
|
||||
myFinishedListMenu.addAction(actionTorrent_Properties);
|
||||
if(BTSession->isQueueingEnabled()) {
|
||||
myFinishedListMenu.addSeparator();
|
||||
myFinishedListMenu.addAction(actionIncreasePriority);
|
||||
myFinishedListMenu.addAction(actionDecreasePriority);
|
||||
}
|
||||
myFinishedListMenu.addSeparator();
|
||||
myFinishedListMenu.addAction(actionBuy_it);
|
||||
|
||||
// Call menu
|
||||
// XXX: why mapToGlobal() is not enough?
|
||||
myFinishedListMenu.exec(mapToGlobal(pos)+QPoint(10,55));
|
||||
myFinishedListMenu.exec(mapToGlobal(pos)+QPoint(10,58));
|
||||
}
|
||||
|
||||
|
||||
@@ -406,11 +435,17 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){
|
||||
void FinishedTorrents::displayFinishedHoSMenu(const QPoint& pos){
|
||||
QMenu hideshowColumn(this);
|
||||
hideshowColumn.setTitle(tr("Hide or Show Column"));
|
||||
for(int i=0; i<=F_RATIO; i++) {
|
||||
int lastCol;
|
||||
if(BTSession->isQueueingEnabled()) {
|
||||
lastCol = F_PRIORITY;
|
||||
} else {
|
||||
lastCol = F_RATIO;
|
||||
}
|
||||
for(int i=0; i<=lastCol; i++) {
|
||||
hideshowColumn.addAction(getActionHoSCol(i));
|
||||
}
|
||||
// Call menu
|
||||
hideshowColumn.exec(mapToGlobal(pos)+QPoint(10,55));
|
||||
hideshowColumn.exec(mapToGlobal(pos)+QPoint(10,34));
|
||||
}
|
||||
|
||||
// toggle hide/show a column
|
||||
@@ -464,6 +499,10 @@ void FinishedTorrents::hideOrShowColumnRatio() {
|
||||
hideOrShowColumn(F_RATIO);
|
||||
}
|
||||
|
||||
void FinishedTorrents::hideOrShowColumnPriority() {
|
||||
hideOrShowColumn(F_PRIORITY);
|
||||
}
|
||||
|
||||
// load the previous settings, and hide the columns
|
||||
bool FinishedTorrents::loadHiddenColumns() {
|
||||
bool loaded = false;
|
||||
@@ -525,6 +564,9 @@ QAction* FinishedTorrents::getActionHoSCol(int index) {
|
||||
case F_RATIO :
|
||||
return actionHOSColRatio;
|
||||
break;
|
||||
case F_PRIORITY :
|
||||
return actionHOSColPriority;
|
||||
break;
|
||||
default :
|
||||
return NULL;
|
||||
}
|
||||
@@ -548,6 +590,7 @@ void FinishedTorrents::sortFinishedList(int index){
|
||||
switch(index){
|
||||
case F_SIZE:
|
||||
case F_UPSPEED:
|
||||
case F_PRIORITY:
|
||||
sortFinishedListFloat(index, sortOrder);
|
||||
break;
|
||||
default:
|
||||
|
@@ -72,6 +72,7 @@ class FinishedTorrents : public QWidget, public Ui::seeding {
|
||||
void hideOrShowColumnUpSpeed();
|
||||
void hideOrShowColumnLeechers();
|
||||
void hideOrShowColumnRatio();
|
||||
void hideOrShowColumnPriority();
|
||||
|
||||
public slots:
|
||||
void addTorrent(QString hash);
|
||||
@@ -81,6 +82,7 @@ class FinishedTorrents : public QWidget, public Ui::seeding {
|
||||
void propertiesSelection();
|
||||
void deleteTorrent(QString hash);
|
||||
void showPropertiesFromHash(QString hash);
|
||||
void hidePriorityColumn(bool hide);
|
||||
|
||||
signals:
|
||||
void torrentMovedFromFinishedList(QString);
|
||||
|
238
src/GUI.cpp
18
src/GUI.h
@@ -52,6 +52,7 @@ class QTabWidget;
|
||||
class QLabel;
|
||||
class QModelIndex;
|
||||
class HttpServer;
|
||||
class QFrame;
|
||||
|
||||
class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
Q_OBJECT
|
||||
@@ -75,12 +76,22 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
bool force_exit;
|
||||
unsigned int refreshInterval;
|
||||
QTimer *refresher;
|
||||
QLabel *dlSpeedLbl;
|
||||
QLabel *upSpeedLbl;
|
||||
QLabel *ratioLbl;
|
||||
QLabel *DHTLbl;
|
||||
QFrame *statusSep1;
|
||||
QFrame *statusSep2;
|
||||
QFrame *statusSep3;
|
||||
QFrame *statusSep4;
|
||||
// Keyboard shortcuts
|
||||
QShortcut *switchSearchShortcut;
|
||||
QShortcut *switchSearchShortcut2;
|
||||
QShortcut *switchDownShortcut;
|
||||
QShortcut *switchUpShortcut;
|
||||
QShortcut *switchRSSShortcut;
|
||||
QAction *prioSeparator;
|
||||
QAction *prioSeparator2;
|
||||
// Search
|
||||
SearchEngine *searchEngine;
|
||||
// RSS
|
||||
@@ -116,6 +127,8 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
void readSettings();
|
||||
void on_actionExit_triggered();
|
||||
void createTrayIcon();
|
||||
void updateUnfinishedTorrentNumberCalc();
|
||||
void updateFinishedTorrentNumberCalc();
|
||||
void updateUnfinishedTorrentNumber(unsigned int nb);
|
||||
void updateFinishedTorrentNumber(unsigned int nb);
|
||||
void fullDiskError(QTorrentHandle& h) const;
|
||||
@@ -154,6 +167,8 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
void updateLists();
|
||||
bool initWebUi(QString username, QString password, int port);
|
||||
void pauseTorrent(QString hash);
|
||||
void on_actionIncreasePriority_triggered();
|
||||
void on_actionDecreasePriority_triggered();
|
||||
// Options slots
|
||||
void on_actionOptions_triggered();
|
||||
void OptionsSaved(QString info, bool deleteOptions);
|
||||
@@ -170,7 +185,8 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *);
|
||||
void hideEvent(QHideEvent *);
|
||||
bool event(QEvent * event);
|
||||
void displayRSSTab(bool enable);
|
||||
|
||||
public:
|
||||
// Construct / Destruct
|
||||
|
BIN
src/Icons/flags/czech.png
Normal file
After Width: | Height: | Size: 455 B |
BIN
src/Icons/flags/taiwan.png
Normal file
After Width: | Height: | Size: 333 B |
@@ -1,7 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Categories=Qt;Application;Network;P2P
|
||||
Comment=V1.1.0
|
||||
Exec=qbittorrent
|
||||
Categories=Qt;Network;P2P
|
||||
Comment=V1.2.0
|
||||
Exec=qbittorrent %f
|
||||
GenericName=Bittorrent client
|
||||
GenericName[bg]=Торент клиент
|
||||
GenericName[de]=Bittorren Client
|
||||
@@ -19,7 +19,7 @@ GenericName[tr]=Bittorrent istemcisi
|
||||
GenericName[uk]=Bittorrent-клієнт
|
||||
GenericName[zh]=Bittorrent之用户
|
||||
Icon=qbittorrent
|
||||
MimeType=application/x-bittorrent
|
||||
MimeType=application/x-bittorrent;
|
||||
Name=qBittorrent
|
||||
Name[ko]=큐비토런트
|
||||
Terminal=false
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.4 KiB |
BIN
src/Icons/skin/decrease.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 1.5 KiB |
BIN
src/Icons/skin/increase.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
src/Icons/skin/queued.png
Normal file
After Width: | Height: | Size: 493 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
@@ -41,6 +41,7 @@ SearchTab::SearchTab(SearchEngine *parent) : QWidget()
|
||||
box=new QVBoxLayout();
|
||||
results_lbl=new QLabel();
|
||||
resultsBrowser = new QTreeView();
|
||||
resultsBrowser->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
box->addWidget(results_lbl);
|
||||
box->addWidget(resultsBrowser);
|
||||
|
||||
@@ -185,4 +186,4 @@ bool SearchTab::loadColWidthSearchList(){
|
||||
}
|
||||
qDebug("Search list columns width loaded");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -56,13 +56,15 @@ class about : public QDialog, private Ui::AboutDlg{
|
||||
"<i>- <u>Brazilian:</u> Nick Marinho (nickmarinho@gmail.com)<br>\
|
||||
- <u>Bulgarian:</u> Tsvetan & Boiko Bankov (emerge_life@users.sourceforge.net)<br>\
|
||||
- <u>Catalan:</u> Gekko Dam Beer (gekko04@users.sourceforge.net)<br>\
|
||||
- <u>Chinese (Simplified):</u> Guo Yue (guoyue0418@hotmail.com)<br>\
|
||||
- <u>Chinese (Simplified):</u> Guo Yue (yue.guo0418@gmail.com)<br>\
|
||||
- <u>Chinese (Traditional):</u> Yi-Shun Wang (dnextstep@gmail.com)<br>\
|
||||
- <u>Czech:</u> Jirka Vilim (web@tets.cz)<br>\
|
||||
- <u>Danish:</u> Mathias Nielsen (comoneo@gmail.com)<br>\
|
||||
- <u>Dutch:</u> Joost Schipper (heavyjoost@users.sourceforge.net)<br>\
|
||||
- <u>Dutch:</u> Joost Schipper (heavyjoost@users.sourceforge.net) and Peter Koeleman (peter@peerweb.nl)<br>\
|
||||
- <u>Finnish:</u> Niklas Laxström (nikerabbit@users.sourceforge.net)<br>\
|
||||
- <u>German:</u> Niels Hoffmann (zentralmaschine@users.sourceforge.net)<br>\
|
||||
- <u>Greek:</u> Tsvetan Bankov (emerge_life@users.sourceforge.net)<br>\
|
||||
- <u>Hungarian:</u> Majoros Péter (majoros.j.p@t-online.hu)<br>\
|
||||
- <u>Hungarian:</u> Majoros Péter (majoros.peterj@gmail.com)<br>\
|
||||
- <u>Italian:</u> Mirko Ferrari (mirkoferrari@gmail.com) and Ferraro Luciano (luciano.ferraro@gmail.com)<br>\
|
||||
- <u>Japanese:</u> Nardog (nardog@e2umail.com)<br>\
|
||||
- <u>Korean:</u> Jin Woo Sin (jin828sin@users.sourceforge.net)<br>\
|
||||
@@ -70,9 +72,9 @@ class about : public QDialog, private Ui::AboutDlg{
|
||||
- <u>Polish:</u> Jarek Smieja (ajep9691@wp.pl)<br>\
|
||||
- <u>Portuguese:</u> Nick Marinho (nickmarinho@gmail.com)<br>\
|
||||
- <u>Romanian:</u> Obada Denis (obadadenis@users.sourceforge.net)<br>\
|
||||
- <u>Russian:</u> Nick Khazov (m2k3d0n at users.sourceforge.net)<br>\
|
||||
- <u>Russian:</u> Nick Khazov (m2k3d0n@users.sourceforge.net) and Alexey Morsov (samurai@ricom.ru)<br>\
|
||||
- <u>Slovak:</u> helix84<br>\
|
||||
- <u>Spanish:</u> Vicente Raul Plata Fonseca (silverxnt@users.sourceforge.net)<br>\
|
||||
- <u>Spanish:</u> Vicente Raul Plata Fonseca (silverxnt@users.sourceforge.net) and Gabriel de Oliveira (deadloop@hotmail.com)<br>\
|
||||
- <u>Swedish:</u> Daniel Nylander (po@danielnylander.se)<br>\
|
||||
- <u>Turkish:</u> Erdem Bingöl (erdem84@gmail.com)<br>\
|
||||
- <u>Ukrainian:</u> Andrey Shpachenko (masterfix@users.sourceforge.net)<br><br>"));
|
||||
|
@@ -234,7 +234,7 @@ class arborescence {
|
||||
void addFile(QString path, size_type file_size, int index, float progress=0., int priority=1) {
|
||||
Q_ASSERT(root->isDir());
|
||||
path = QDir::cleanPath(path);
|
||||
Q_ASSERT(path.startsWith(root->path()));
|
||||
//Q_ASSERT(path.startsWith(root->path()));
|
||||
QString relative_path = path.remove(0, root->path().size());
|
||||
if(relative_path.at(0) ==QDir::separator())
|
||||
relative_path.remove(0, 1);
|
||||
|
@@ -70,6 +70,15 @@ class bittorrent : public QObject{
|
||||
FilterParserThread *filterParser;
|
||||
QString filterPath;
|
||||
int folderScanInterval; // in seconds
|
||||
bool queueingEnabled;
|
||||
int maxActiveDownloads;
|
||||
int maxActiveTorrents;
|
||||
int currentActiveDownloads;
|
||||
QStringList *downloadQueue;
|
||||
QStringList *queuedDownloads;
|
||||
QStringList *uploadQueue;
|
||||
QStringList *queuedUploads;
|
||||
bool calculateETA;
|
||||
|
||||
protected:
|
||||
QString getSavePath(QString hash);
|
||||
@@ -97,6 +106,14 @@ class bittorrent : public QObject{
|
||||
bool has_filtered_files(QString hash) const;
|
||||
unsigned int getFinishedPausedTorrentsNb() const;
|
||||
unsigned int getUnfinishedPausedTorrentsNb() const;
|
||||
bool isQueueingEnabled() const;
|
||||
int getDlTorrentPriority(QString hash) const;
|
||||
int getUpTorrentPriority(QString hash) const;
|
||||
int getMaximumActiveDownloads() const;
|
||||
int getMaximumActiveTorrents() const;
|
||||
bool isDownloadQueued(QString hash) const;
|
||||
bool isUploadQueued(QString hash) const;
|
||||
int loadTorrentPriority(QString hash);
|
||||
|
||||
public slots:
|
||||
void addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
|
||||
@@ -116,6 +133,7 @@ class bittorrent : public QObject{
|
||||
void enablePeerExchange();
|
||||
void enableIPFilter(QString filter);
|
||||
void disableIPFilter();
|
||||
void setQueueingEnabled(bool enable);
|
||||
void resumeUnfinishedTorrents();
|
||||
void saveTorrentSpeedLimits(QString hash);
|
||||
void loadTorrentSpeedLimits(QString hash);
|
||||
@@ -123,6 +141,13 @@ class bittorrent : public QObject{
|
||||
void loadDownloadUploadForTorrent(QString hash);
|
||||
void handleDownloadFailure(QString url, QString reason);
|
||||
void loadWebSeeds(QString fileHash);
|
||||
void updateDownloadQueue();
|
||||
void updateUploadQueue();
|
||||
void increaseDlTorrentPriority(QString hash);
|
||||
void decreaseDlTorrentPriority(QString hash);
|
||||
void increaseUpTorrentPriority(QString hash);
|
||||
void decreaseUpTorrentPriority(QString hash);
|
||||
void saveTorrentPriority(QString hash, int prio);
|
||||
// Session configuration - Setters
|
||||
void setListeningPortsRange(std::pair<unsigned short, unsigned short> ports);
|
||||
void setMaxConnections(int maxConnec);
|
||||
@@ -149,6 +174,9 @@ class bittorrent : public QObject{
|
||||
bool enableDHT(bool b);
|
||||
void reloadTorrent(const QTorrentHandle &h, bool full_alloc);
|
||||
void setTimerScanInterval(int secs);
|
||||
void setMaxActiveDownloads(int val);
|
||||
void setMaxActiveTorrents(int val);
|
||||
void setETACalculation(bool enable);
|
||||
|
||||
protected slots:
|
||||
void scanDirectory();
|
||||
@@ -182,6 +210,10 @@ class bittorrent : public QObject{
|
||||
void torrent_ratio_deleted(QString fileName);
|
||||
void UPnPError(QString msg);
|
||||
void UPnPSuccess(QString msg);
|
||||
void updateFinishedTorrentNumber();
|
||||
void updateUnfinishedTorrentNumber();
|
||||
void forceUnfinishedListUpdate();
|
||||
void forceFinishedListUpdate();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -18,7 +18,16 @@
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin" >
|
||||
<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>
|
||||
@@ -63,14 +72,6 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="log_tab" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>765</width>
|
||||
<height>138</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="title" >
|
||||
<string>Log</string>
|
||||
</attribute>
|
||||
@@ -78,7 +79,16 @@
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin" >
|
||||
<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>
|
||||
@@ -103,14 +113,6 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="filter_tab" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>765</width>
|
||||
<height>138</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="title" >
|
||||
<string>IP filter</string>
|
||||
</attribute>
|
||||
@@ -118,7 +120,16 @@
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin" >
|
||||
<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>
|
||||
@@ -183,8 +194,7 @@
|
||||
</action>
|
||||
<action name="actionOpen_destination_folder" >
|
||||
<property name="icon" >
|
||||
<iconset resource="icons.qrc" >
|
||||
<normaloff>:/Icons/folder.png</normaloff>:/Icons/folder.png</iconset>
|
||||
<iconset resource="icons.qrc" >:/Icons/folder.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Open destination folder</string>
|
||||
@@ -232,15 +242,33 @@
|
||||
</action>
|
||||
<action name="actionBuy_it" >
|
||||
<property name="icon" >
|
||||
<iconset resource="icons.qrc" >
|
||||
<normaloff>:/Icons/money.png</normaloff>:/Icons/money.png</iconset>
|
||||
<iconset resource="icons.qrc" >:/Icons/money.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Buy it</string>
|
||||
</property>
|
||||
</action>
|
||||
<zorder>tabBottom</zorder>
|
||||
<zorder></zorder>
|
||||
<action name="actionHOSColPriority" >
|
||||
<property name="text" >
|
||||
<string>Priority</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionIncreasePriority" >
|
||||
<property name="icon" >
|
||||
<iconset resource="icons.qrc" >:/Icons/skin/increase.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Increase priority</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDecreasePriority" >
|
||||
<property name="icon" >
|
||||
<iconset resource="icons.qrc" >:/Icons/skin/decrease.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Decrease priority</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="icons.qrc" />
|
||||
|
@@ -24,6 +24,8 @@
|
||||
#include <QSettings>
|
||||
#include <stdio.h>
|
||||
|
||||
#define MAX_THREADS 3
|
||||
|
||||
// http://curl.rtin.bz/libcurl/c/libcurl-errors.html
|
||||
QString subDownloadThread::errorCodeToString(CURLcode status) {
|
||||
switch(status){
|
||||
@@ -150,9 +152,7 @@ downloadThread::~downloadThread(){
|
||||
|
||||
void downloadThread::downloadUrl(QString url){
|
||||
QMutexLocker locker(&mutex);
|
||||
if(downloading_list.contains(url)) return;
|
||||
url_list << url;
|
||||
downloading_list << url;
|
||||
urls_queue.enqueue(url);
|
||||
if(!isRunning()){
|
||||
start();
|
||||
}else{
|
||||
@@ -165,8 +165,8 @@ void downloadThread::run(){
|
||||
if(abort)
|
||||
return;
|
||||
mutex.lock();
|
||||
if(url_list.size() != 0){
|
||||
QString url = url_list.takeFirst();
|
||||
if(!urls_queue.empty() && subThreads.size() < MAX_THREADS){
|
||||
QString url = urls_queue.dequeue();
|
||||
mutex.unlock();
|
||||
subDownloadThread *st = new subDownloadThread(0, url);
|
||||
subThreads << st;
|
||||
@@ -187,9 +187,9 @@ void downloadThread::propagateDownloadedFile(subDownloadThread* st, QString url,
|
||||
delete st;
|
||||
emit downloadFinished(url, path);
|
||||
mutex.lock();
|
||||
index = downloading_list.indexOf(url);
|
||||
Q_ASSERT(index != -1);
|
||||
downloading_list.removeAt(index);
|
||||
if(!urls_queue.empty()) {
|
||||
condition.wakeOne();
|
||||
}
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
@@ -200,8 +200,8 @@ void downloadThread::propagateDownloadFailure(subDownloadThread* st, QString url
|
||||
delete st;
|
||||
emit downloadFailure(url, reason);
|
||||
mutex.lock();
|
||||
index = downloading_list.indexOf(url);
|
||||
Q_ASSERT(index != -1);
|
||||
downloading_list.removeAt(index);
|
||||
if(!urls_queue.empty()) {
|
||||
condition.wakeOne();
|
||||
}
|
||||
mutex.unlock();
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include <QWaitCondition>
|
||||
#include <QStringList>
|
||||
#include <curl/curl.h>
|
||||
#include <QQueue>
|
||||
|
||||
class subDownloadThread : public QThread {
|
||||
Q_OBJECT
|
||||
@@ -55,8 +56,7 @@ class downloadThread : public QThread {
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
QStringList url_list;
|
||||
QStringList downloading_list;
|
||||
QQueue<QString> urls_queue;
|
||||
QMutex mutex;
|
||||
QWaitCondition condition;
|
||||
bool abort;
|
||||
|
@@ -49,7 +49,7 @@ DownloadingTorrents::DownloadingTorrents(QObject *parent, bittorrent *BTSession)
|
||||
// tabBottom->setTabIcon(1, QIcon(QString::fromUtf8(":/Icons/filter.png")));
|
||||
|
||||
// Set Download list model
|
||||
DLListModel = new QStandardItemModel(0,9);
|
||||
DLListModel = new QStandardItemModel(0,10);
|
||||
DLListModel->setHeaderData(NAME, Qt::Horizontal, tr("Name", "i.e: file name"));
|
||||
DLListModel->setHeaderData(SIZE, Qt::Horizontal, tr("Size", "i.e: file size"));
|
||||
DLListModel->setHeaderData(PROGRESS, Qt::Horizontal, tr("Progress", "i.e: % downloaded"));
|
||||
@@ -58,9 +58,12 @@ DownloadingTorrents::DownloadingTorrents(QObject *parent, bittorrent *BTSession)
|
||||
DLListModel->setHeaderData(SEEDSLEECH, Qt::Horizontal, tr("Seeds/Leechs", "i.e: full/partial sources"));
|
||||
DLListModel->setHeaderData(RATIO, Qt::Horizontal, tr("Ratio"));
|
||||
DLListModel->setHeaderData(ETA, Qt::Horizontal, tr("ETA", "i.e: Estimated Time of Arrival / Time left"));
|
||||
DLListModel->setHeaderData(PRIORITY, Qt::Horizontal, tr("Priority"));
|
||||
downloadList->setModel(DLListModel);
|
||||
DLDelegate = new DLListDelegate(downloadList);
|
||||
downloadList->setItemDelegate(DLDelegate);
|
||||
// Hide priority column
|
||||
downloadList->hideColumn(PRIORITY);
|
||||
// Hide hash column
|
||||
downloadList->hideColumn(HASH);
|
||||
loadHiddenColumns();
|
||||
@@ -75,6 +78,7 @@ DownloadingTorrents::DownloadingTorrents(QObject *parent, bittorrent *BTSession)
|
||||
connect(BTSession, SIGNAL(urlSeedProblem(QString, QString)), this, SLOT(addUrlSeedError(QString, QString)));
|
||||
connect(BTSession, SIGNAL(UPnPError(QString)), this, SLOT(displayUPnPError(QString)));
|
||||
connect(BTSession, SIGNAL(UPnPSuccess(QString)), this, SLOT(displayUPnPSuccess(QString)));
|
||||
connect(BTSession, SIGNAL(forceUnfinishedListUpdate()), this, SLOT(updateDlList()));
|
||||
|
||||
// Load last columns width for download list
|
||||
if(!loadColWidthDLList()) {
|
||||
@@ -94,6 +98,8 @@ DownloadingTorrents::DownloadingTorrents(QObject *parent, bittorrent *BTSession)
|
||||
connect(actionPause, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionPause_triggered()));
|
||||
connect(actionStart, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionStart_triggered()));
|
||||
connect(actionDelete, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionDelete_triggered()));
|
||||
connect(actionIncreasePriority, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionIncreasePriority_triggered()));
|
||||
connect(actionDecreasePriority, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionDecreasePriority_triggered()));
|
||||
connect(actionPreview_file, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionPreview_file_triggered()));
|
||||
connect(actionDelete_Permanently, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionDelete_Permanently_triggered()));
|
||||
connect(actionOpen_destination_folder, SIGNAL(triggered()), (GUI*)parent, SLOT(openDestinationFolder()));
|
||||
@@ -108,6 +114,7 @@ DownloadingTorrents::DownloadingTorrents(QObject *parent, bittorrent *BTSession)
|
||||
connect(actionHOSColSeedersLeechers, SIGNAL(triggered()), this, SLOT(hideOrShowColumnSeedersLeechers()));
|
||||
connect(actionHOSColRatio, SIGNAL(triggered()), this, SLOT(hideOrShowColumnRatio()));
|
||||
connect(actionHOSColEta, SIGNAL(triggered()), this, SLOT(hideOrShowColumnEta()));
|
||||
connect(actionHOSColPriority, SIGNAL(triggered()), this, SLOT(hideOrShowColumnPriority()));
|
||||
|
||||
// Set info Bar infos
|
||||
setInfoBar(tr("qBittorrent %1 started.", "e.g: qBittorrent v0.x started.").arg(QString::fromUtf8(""VERSION)));
|
||||
@@ -121,6 +128,13 @@ DownloadingTorrents::~DownloadingTorrents() {
|
||||
delete DLListModel;
|
||||
}
|
||||
|
||||
void DownloadingTorrents::enablePriorityColumn(bool enable) {
|
||||
if(enable) {
|
||||
downloadList->showColumn(PRIORITY);
|
||||
} else {
|
||||
downloadList->hideColumn(PRIORITY);
|
||||
}
|
||||
}
|
||||
|
||||
void DownloadingTorrents::notifyTorrentDoubleClicked(const QModelIndex& index) {
|
||||
unsigned int row = index.row();
|
||||
@@ -307,11 +321,16 @@ void DownloadingTorrents::displayDLListMenu(const QPoint& pos) {
|
||||
myDLLlistMenu.addSeparator();
|
||||
myDLLlistMenu.addAction(actionOpen_destination_folder);
|
||||
myDLLlistMenu.addAction(actionTorrent_Properties);
|
||||
if(BTSession->isQueueingEnabled()) {
|
||||
myDLLlistMenu.addSeparator();
|
||||
myDLLlistMenu.addAction(actionIncreasePriority);
|
||||
myDLLlistMenu.addAction(actionDecreasePriority);
|
||||
}
|
||||
myDLLlistMenu.addSeparator();
|
||||
myDLLlistMenu.addAction(actionBuy_it);
|
||||
// Call menu
|
||||
// XXX: why mapToGlobal() is not enough?
|
||||
myDLLlistMenu.exec(mapToGlobal(pos)+QPoint(10,60));
|
||||
myDLLlistMenu.exec(mapToGlobal(pos)+QPoint(10,35));
|
||||
}
|
||||
|
||||
|
||||
@@ -323,11 +342,17 @@ void DownloadingTorrents::displayDLListMenu(const QPoint& pos) {
|
||||
void DownloadingTorrents::displayDLHoSMenu(const QPoint& pos){
|
||||
QMenu hideshowColumn(this);
|
||||
hideshowColumn.setTitle(tr("Hide or Show Column"));
|
||||
for(int i=0; i<=ETA; i++) {
|
||||
int lastCol;
|
||||
if(BTSession->isQueueingEnabled()) {
|
||||
lastCol = PRIORITY;
|
||||
} else {
|
||||
lastCol = ETA;
|
||||
}
|
||||
for(int i=0; i <= lastCol; ++i) {
|
||||
hideshowColumn.addAction(getActionHoSCol(i));
|
||||
}
|
||||
// Call menu
|
||||
hideshowColumn.exec(mapToGlobal(pos)+QPoint(10,55));
|
||||
hideshowColumn.exec(mapToGlobal(pos)+QPoint(10,10));
|
||||
}
|
||||
|
||||
// toggle hide/show a column
|
||||
@@ -347,11 +372,19 @@ void DownloadingTorrents::hideOrShowColumn(int index) {
|
||||
downloadList->setColumnHidden(index, true);
|
||||
getActionHoSCol(index)->setIcon(QIcon(QString::fromUtf8(":/Icons/button_cancel.png")));
|
||||
--nbVisibleColumns;
|
||||
if(index == ETA) {
|
||||
BTSession->setETACalculation(false);
|
||||
qDebug("Disable ETA calculation");
|
||||
}
|
||||
} else {
|
||||
// User want to display the column
|
||||
downloadList->setColumnHidden(index, false);
|
||||
getActionHoSCol(index)->setIcon(QIcon(QString::fromUtf8(":/Icons/button_ok.png")));
|
||||
++nbVisibleColumns;
|
||||
if(index == ETA) {
|
||||
BTSession->setETACalculation(true);
|
||||
qDebug("Enable ETA calculation");
|
||||
}
|
||||
}
|
||||
//resize all others non-hidden columns
|
||||
for(unsigned int i=0; i<nbCols; ++i) {
|
||||
@@ -361,6 +394,14 @@ void DownloadingTorrents::hideOrShowColumn(int index) {
|
||||
}
|
||||
}
|
||||
|
||||
void DownloadingTorrents::hidePriorityColumn(bool hide) {
|
||||
downloadList->setColumnHidden(PRIORITY, hide);
|
||||
if(hide)
|
||||
getActionHoSCol(PRIORITY)->setIcon(QIcon(QString::fromUtf8(":/Icons/button_cancel.png")));
|
||||
else
|
||||
getActionHoSCol(PRIORITY)->setIcon(QIcon(QString::fromUtf8(":/Icons/button_ok.png")));
|
||||
}
|
||||
|
||||
// save the hidden columns in settings
|
||||
void DownloadingTorrents::saveHiddenColumns() {
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
@@ -436,6 +477,9 @@ void DownloadingTorrents::hideOrShowColumnEta() {
|
||||
hideOrShowColumn(ETA);
|
||||
}
|
||||
|
||||
void DownloadingTorrents::hideOrShowColumnPriority() {
|
||||
hideOrShowColumn(PRIORITY);
|
||||
}
|
||||
|
||||
void DownloadingTorrents::on_actionClearLog_triggered() {
|
||||
infoBar->clear();
|
||||
@@ -468,6 +512,9 @@ QAction* DownloadingTorrents::getActionHoSCol(int index) {
|
||||
case ETA :
|
||||
return actionHOSColEta;
|
||||
break;
|
||||
case PRIORITY :
|
||||
return actionHOSColPriority;
|
||||
break;
|
||||
default :
|
||||
return NULL;
|
||||
}
|
||||
@@ -524,6 +571,17 @@ void DownloadingTorrents::updateDlList() {
|
||||
row = getRowFromHash(hash);
|
||||
}
|
||||
Q_ASSERT(row != -1);
|
||||
// Update Priority
|
||||
if(BTSession->isQueueingEnabled()) {
|
||||
DLListModel->setData(DLListModel->index(row, PRIORITY), QVariant((int)BTSession->getDlTorrentPriority(hash)));
|
||||
if(h.is_paused() && BTSession->isDownloadQueued(hash)) {
|
||||
DLListModel->setData(DLListModel->index(row, NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/queued.png"))), Qt::DecorationRole);
|
||||
if(!downloadList->isColumnHidden(ETA)) {
|
||||
DLListModel->setData(DLListModel->index(row, ETA), QVariant((qlonglong)-1));
|
||||
}
|
||||
setRowColor(row, QString::fromUtf8("grey"));
|
||||
}
|
||||
}
|
||||
// No need to update a paused torrent
|
||||
if(h.is_paused()) continue;
|
||||
if(BTSession->getTorrentsToPauseAfterChecking().indexOf(hash) != -1) {
|
||||
@@ -623,6 +681,7 @@ void DownloadingTorrents::addTorrent(QString hash) {
|
||||
}
|
||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||
int row = getRowFromHash(hash);
|
||||
qDebug("DL: addTorrent(): %s, row: %d", (const char*)hash.toUtf8(), row);
|
||||
if(row != -1) return;
|
||||
row = DLListModel->rowCount();
|
||||
// Adding torrent to download list
|
||||
@@ -633,6 +692,8 @@ void DownloadingTorrents::addTorrent(QString hash) {
|
||||
DLListModel->setData(DLListModel->index(row, UPSPEED), QVariant((double)0.));
|
||||
DLListModel->setData(DLListModel->index(row, SEEDSLEECH), QVariant(QString::fromUtf8("0/0")));
|
||||
DLListModel->setData(DLListModel->index(row, ETA), QVariant((qlonglong)-1));
|
||||
if(BTSession->isQueueingEnabled())
|
||||
DLListModel->setData(DLListModel->index(row, PRIORITY), QVariant((int)BTSession->getDlTorrentPriority(hash)));
|
||||
DLListModel->setData(DLListModel->index(row, HASH), QVariant(hash));
|
||||
// Pause torrent if it was paused last time
|
||||
if(BTSession->isPaused(hash)) {
|
||||
@@ -721,6 +782,7 @@ void DownloadingTorrents::sortDownloadList(int index, Qt::SortOrder startSortOrd
|
||||
case ETA:
|
||||
case UPSPEED:
|
||||
case DLSPEED:
|
||||
case PRIORITY:
|
||||
sortDownloadListFloat(index, sortOrder);
|
||||
break;
|
||||
case PROGRESS:
|
||||
@@ -808,6 +870,7 @@ void DownloadingTorrents::torrentAdded(QString path, QTorrentHandle& h, bool fas
|
||||
if(BTSession->isFinished(hash)) {
|
||||
return;
|
||||
}
|
||||
if(getRowFromHash(hash) != -1) return;
|
||||
int row = DLListModel->rowCount();
|
||||
// Adding torrent to download list
|
||||
DLListModel->insertRow(row);
|
||||
|
@@ -55,6 +55,7 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
|
||||
QString getHashFromRow(unsigned int row) const;
|
||||
QStringList getSelectedTorrents(bool only_one=false) const;
|
||||
unsigned int getNbTorrentsInList() const;
|
||||
void enablePriorityColumn(bool enable);
|
||||
|
||||
signals:
|
||||
void unfinishedTorrentsNumberChanged(unsigned int);
|
||||
@@ -92,6 +93,7 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
|
||||
void hideOrShowColumnSeedersLeechers();
|
||||
void hideOrShowColumnRatio();
|
||||
void hideOrShowColumnEta();
|
||||
void hideOrShowColumnPriority();
|
||||
void displayUPnPError(QString msg);
|
||||
void displayUPnPSuccess(QString msg);
|
||||
|
||||
@@ -106,6 +108,7 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
|
||||
void sortProgressColumnDelayed();
|
||||
void updateFileSizeAndProgress(QString hash);
|
||||
void showPropertiesFromHash(QString hash);
|
||||
void hidePriorityColumn(bool hide);
|
||||
|
||||
};
|
||||
|
||||
|