Compare commits
97 Commits
release-1.
...
release-1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd0d01d439 | ||
|
|
d358987316 | ||
|
|
6f28711f9e | ||
|
|
7b4b568859 | ||
|
|
c3aa2906bb | ||
|
|
9509bbaed4 | ||
|
|
b7c7245fb5 | ||
|
|
0153b03160 | ||
|
|
ca83fdecff | ||
|
|
bca898d8b6 | ||
|
|
c877c9c412 | ||
|
|
4dfd1f229b | ||
|
|
0d63f46035 | ||
|
|
106f7cdd32 | ||
|
|
0308825c11 | ||
|
|
8c21ef5c04 | ||
|
|
53c2fe4a60 | ||
|
|
64fef21a86 | ||
|
|
f6f4b5f219 | ||
|
|
f809b8a014 | ||
|
|
cf8dbf22f8 | ||
|
|
00d9f7c36b | ||
|
|
9a314db530 | ||
|
|
7db2ffc09f | ||
|
|
9a02c12ec9 | ||
|
|
2a77de686c | ||
|
|
a79b294885 | ||
|
|
13c670b96d | ||
|
|
65c4da6f0e | ||
|
|
bf9dc052d3 | ||
|
|
0ea6ee32be | ||
|
|
019bd476db | ||
|
|
baf5cb31af | ||
|
|
fc3c123f5b | ||
|
|
7dfdebd593 | ||
|
|
9835af4962 | ||
|
|
04cbd91f04 | ||
|
|
66db20cb47 | ||
|
|
2e0707bc0c | ||
|
|
e9c12cbf78 | ||
|
|
031de096f5 | ||
|
|
b85ed8ff38 | ||
|
|
00c5127ba1 | ||
|
|
714bf4f2ab | ||
|
|
c2244f746e | ||
|
|
8214d87ce5 | ||
|
|
e8454596ea | ||
|
|
1cc039c147 | ||
|
|
fe455970f1 | ||
|
|
36871a34ad | ||
|
|
4ea6ca75ca | ||
|
|
9e46c6c047 | ||
|
|
a2e9210665 | ||
|
|
aaf79add0b | ||
|
|
55743021e8 | ||
|
|
a8d627e1df | ||
|
|
eead11427f | ||
|
|
bec1388ba5 | ||
|
|
1542ff98bc | ||
|
|
0e9fd2dc3f | ||
|
|
cd618150b0 | ||
|
|
a2bcfa9192 | ||
|
|
1421f1450c | ||
|
|
288300d264 | ||
|
|
5e41a64c8b | ||
|
|
f4502367f3 | ||
|
|
273526b414 | ||
|
|
5b7b4b2cf3 | ||
|
|
ee99df0ba9 | ||
|
|
aec32db565 | ||
|
|
3894452840 | ||
|
|
54bfb7cda9 | ||
|
|
aa18f19ab7 | ||
|
|
3ae783e9cb | ||
|
|
83cac18690 | ||
|
|
3b09203937 | ||
|
|
a12621e1c0 | ||
|
|
60c3ccac7f | ||
|
|
1fbf7d42a1 | ||
|
|
4b73172105 | ||
|
|
ada5d2665b | ||
|
|
f1ca41a5c5 | ||
|
|
17e0700a52 | ||
|
|
cc77b2f578 | ||
|
|
85463e3910 | ||
|
|
7bd0dff802 | ||
|
|
4bc043146d | ||
|
|
fd78e0b5ce | ||
|
|
8565f1e61e | ||
|
|
4c6d6a35f3 | ||
|
|
fc79b7dc56 | ||
|
|
da11488ba1 | ||
|
|
968c3e1c3e | ||
|
|
68e30de763 | ||
|
|
573f00c66c | ||
|
|
ae81dbe088 | ||
|
|
2edbe66d91 |
5
AUTHORS
@@ -17,6 +17,11 @@ Images Authors:
|
||||
license: GPLv2
|
||||
url: http://ftp.acc.umu.se/pub/GNOME/sources/gnome-icon-theme
|
||||
|
||||
* files: src/oxygen/*.png
|
||||
copyright: Oxygen Icon Theme (KDE)
|
||||
license: LGPL
|
||||
url: http://www.oxygen-icons.org
|
||||
|
||||
* files: src/Icons/flags/*.png
|
||||
copyright: Open Clip Art Library
|
||||
license: Creative Commons Public Domain Dedication
|
||||
|
||||
14
COPYING
@@ -1,3 +1,17 @@
|
||||
qBittorrent is licensed under the GNU General Public License version 2 with the
|
||||
addition of the following special exception:
|
||||
|
||||
In addition, as a special exception, the copyright holders give permission to
|
||||
link this program with the OpenSSL project's "OpenSSL" library (or with
|
||||
modified versions of it that use the same license as the "OpenSSL" library),
|
||||
and distribute the linked executables. You must obey the GNU General Public
|
||||
License in all respects for all of the code used other than "OpenSSL". If you
|
||||
modify file(s), you may extend this exception to your version of the file(s),
|
||||
but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version.
|
||||
|
||||
----------
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
|
||||
48
Changelog
@@ -1,3 +1,51 @@
|
||||
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.4.0
|
||||
- FEATURE: Display swarm information in lists
|
||||
- FEATURE: Allow to define temporary download folder
|
||||
- FEATURE: Display total amount of uploaded data in finished list
|
||||
- FEATURE: Resizing a column in a search results tab affects all tabs
|
||||
- FEATURE: Search results tab columns are now remembered upon startup
|
||||
- FEATURE: Added right click menu in search engine to clear completion history
|
||||
- BUGFIX: Provide more helpful explanation when an I/O error occured
|
||||
- BUGFIX: Stop enforcing UTF-8 and use system locale instead
|
||||
- COSMETIC: Redesigned program preferences
|
||||
- COSMETIC: Updated icons set
|
||||
|
||||
* Sun Jul 12 2009 - Christophe DUMEZ <chris@qbittorrent.org> - v1.3.4
|
||||
- BUGFIX: Fixed IP filter file parsing on 64bits
|
||||
- BUGFIX: Suppressed QLayout: Attempting to add QLayout "" to properties "properties" warning message when opening a properties dialog
|
||||
- BUGFIX: Fixed a little bug in search engine plugins helper file
|
||||
- BUGFIX: Fixed compilation problems with Qt 4.3
|
||||
- BUGFIX: Percentages no longer disapear with default cleanlooks style
|
||||
- BUGFIX: Cleanly fixed popup menus position in lists (no more workarounds)
|
||||
- BUGFIX: Fixed memory leak in search engine
|
||||
- BUGFIX: Torrents with an infinite ratio are no longer affected by ratio_limit set in program preferences
|
||||
- BUGFIX: Display a ratio of 0.0 if total_upload and total_download are both 0
|
||||
- BUGFIX: Remove last separator in top tool bar
|
||||
- BUGFIX: Tuned lists properties to make sure display is correct
|
||||
- COSMETIC: Display date as well as time in log window
|
||||
|
||||
* Sun Apr 5 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.3.3
|
||||
- BUGFIX: Fixed Web UI torrent upload form
|
||||
- BUGFIX: Fixed unicode support in search engine
|
||||
- BUGFIX: Fixed search engine bug that prevented a torrent from appearing more than once among all tabs
|
||||
- LICENSE: Added an exception to the license regarding OpenSSL.
|
||||
- I18N: Updated Finnish translation
|
||||
|
||||
* Sat Mar 7 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.3.2
|
||||
- BUGFIX: Fix top toolbar disabling
|
||||
- BUGFIX: Fix building with Qt 4.5
|
||||
- BUGFIX: RSS items read status is now remembered upon restart
|
||||
|
||||
* Mon Jan 26 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.3.1
|
||||
- BUGFIX: Torrents paused due to an I/O error were displayed as queued
|
||||
- BUGFIX: qBittorrent now prints backtrace in terminal when segfaulting
|
||||
- BUGFIX: Fixed files progress display in torrent properties
|
||||
- BUGFIX: Improved torrent ratio calculation
|
||||
- BUGFIX: Fixed possible crash when parsing filter file
|
||||
- BUGFIX: Made some code optimization
|
||||
- BUGFIX: Fixed download/upload speed decrease problems
|
||||
- I18N: Updated Finnish, Bulgarian and Greek translations
|
||||
|
||||
* Fri Jan 9 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.3.0
|
||||
- FEATURE: Based on libtorrent-rasterbar v0.14.2
|
||||
- FEATURE: Improved ratio calculation system
|
||||
|
||||
9
TODO
@@ -1,5 +1,11 @@
|
||||
See https://blueprints.launchpad.net/qbittorrent/
|
||||
|
||||
// TODO in v1.4.0
|
||||
- Display peers information (disabled as a default)
|
||||
- Automatically move torrent to another directory on completion (disabled as a default)
|
||||
- Rework program preferences (make easier)
|
||||
- Provide better errors messages to make debugging easier
|
||||
|
||||
// translations done in v1.3.0
|
||||
- Romanian
|
||||
- Russian
|
||||
@@ -16,3 +22,6 @@ See https://blueprints.launchpad.net/qbittorrent/
|
||||
- Korean
|
||||
- Portuguese
|
||||
- Brazilian
|
||||
- Greek
|
||||
- Bulgarian
|
||||
- Finnish
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
-----BEGIN QCMOD-----
|
||||
name: libcommoncpp2
|
||||
arg: with-libcommoncpp2-inc=[path], Path to libcommoncpp2 include files
|
||||
arg: with-libcommoncpp2-lib=[path], Path to libcommoncpp2 library files
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
class qc_libcommoncpp2 : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_libcommoncpp2(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "GNU Common C++ library (libcommoncpp2)"; }
|
||||
QString shortname() const { return "libcommoncpp2"; }
|
||||
bool exec(){
|
||||
QString s;
|
||||
s = conf->getenv("QC_WITH_LIBCOMMONCPP2_INC");
|
||||
if(!s.isEmpty()) {
|
||||
if(!conf->checkHeader(s, "cc++/url.h")) {
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
QStringList sl;
|
||||
sl << "/usr/include";
|
||||
sl << "/usr/local/include";
|
||||
bool found = false;
|
||||
foreach(s, sl){
|
||||
if(conf->checkHeader(s, "cc++/url.h")){
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!found) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
conf->addIncludePath(s);
|
||||
|
||||
s = conf->getenv("QC_WITH_LIBCOMMONCPP2_LIB");
|
||||
if(!s.isEmpty()) {
|
||||
if(!QFile::exists(s+QString("/libccext2.so")))
|
||||
return false;
|
||||
if(!QFile::exists(s+QString("/libccgnu2.so")))
|
||||
return false;
|
||||
conf->addLib(QString("-L") + s);
|
||||
}else{
|
||||
QStringList sl;
|
||||
sl << "/usr/lib/";
|
||||
sl << "/usr/lib64/";
|
||||
sl << "/usr/local/lib/";
|
||||
sl << "/usr/local/lib64/";
|
||||
bool found = false;
|
||||
foreach(s, sl){
|
||||
if(QFile::exists(s+QString("libccext2.so"))){
|
||||
if(QFile::exists(s+QString("libccgnu2.so"))){
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!found) return false;
|
||||
conf->addLib(QString("-L") + s);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -6,6 +6,7 @@ arg: with-libtorrent-lib=[path], Path to libtorrent-rasterbar library files
|
||||
arg: with-libtorrent-static-lib=[path], Path to libtorrent-rasterbar .a file
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
// see Conf::findPkgConfig
|
||||
class qc_libtorrent_rasterbar : public ConfObj
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -16,6 +16,15 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
||||
* and distribute the linked executables. You must obey the GNU General Public
|
||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*
|
||||
* Contact : chris@qbittorrent.org
|
||||
*/
|
||||
|
||||
@@ -72,7 +81,10 @@ class DLListDelegate: public QItemDelegate {
|
||||
case RATIO:{
|
||||
QItemDelegate::drawBackground(painter, opt, index);
|
||||
double ratio = index.data().toDouble();
|
||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString(QByteArray::number(ratio, 'f', 1)));
|
||||
if(ratio > 100.)
|
||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::fromUtf8("∞"));
|
||||
else
|
||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString(QByteArray::number(ratio, 'f', 1)));
|
||||
break;
|
||||
}
|
||||
case PROGRESS:{
|
||||
|
||||
@@ -16,6 +16,15 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
||||
* and distribute the linked executables. You must obey the GNU General Public
|
||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*
|
||||
* Contact : chris@qbittorrent.org
|
||||
*/
|
||||
|
||||
@@ -35,9 +44,13 @@
|
||||
#define F_NAME 0
|
||||
#define F_SIZE 1
|
||||
#define F_UPSPEED 2
|
||||
#define F_LEECH 3
|
||||
#define F_RATIO 4
|
||||
#define F_HASH 5
|
||||
#define F_SWARM 3
|
||||
#define F_PEERS 4
|
||||
#define F_UPLOAD 5
|
||||
#define F_RATIO 6
|
||||
#define F_HASH 7
|
||||
|
||||
#define MAX_RATIO 100.
|
||||
|
||||
class FinishedListDelegate: public QItemDelegate {
|
||||
Q_OBJECT
|
||||
@@ -51,6 +64,7 @@ class FinishedListDelegate: public QItemDelegate {
|
||||
QStyleOptionViewItemV2 opt = QItemDelegate::setOptions(index, option);
|
||||
switch(index.column()){
|
||||
case F_SIZE:
|
||||
case F_UPLOAD:
|
||||
QItemDelegate::drawBackground(painter, opt, index);
|
||||
QItemDelegate::drawDisplay(painter, opt, option.rect, misc::friendlyUnit(index.data().toLongLong()));
|
||||
break;
|
||||
@@ -63,7 +77,10 @@ class FinishedListDelegate: public QItemDelegate {
|
||||
case F_RATIO:{
|
||||
QItemDelegate::drawBackground(painter, opt, index);
|
||||
double ratio = index.data().toDouble();
|
||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString(QByteArray::number(ratio, 'f', 1)));
|
||||
if(ratio > MAX_RATIO)
|
||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::fromUtf8("∞"));
|
||||
else
|
||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString(QByteArray::number(ratio, 'f', 1)));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -16,6 +16,15 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
||||
* and distribute the linked executables. You must obey the GNU General Public
|
||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*
|
||||
* Contact : chris@qbittorrent.org
|
||||
*/
|
||||
#include "FinishedTorrents.h"
|
||||
@@ -37,13 +46,17 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
|
||||
setupUi(this);
|
||||
actionStart->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/play.png")));
|
||||
actionPause->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/pause.png")));
|
||||
finishedListModel = new QStandardItemModel(0,6);
|
||||
finishedListModel = new QStandardItemModel(0,8);
|
||||
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_SWARM, Qt::Horizontal, tr("Seeds / Leechers"));
|
||||
finishedListModel->setHeaderData(F_PEERS, Qt::Horizontal, tr("Connected peers"));
|
||||
finishedListModel->setHeaderData(F_UPLOAD, Qt::Horizontal, tr("Total uploaded", "i.e: Total amount of uploaded data"));
|
||||
finishedListModel->setHeaderData(F_RATIO, Qt::Horizontal, tr("Ratio"));
|
||||
finishedList->setModel(finishedListModel);
|
||||
finishedList->setRootIsDecorated(false);
|
||||
finishedList->setAllColumnsShowFocus(true);
|
||||
loadHiddenColumns();
|
||||
// Hide hash column
|
||||
finishedList->hideColumn(F_HASH);
|
||||
@@ -79,7 +92,9 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
|
||||
connect(actionHOSColName, SIGNAL(triggered()), this, SLOT(hideOrShowColumnName()));
|
||||
connect(actionHOSColSize, SIGNAL(triggered()), this, SLOT(hideOrShowColumnSize()));
|
||||
connect(actionHOSColUpSpeed, SIGNAL(triggered()), this, SLOT(hideOrShowColumnUpSpeed()));
|
||||
connect(actionHOSColLeechers, SIGNAL(triggered()), this, SLOT(hideOrShowColumnLeechers()));
|
||||
connect(actionHOSColSwarm, SIGNAL(triggered()), this, SLOT(hideOrShowColumnSwarm()));
|
||||
connect(actionHOSColPeers, SIGNAL(triggered()), this, SLOT(hideOrShowColumnPeers()));
|
||||
connect(actionHOSColUpload, SIGNAL(triggered()), this, SLOT(hideOrShowColumnUpload()));
|
||||
connect(actionHOSColRatio, SIGNAL(triggered()), this, SLOT(hideOrShowColumnRatio()));
|
||||
}
|
||||
|
||||
@@ -106,7 +121,9 @@ void FinishedTorrents::addTorrent(QString hash){
|
||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(h.name()));
|
||||
finishedListModel->setData(finishedListModel->index(row, F_SIZE), QVariant((qlonglong)h.actual_size()));
|
||||
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_SWARM), QVariant("-1/-1"));
|
||||
finishedListModel->setData(finishedListModel->index(row, F_PEERS), QVariant("0"));
|
||||
finishedListModel->setData(finishedListModel->index(row, F_UPLOAD), QVariant((qlonglong)h.all_time_upload()));
|
||||
finishedListModel->setData(finishedListModel->index(row, F_RATIO), QVariant(QString::fromUtf8(misc::toString(BTSession->getRealRatio(hash)).c_str())));
|
||||
finishedListModel->setData(finishedListModel->index(row, F_HASH), QVariant(hash));
|
||||
if(h.is_paused()) {
|
||||
@@ -133,9 +150,8 @@ void FinishedTorrents::setRowColor(int row, QString color){
|
||||
|
||||
QStringList FinishedTorrents::getSelectedTorrents(bool only_one) const{
|
||||
QStringList res;
|
||||
QModelIndex index;
|
||||
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
||||
foreach(index, selectedIndexes) {
|
||||
foreach(const QModelIndex &index, selectedIndexes) {
|
||||
if(index.column() == F_NAME) {
|
||||
// Get the file hash
|
||||
QString hash = finishedListModel->data(finishedListModel->index(index.row(), F_HASH)).toString();
|
||||
@@ -200,7 +216,7 @@ void FinishedTorrents::saveColWidthFinishedList() const{
|
||||
width_list = line.split(' ');
|
||||
}
|
||||
for(short i=0; i<nbColumns; ++i){
|
||||
if(finishedList->columnWidth(i)<1 && width_list.size() == finishedListModel->columnCount()-1 && width_list.at(i).toInt()>=1) {
|
||||
if(finishedList->columnWidth(i)<1 && width_list.size() == nbColumns && width_list.at(i).toInt()>=1) {
|
||||
// load the former width
|
||||
new_width_list << width_list.at(i);
|
||||
} else if(finishedList->columnWidth(i)>=1) {
|
||||
@@ -218,9 +234,8 @@ void FinishedTorrents::saveColWidthFinishedList() const{
|
||||
|
||||
void FinishedTorrents::on_actionSet_upload_limit_triggered(){
|
||||
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
||||
QModelIndex index;
|
||||
QStringList hashes;
|
||||
foreach(index, selectedIndexes){
|
||||
foreach(const QModelIndex &index, selectedIndexes){
|
||||
if(index.column() == F_NAME){
|
||||
// Get the file hash
|
||||
hashes << finishedListModel->data(finishedListModel->index(index.row(), F_HASH)).toString();
|
||||
@@ -238,22 +253,25 @@ void FinishedTorrents::updateTorrent(QTorrentHandle h) {
|
||||
row = getRowFromHash(hash);
|
||||
}
|
||||
Q_ASSERT(row != -1);
|
||||
if(!finishedList->isColumnHidden(F_SWARM)) {
|
||||
finishedListModel->setData(finishedListModel->index(row, F_SWARM), misc::toQString(h.num_complete())+QString("/")+misc::toQString(h.num_incomplete()));
|
||||
}
|
||||
if(h.is_paused()) return;
|
||||
// Update queued torrent
|
||||
if(BTSession->isQueueingEnabled() && h.is_queued()) {
|
||||
if(h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking){
|
||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/time.png"))), Qt::DecorationRole);
|
||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/oxygen/time.png"))), Qt::DecorationRole);
|
||||
} else {
|
||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/queued.png"))), Qt::DecorationRole);
|
||||
}
|
||||
// Reset upload speed and seeds/leech
|
||||
finishedListModel->setData(finishedListModel->index(row, F_UPSPEED), 0.);
|
||||
finishedListModel->setData(finishedListModel->index(row, F_LEECH), "0");
|
||||
finishedListModel->setData(finishedListModel->index(row, F_PEERS), "0");
|
||||
setRowColor(row, QString::fromUtf8("grey"));
|
||||
return;
|
||||
}
|
||||
if(h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking){
|
||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/time.png"))), Qt::DecorationRole);
|
||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/oxygen/time.png"))), Qt::DecorationRole);
|
||||
setRowColor(row, QString::fromUtf8("grey"));
|
||||
return;
|
||||
}
|
||||
@@ -262,8 +280,11 @@ void FinishedTorrents::updateTorrent(QTorrentHandle h) {
|
||||
if(!finishedList->isColumnHidden(F_UPSPEED)) {
|
||||
finishedListModel->setData(finishedListModel->index(row, F_UPSPEED), QVariant((double)h.upload_payload_rate()));
|
||||
}
|
||||
if(!finishedList->isColumnHidden(F_LEECH)) {
|
||||
finishedListModel->setData(finishedListModel->index(row, F_LEECH), misc::toQString(h.num_peers() - h.num_seeds(), true));
|
||||
if(!finishedList->isColumnHidden(F_PEERS)) {
|
||||
finishedListModel->setData(finishedListModel->index(row, F_PEERS), misc::toQString(h.num_peers() - h.num_seeds(), true));
|
||||
}
|
||||
if(!finishedList->isColumnHidden(F_UPLOAD)) {
|
||||
finishedListModel->setData(finishedListModel->index(row, F_UPLOAD), QVariant((double)h.all_time_upload()));
|
||||
}
|
||||
if(!finishedList->isColumnHidden(F_RATIO)) {
|
||||
finishedListModel->setData(finishedListModel->index(row, F_RATIO), QVariant(misc::toQString(BTSession->getRealRatio(hash))));
|
||||
@@ -287,7 +308,7 @@ void FinishedTorrents::pauseTorrent(QString hash) {
|
||||
return;
|
||||
finishedListModel->setData(finishedListModel->index(row, F_UPSPEED), QVariant((double)0.0));
|
||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QIcon(QString::fromUtf8(":/Icons/skin/paused.png")), Qt::DecorationRole);
|
||||
finishedListModel->setData(finishedListModel->index(row, F_LEECH), QVariant(QString::fromUtf8("0")));
|
||||
finishedListModel->setData(finishedListModel->index(row, F_PEERS), QVariant(QString::fromUtf8("0")));
|
||||
setRowColor(row, QString::fromUtf8("red"));
|
||||
}
|
||||
|
||||
@@ -330,8 +351,7 @@ void FinishedTorrents::updateFileSize(QString hash){
|
||||
// display properties of selected items
|
||||
void FinishedTorrents::propertiesSelection(){
|
||||
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
||||
QModelIndex index;
|
||||
foreach(index, selectedIndexes){
|
||||
foreach(const QModelIndex &index, selectedIndexes){
|
||||
if(index.column() == F_NAME){
|
||||
showProperties(index);
|
||||
}
|
||||
@@ -340,23 +360,22 @@ void FinishedTorrents::propertiesSelection(){
|
||||
|
||||
void FinishedTorrents::forceRecheck(){
|
||||
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
||||
QModelIndex index;
|
||||
foreach(index, selectedIndexes){
|
||||
foreach(const QModelIndex &index, selectedIndexes){
|
||||
if(index.column() == F_NAME){
|
||||
QString hash = finishedListModel->data(finishedListModel->index(index.row(), F_HASH)).toString();
|
||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||
qDebug("Forcing recheck for torrent %s", hash.toLocal8Bit().data());
|
||||
h.force_recheck();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){
|
||||
void FinishedTorrents::displayFinishedListMenu(const QPoint&){
|
||||
QMenu myFinishedListMenu(this);
|
||||
QModelIndex index;
|
||||
// Enable/disable pause/start action given the DL state
|
||||
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
||||
bool has_pause = false, has_start = false, has_preview = false;
|
||||
foreach(index, selectedIndexes) {
|
||||
foreach(const QModelIndex &index, selectedIndexes) {
|
||||
if(index.column() == F_NAME) {
|
||||
// Get the file name
|
||||
QString hash = finishedListModel->data(finishedListModel->index(index.row(), F_HASH)).toString();
|
||||
@@ -395,8 +414,7 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){
|
||||
myFinishedListMenu.addAction(actionBuy_it);
|
||||
|
||||
// Call menu
|
||||
// XXX: why mapToGlobal() is not enough?
|
||||
myFinishedListMenu.exec(mapToGlobal(pos)+QPoint(10,58));
|
||||
myFinishedListMenu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
|
||||
@@ -431,12 +449,12 @@ void FinishedTorrents::hideOrShowColumn(int index) {
|
||||
if(nbVisibleColumns <= 1) return;
|
||||
// User can hide the column, do it.
|
||||
finishedList->setColumnHidden(index, true);
|
||||
getActionHoSCol(index)->setIcon(QIcon(QString::fromUtf8(":/Icons/button_cancel.png")));
|
||||
getActionHoSCol(index)->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/button_cancel.png")));
|
||||
--nbVisibleColumns;
|
||||
} else {
|
||||
// User want to display the column
|
||||
finishedList->setColumnHidden(index, false);
|
||||
getActionHoSCol(index)->setIcon(QIcon(QString::fromUtf8(":/Icons/button_ok.png")));
|
||||
getActionHoSCol(index)->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/button_ok.png")));
|
||||
++nbVisibleColumns;
|
||||
}
|
||||
//resize all others non-hidden columns
|
||||
@@ -459,8 +477,16 @@ void FinishedTorrents::hideOrShowColumnUpSpeed() {
|
||||
hideOrShowColumn(F_UPSPEED);
|
||||
}
|
||||
|
||||
void FinishedTorrents::hideOrShowColumnLeechers() {
|
||||
hideOrShowColumn(F_LEECH);
|
||||
void FinishedTorrents::hideOrShowColumnSwarm() {
|
||||
hideOrShowColumn(F_SWARM);
|
||||
}
|
||||
|
||||
void FinishedTorrents::hideOrShowColumnPeers() {
|
||||
hideOrShowColumn(F_PEERS);
|
||||
}
|
||||
|
||||
void FinishedTorrents::hideOrShowColumnUpload() {
|
||||
hideOrShowColumn(F_UPLOAD);
|
||||
}
|
||||
|
||||
void FinishedTorrents::hideOrShowColumnRatio() {
|
||||
@@ -486,9 +512,9 @@ bool FinishedTorrents::loadHiddenColumns() {
|
||||
for(int i=0; i<finishedListModel->columnCount()-1; i++) {
|
||||
if(loaded && ishidden_list.at(i) == "0") {
|
||||
finishedList->setColumnHidden(i, true);
|
||||
getActionHoSCol(i)->setIcon(QIcon(QString::fromUtf8(":/Icons/button_cancel.png")));
|
||||
getActionHoSCol(i)->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/button_cancel.png")));
|
||||
} else {
|
||||
getActionHoSCol(i)->setIcon(QIcon(QString::fromUtf8(":/Icons/button_ok.png")));
|
||||
getActionHoSCol(i)->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/button_ok.png")));
|
||||
}
|
||||
}
|
||||
return loaded;
|
||||
@@ -522,8 +548,14 @@ QAction* FinishedTorrents::getActionHoSCol(int index) {
|
||||
case F_UPSPEED :
|
||||
return actionHOSColUpSpeed;
|
||||
break;
|
||||
case F_LEECH :
|
||||
return actionHOSColLeechers;
|
||||
case F_SWARM :
|
||||
return actionHOSColSwarm;
|
||||
break;
|
||||
case F_PEERS :
|
||||
return actionHOSColPeers;
|
||||
break;
|
||||
case F_UPLOAD :
|
||||
return actionHOSColUpload;
|
||||
break;
|
||||
case F_RATIO :
|
||||
return actionHOSColRatio;
|
||||
@@ -547,6 +579,7 @@ void FinishedTorrents::toggleFinishedListSortOrder(int index) {
|
||||
case F_SIZE:
|
||||
case F_UPSPEED:
|
||||
case F_RATIO:
|
||||
case F_UPLOAD:
|
||||
sortFinishedListFloat(index, sortOrder);
|
||||
break;
|
||||
default:
|
||||
@@ -571,6 +604,8 @@ void FinishedTorrents::sortFinishedList(int index, Qt::SortOrder sortOrder){
|
||||
switch(index) {
|
||||
case F_SIZE:
|
||||
case F_UPSPEED:
|
||||
case F_UPLOAD:
|
||||
case F_RATIO:
|
||||
sortFinishedListFloat(index, sortOrder);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -16,6 +16,15 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
||||
* and distribute the linked executables. You must obey the GNU General Public
|
||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*
|
||||
* Contact : chris@qbittorrent.org
|
||||
*/
|
||||
|
||||
@@ -70,7 +79,9 @@ class FinishedTorrents : public QWidget, public Ui::seeding {
|
||||
void hideOrShowColumnName();
|
||||
void hideOrShowColumnSize();
|
||||
void hideOrShowColumnUpSpeed();
|
||||
void hideOrShowColumnLeechers();
|
||||
void hideOrShowColumnSwarm();
|
||||
void hideOrShowColumnPeers();
|
||||
void hideOrShowColumnUpload();
|
||||
void hideOrShowColumnRatio();
|
||||
void forceRecheck();
|
||||
|
||||
|
||||
108
src/GUI.cpp
13
src/GUI.h
@@ -16,6 +16,15 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
||||
* and distribute the linked executables. You must obey the GNU General Public
|
||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*
|
||||
* Contact : chris@qbittorrent.org
|
||||
*/
|
||||
|
||||
@@ -61,6 +70,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
// Bittorrent
|
||||
bittorrent *BTSession;
|
||||
QTimer *checkConnect;
|
||||
QTimer *scrapeTimer;
|
||||
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers;
|
||||
// GUI related
|
||||
QTabWidget *tabs;
|
||||
@@ -130,7 +140,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
void createTrayIcon();
|
||||
void updateUnfinishedTorrentNumber(unsigned int nb);
|
||||
void updateFinishedTorrentNumber(unsigned int nb);
|
||||
void fullDiskError(QTorrentHandle& h) const;
|
||||
void fullDiskError(QTorrentHandle& h, QString msg) const;
|
||||
void handleDownloadFromUrlFailure(QString, QString) const;
|
||||
void createSystrayDelayed();
|
||||
// Keyboard shortcuts
|
||||
@@ -168,6 +178,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
bool initWebUi(QString username, QString password, int port);
|
||||
void on_actionIncreasePriority_triggered();
|
||||
void on_actionDecreasePriority_triggered();
|
||||
void scrapeTrackers();
|
||||
// Options slots
|
||||
void on_actionOptions_triggered();
|
||||
void OptionsSaved(bool deleteOptions);
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 820 B |
|
Before Width: | Height: | Size: 821 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 998 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 846 B |
|
Before Width: | Height: | Size: 532 B |
BIN
src/Icons/oxygen/browse.png
Normal file
|
After Width: | Height: | Size: 796 B |
BIN
src/Icons/oxygen/bt_settings.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
src/Icons/oxygen/bug.png
Normal file
|
After Width: | Height: | Size: 733 B |
BIN
src/Icons/oxygen/button_cancel.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/Icons/oxygen/button_ok.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/Icons/oxygen/configure.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/Icons/oxygen/connection.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/Icons/oxygen/download.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |