Compare commits
44 Commits
release-1.
...
release-1.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2b2026e83f | ||
![]() |
9b712718bd | ||
![]() |
dfe6854619 | ||
![]() |
c871d3642c | ||
![]() |
fcdc85453a | ||
![]() |
51c14e39cd | ||
![]() |
28626f51ad | ||
![]() |
25233295ba | ||
![]() |
bd6684405b | ||
![]() |
a8235dc413 | ||
![]() |
c2838d9b0c | ||
![]() |
d6d7797064 | ||
![]() |
685216505c | ||
![]() |
c28c55280d | ||
![]() |
f1032c4619 | ||
![]() |
d34bfd13b3 | ||
![]() |
cfd6a9d734 | ||
![]() |
c2f22d292a | ||
![]() |
9778112b3b | ||
![]() |
1708361bd5 | ||
![]() |
cc04f7eec2 | ||
![]() |
395805f9e8 | ||
![]() |
ba5daee92f | ||
![]() |
bfef2b5cc0 | ||
![]() |
af2431afbd | ||
![]() |
7a1b92e467 | ||
![]() |
dc399e9ed9 | ||
![]() |
dad79d2cc8 | ||
![]() |
b5d30d5154 | ||
![]() |
72df85749b | ||
![]() |
6c84288b09 | ||
![]() |
78239d6956 | ||
![]() |
41be514dcf | ||
![]() |
855b539843 | ||
![]() |
2e72ab4973 | ||
![]() |
ae2ad8e747 | ||
![]() |
42fa5ef8f3 | ||
![]() |
9395f7316d | ||
![]() |
fa1c4050ed | ||
![]() |
565b98a94a | ||
![]() |
f58efdfefc | ||
![]() |
a806c27f70 | ||
![]() |
a8f82d9e12 | ||
![]() |
fe6054307e |
2
AUTHORS
@@ -47,6 +47,8 @@ Translations authors:
|
||||
- Bulgarian: Tsvetan & Boiko Bankov (emerge_life@users.sourceforge.net)
|
||||
- Catalan: Gekko Dam Beer (gekko04@users.sourceforge.net)
|
||||
- Chinese (Simplified): Guo Yue (guoyue0418@hotmail.com)
|
||||
- Chinese (Traditional): Yi-Shun Wang (dnextstep@gmail.com)
|
||||
- Czech: Jirka Vilim (web@tets.cz)
|
||||
- Danish: Mathias Nielsen (comoneo@gmail.com)
|
||||
- Dutch: Joost Schipper (heavyjoost@users.sourceforge.net)
|
||||
- English: Christophe Dumez (chris@qbittorrent.org)
|
||||
|
22
Changelog
@@ -1,14 +1,14 @@
|
||||
* 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
|
||||
* Sun Sept 14 2008 - Christophe Dumez <chris@qbittorrent.org> - v1.1.4
|
||||
- FEATURE: DHT is no longer used as fallback only
|
||||
- FEATURE: Ported WebUI to Mootools v1.2
|
||||
- BUGFIX: Fixed 'start seeding after torrent creation' feature
|
||||
- BUGFIX: Fixed compilation with boost v1.36
|
||||
- BUGFIX: Some code optimization
|
||||
- BUGFIX: Fixed memory leak in Web UI
|
||||
- BUGFIX: Fixed problems with column sorting
|
||||
- BUGFIX: Improved code for pausing torrents on startup
|
||||
- BUGFIX: Torrent addition dialog is now disabled for downloads from WebUI
|
||||
- BUGFIX: Give focus to input field in WebUI download dialog
|
||||
|
||||
* Tue Aug 26 2008 - Christophe Dumez <chris@qbittorrent.org> - v1.1.3
|
||||
- BUGFIX: Fixed ratio saving for seeding torrents
|
||||
|
1
INSTALL
@@ -18,7 +18,6 @@ Dependencies:
|
||||
Qt >= 4.4.0 is advised
|
||||
|
||||
- libtorrent-rasterbar by Arvid Norberg (>= v0.13.1 REQUIRED)
|
||||
-> http://www.qbittorrent.org/download.php (advised)
|
||||
-> http://www.libtorrent.net
|
||||
Be careful: another library (the one used by rTorrent) uses a similar name.
|
||||
|
||||
|
22
TODO
@@ -1,4 +1,22 @@
|
||||
See https://blueprints.launchpad.net/qbittorrent/
|
||||
|
||||
// in v1.2.0
|
||||
- Split download and uploads in Web UI (Ishan Ahora)
|
||||
Translations updated in v1.1.0:
|
||||
- French
|
||||
- Chinese
|
||||
- Polish
|
||||
- Portuguese
|
||||
- Brazilian
|
||||
- Slovak
|
||||
- Swedish
|
||||
- Romanian
|
||||
- Finnish
|
||||
- Italian
|
||||
- Turkish
|
||||
- Korean
|
||||
- Hungarian
|
||||
- German
|
||||
- Spanish
|
||||
- Russian
|
||||
- Dutch
|
||||
- Bulgarian
|
||||
- Greek
|
||||
|
@@ -40,8 +40,7 @@
|
||||
#define SEEDSLEECH 5
|
||||
#define RATIO 6
|
||||
#define ETA 7
|
||||
#define PRIORITY 8
|
||||
#define HASH 9
|
||||
#define HASH 8
|
||||
|
||||
class DLListDelegate: public QItemDelegate {
|
||||
Q_OBJECT
|
||||
|
@@ -37,8 +37,7 @@
|
||||
#define F_UPSPEED 2
|
||||
#define F_LEECH 3
|
||||
#define F_RATIO 4
|
||||
#define F_PRIORITY 5
|
||||
#define F_HASH 6
|
||||
#define F_HASH 5
|
||||
|
||||
class FinishedListDelegate: public QItemDelegate {
|
||||
Q_OBJECT
|
||||
|
@@ -38,17 +38,14 @@ 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,7);
|
||||
finishedListModel = new QStandardItemModel(0,6);
|
||||
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
|
||||
@@ -58,14 +55,14 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
|
||||
// Make download list header clickable for sorting
|
||||
finishedList->header()->setClickable(true);
|
||||
finishedList->header()->setSortIndicatorShown(true);
|
||||
connect(finishedList->header(), SIGNAL(sectionPressed(int)), this, SLOT(sortFinishedList(int)));
|
||||
connect(finishedList->header(), SIGNAL(sectionPressed(int)), this, SLOT(toggleFinishedListSortOrder(int)));
|
||||
finishedListDelegate = new FinishedListDelegate(finishedList);
|
||||
finishedList->setItemDelegate(finishedListDelegate);
|
||||
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")));
|
||||
@@ -74,8 +71,6 @@ 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()));
|
||||
@@ -87,7 +82,6 @@ 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(){
|
||||
@@ -103,14 +97,6 @@ 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);
|
||||
@@ -126,8 +112,6 @@ 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);
|
||||
@@ -139,6 +123,7 @@ void FinishedTorrents::addTorrent(QString hash){
|
||||
// Update the number of finished torrents
|
||||
++nbFinished;
|
||||
emit finishedTorrentsNumberChanged(nbFinished);
|
||||
sortFinishedList();
|
||||
}
|
||||
|
||||
void FinishedTorrents::torrentAdded(QString, QTorrentHandle& h, bool) {
|
||||
@@ -190,10 +175,27 @@ bool FinishedTorrents::loadColWidthFinishedList(){
|
||||
for(unsigned int i=0; i<listSize; ++i){
|
||||
finishedList->header()->resizeSection(i, width_list.at(i).toInt());
|
||||
}
|
||||
loadLastSortedColumn();
|
||||
qDebug("Finished list columns width loaded");
|
||||
return true;
|
||||
}
|
||||
|
||||
void FinishedTorrents::loadLastSortedColumn() {
|
||||
// Loading last sorted column
|
||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
QString sortedCol = settings.value(QString::fromUtf8("FinishedListSortedCol"), QString()).toString();
|
||||
if(!sortedCol.isEmpty()) {
|
||||
Qt::SortOrder sortOrder;
|
||||
if(sortedCol.endsWith(QString::fromUtf8("d")))
|
||||
sortOrder = Qt::DescendingOrder;
|
||||
else
|
||||
sortOrder = Qt::AscendingOrder;
|
||||
sortedCol = sortedCol.left(sortedCol.size()-1);
|
||||
int index = sortedCol.toInt();
|
||||
sortFinishedList(index, sortOrder);
|
||||
}
|
||||
}
|
||||
|
||||
// Save columns width in a file to remember them
|
||||
// (finished list)
|
||||
void FinishedTorrents::saveColWidthFinishedList() const{
|
||||
@@ -253,18 +255,7 @@ 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;
|
||||
}
|
||||
if(h.state() == torrent_status::downloading || (h.state() != torrent_status::checking_files && h.state() != torrent_status::queued_for_checking && h.progress() < 1.)) {
|
||||
// What are you doing here? go back to download tab!
|
||||
int reponse = QMessageBox::question(this, tr("Incomplete torrent in seeding list"), tr("It appears that the state of '%1' torrent changed from 'seeding' to 'downloading'. Would you like to move it back to download list? (otherwise the torrent will simply be deleted)").arg(h.name()), QMessageBox::Yes | QMessageBox::No);
|
||||
@@ -413,17 +404,12 @@ 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,58));
|
||||
myFinishedListMenu.exec(mapToGlobal(pos)+QPoint(10,59));
|
||||
}
|
||||
|
||||
|
||||
@@ -435,17 +421,11 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){
|
||||
void FinishedTorrents::displayFinishedHoSMenu(const QPoint& pos){
|
||||
QMenu hideshowColumn(this);
|
||||
hideshowColumn.setTitle(tr("Hide or Show Column"));
|
||||
int lastCol;
|
||||
if(BTSession->isQueueingEnabled()) {
|
||||
lastCol = F_PRIORITY;
|
||||
} else {
|
||||
lastCol = F_RATIO;
|
||||
}
|
||||
for(int i=0; i<=lastCol; i++) {
|
||||
for(int i=0; i<=F_RATIO; i++) {
|
||||
hideshowColumn.addAction(getActionHoSCol(i));
|
||||
}
|
||||
// Call menu
|
||||
hideshowColumn.exec(mapToGlobal(pos)+QPoint(10,34));
|
||||
hideshowColumn.exec(mapToGlobal(pos)+QPoint(10,32));
|
||||
}
|
||||
|
||||
// toggle hide/show a column
|
||||
@@ -499,10 +479,6 @@ 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;
|
||||
@@ -564,9 +540,6 @@ QAction* FinishedTorrents::getActionHoSCol(int index) {
|
||||
case F_RATIO :
|
||||
return actionHOSColRatio;
|
||||
break;
|
||||
case F_PRIORITY :
|
||||
return actionHOSColPriority;
|
||||
break;
|
||||
default :
|
||||
return NULL;
|
||||
}
|
||||
@@ -577,20 +550,38 @@ QAction* FinishedTorrents::getActionHoSCol(int index) {
|
||||
* Sorting functions
|
||||
*/
|
||||
|
||||
void FinishedTorrents::sortFinishedList(int index){
|
||||
static Qt::SortOrder sortOrder = Qt::AscendingOrder;
|
||||
void FinishedTorrents::toggleFinishedListSortOrder(int index) {
|
||||
Qt::SortOrder sortOrder = Qt::AscendingOrder;
|
||||
if(finishedList->header()->sortIndicatorSection() == index){
|
||||
if(sortOrder == Qt::AscendingOrder){
|
||||
sortOrder = Qt::DescendingOrder;
|
||||
}else{
|
||||
sortOrder = Qt::AscendingOrder;
|
||||
}
|
||||
sortOrder = (Qt::SortOrder)!(bool)finishedList->header()->sortIndicatorOrder();
|
||||
}
|
||||
finishedList->header()->setSortIndicator(index, sortOrder);
|
||||
switch(index){
|
||||
switch(index) {
|
||||
case F_SIZE:
|
||||
case F_UPSPEED:
|
||||
sortFinishedListFloat(index, sortOrder);
|
||||
break;
|
||||
default:
|
||||
sortFinishedListString(index, sortOrder);
|
||||
}
|
||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
QString sortOrderLetter;
|
||||
if(sortOrder == Qt::AscendingOrder)
|
||||
sortOrderLetter = QString::fromUtf8("a");
|
||||
else
|
||||
sortOrderLetter = QString::fromUtf8("d");
|
||||
settings.setValue(QString::fromUtf8("FinishedListSortedCol"), misc::toQString(index)+sortOrderLetter);
|
||||
}
|
||||
|
||||
void FinishedTorrents::sortFinishedList(int index, Qt::SortOrder sortOrder){
|
||||
if(index == -1) {
|
||||
index = finishedList->header()->sortIndicatorSection();
|
||||
sortOrder = finishedList->header()->sortIndicatorOrder();
|
||||
} else {
|
||||
finishedList->header()->setSortIndicator(index, sortOrder);
|
||||
}
|
||||
switch(index) {
|
||||
case F_SIZE:
|
||||
case F_UPSPEED:
|
||||
case F_PRIORITY:
|
||||
sortFinishedListFloat(index, sortOrder);
|
||||
break;
|
||||
default:
|
||||
|
@@ -60,7 +60,9 @@ class FinishedTorrents : public QWidget, public Ui::seeding {
|
||||
void displayFinishedHoSMenu(const QPoint&);
|
||||
void setRowColor(int row, QString color);
|
||||
void saveColWidthFinishedList() const;
|
||||
void sortFinishedList(int index);
|
||||
void loadLastSortedColumn();
|
||||
void toggleFinishedListSortOrder(int index);
|
||||
void sortFinishedList(int index=-1, Qt::SortOrder sortOrder=Qt::AscendingOrder);
|
||||
void sortFinishedListFloat(int index, Qt::SortOrder sortOrder);
|
||||
void sortFinishedListString(int index, Qt::SortOrder sortOrder);
|
||||
void updateFileSize(QString hash);
|
||||
@@ -72,7 +74,6 @@ class FinishedTorrents : public QWidget, public Ui::seeding {
|
||||
void hideOrShowColumnUpSpeed();
|
||||
void hideOrShowColumnLeechers();
|
||||
void hideOrShowColumnRatio();
|
||||
void hideOrShowColumnPriority();
|
||||
|
||||
public slots:
|
||||
void addTorrent(QString hash);
|
||||
@@ -82,7 +83,6 @@ 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);
|
||||
|
273
src/GUI.cpp
25
src/GUI.h
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <QProcess>
|
||||
#include <QSystemTrayIcon>
|
||||
|
||||
#include <QPointer>
|
||||
#include "ui_MainWindow.h"
|
||||
#include "qtorrenthandle.h"
|
||||
|
||||
@@ -52,7 +52,6 @@ class QTabWidget;
|
||||
class QLabel;
|
||||
class QModelIndex;
|
||||
class HttpServer;
|
||||
class QFrame;
|
||||
|
||||
class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
Q_OBJECT
|
||||
@@ -66,7 +65,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
QTabWidget *tabs;
|
||||
options_imp *options;
|
||||
QSystemTrayIcon *myTrayIcon;
|
||||
QTimer *systrayCreator;
|
||||
QPointer<QTimer> systrayCreator;
|
||||
QMenu *myTrayIconMenu;
|
||||
DownloadingTorrents *downloadingTorrentTab;
|
||||
FinishedTorrents *finishedTorrentTab;
|
||||
@@ -76,28 +75,18 @@ 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
|
||||
RSSImp *rssWidget;
|
||||
// Web UI
|
||||
HttpServer *httpServer;
|
||||
QPointer<HttpServer> httpServer;
|
||||
// Misc
|
||||
#ifdef QT_4_4
|
||||
QLocalServer *localServer;
|
||||
@@ -127,8 +116,6 @@ 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;
|
||||
@@ -163,12 +150,9 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
void deleteTorrent(QString hash);
|
||||
void deleteRatioTorrent(QString fileName);
|
||||
void finishedTorrent(QTorrentHandle& h) const;
|
||||
void torrentChecked(QString hash) const;
|
||||
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);
|
||||
@@ -185,8 +169,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *);
|
||||
bool event(QEvent * event);
|
||||
void displayRSSTab(bool enable);
|
||||
void hideEvent(QHideEvent *);
|
||||
|
||||
public:
|
||||
// Construct / Destruct
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[Desktop Entry]
|
||||
Categories=Qt;Network;P2P
|
||||
Comment=V1.2.0
|
||||
Comment=V1.1.4
|
||||
Exec=qbittorrent %f
|
||||
GenericName=Bittorrent client
|
||||
GenericName[bg]=Торент клиент
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 5.1 KiB |
BIN
src/Icons/skin/disconnected.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 493 B |
BIN
src/Icons/smile.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 75 KiB |
BIN
src/Icons/stare.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
src/Icons/unhappy.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
@@ -187,3 +187,4 @@ bool SearchTab::loadColWidthSearchList(){
|
||||
qDebug("Search list columns width loaded");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -56,7 +56,7 @@ 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 (yue.guo0418@gmail.com)<br>\
|
||||
- <u>Chinese (Simplified):</u> Guo Yue (guoyue0418@hotmail.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>\
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include <QPair>
|
||||
#include <QStringList>
|
||||
#include <QDateTime>
|
||||
#include <QPointer>
|
||||
|
||||
#include <libtorrent/session.hpp>
|
||||
#include <libtorrent/ip_filter.hpp>
|
||||
@@ -44,14 +45,13 @@ class bittorrent : public QObject{
|
||||
private:
|
||||
session *s;
|
||||
QString scan_dir;
|
||||
QTimer *timerScan;
|
||||
QPointer<QTimer> timerScan;
|
||||
QTimer *timerAlerts;
|
||||
QTimer *fastResumeSaver;
|
||||
QTimer *BigRatioTimer;
|
||||
QPointer<QTimer> BigRatioTimer;
|
||||
bool DHTEnabled;
|
||||
downloadThread *downloader;
|
||||
QString defaultSavePath;
|
||||
QStringList torrentsToPauseAfterChecking;
|
||||
QHash<QString, QDateTime> TorrentsStartTime;
|
||||
QHash<QString, size_type> TorrentsStartData;
|
||||
QHash<QString, QPair<size_type,size_type> > ratioData;
|
||||
@@ -67,18 +67,10 @@ class bittorrent : public QObject{
|
||||
bool UPnPEnabled;
|
||||
bool NATPMPEnabled;
|
||||
bool LSDEnabled;
|
||||
FilterParserThread *filterParser;
|
||||
QPointer<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;
|
||||
QStringList url_skippingDlg;
|
||||
|
||||
protected:
|
||||
QString getSavePath(QString hash);
|
||||
@@ -95,7 +87,6 @@ class bittorrent : public QObject{
|
||||
float getPayloadUploadRate() const;
|
||||
session_status getSessionStatus() const;
|
||||
int getListenPort() const;
|
||||
QStringList getTorrentsToPauseAfterChecking() const;
|
||||
qlonglong getETA(QString hash) const;
|
||||
float getRealRatio(QString hash) const;
|
||||
session* getSession() const;
|
||||
@@ -106,14 +97,7 @@ 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);
|
||||
float getUncheckedTorrentProgress(QString hash) const;
|
||||
|
||||
public slots:
|
||||
void addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
|
||||
@@ -133,7 +117,6 @@ 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);
|
||||
@@ -141,13 +124,7 @@ 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);
|
||||
void downloadUrlAndSkipDialog(QString);
|
||||
// Session configuration - Setters
|
||||
void setListeningPortsRange(std::pair<unsigned short, unsigned short> ports);
|
||||
void setMaxConnections(int maxConnec);
|
||||
@@ -174,9 +151,6 @@ 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();
|
||||
@@ -206,14 +180,10 @@ class bittorrent : public QObject{
|
||||
void downloadFromUrlFailure(QString url, QString reason);
|
||||
void fastResumeDataRejected(QString name);
|
||||
void urlSeedProblem(QString url, QString msg);
|
||||
void torrentFinishedChecking(QString hash);
|
||||
//void torrentFinishedChecking(QString hash);
|
||||
void torrent_ratio_deleted(QString fileName);
|
||||
void UPnPError(QString msg);
|
||||
void UPnPSuccess(QString msg);
|
||||
void updateFinishedTorrentNumber();
|
||||
void updateUnfinishedTorrentNumber();
|
||||
void forceUnfinishedListUpdate();
|
||||
void forceFinishedListUpdate();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -45,7 +45,7 @@ createtorrent::createtorrent(QWidget *parent): QDialog(parent){
|
||||
setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
creatorThread = new torrentCreatorThread();
|
||||
connect(creatorThread, SIGNAL(creationSuccess(QString)), this, SLOT(handleCreationSucess(QString)));
|
||||
connect(creatorThread, SIGNAL(creationSuccess(QString, const char*, QString)), this, SLOT(handleCreationSuccess(QString, const char*, QString)));
|
||||
connect(creatorThread, SIGNAL(creationFailure(QString)), this, SLOT(handleCreationFailure(QString)));
|
||||
connect(creatorThread, SIGNAL(updateProgress(int)), this, SLOT(updateProgressBar(int)));
|
||||
show();
|
||||
@@ -129,12 +129,23 @@ void createtorrent::on_addURLSeed_button_clicked(){
|
||||
// Subfunction to add files to a torrent_info structure
|
||||
// Written by Arvid Norberg (libtorrent Author)
|
||||
void add_files(torrent_info& t, path const& p, path const& l){
|
||||
qDebug("p: %s, l: %s, l.leaf(): %s", p.string().c_str(), l.string().c_str(), l.leaf().c_str());
|
||||
using boost::filesystem::path;
|
||||
using boost::filesystem::directory_iterator;
|
||||
#if BOOST_VERSION < 103600
|
||||
std::string const& leaf = l.leaf();
|
||||
#else
|
||||
std::string const& leaf = l.filename();
|
||||
#endif
|
||||
if (leaf == ".." || leaf == ".") return;
|
||||
path f(p / l);
|
||||
if (is_directory(f)){
|
||||
if (is_directory(f)) {
|
||||
for (directory_iterator i(f), end; i != end; ++i)
|
||||
#if BOOST_VERSION < 103600
|
||||
add_files(t, p, l / i->leaf());
|
||||
}else{
|
||||
#else
|
||||
add_files(t, p, l / i->filename());
|
||||
#endif
|
||||
} else {
|
||||
qDebug("Adding %s", l.string().c_str());
|
||||
t.add_file(l, file_size(f));
|
||||
}
|
||||
@@ -221,7 +232,11 @@ void torrentCreatorThread::run() {
|
||||
ofstream out(complete(path((const char*)save_path.toUtf8())), std::ios_base::binary);
|
||||
// Adding files to the torrent
|
||||
path full_path = complete(path(input_path.toUtf8().data()));
|
||||
#if BOOST_VERSION < 103600
|
||||
add_files(*t, full_path.branch_path(), full_path.leaf());
|
||||
#else
|
||||
add_files(*t, full_path.branch_path(), full_path.filename());
|
||||
#endif
|
||||
if(abort) return;
|
||||
// Set piece size
|
||||
t->set_piece_size(piece_size);
|
||||
|
@@ -35,27 +35,30 @@ class subDeleteThread : public QThread {
|
||||
private:
|
||||
QString save_path;
|
||||
arborescence *arb;
|
||||
bool abort;
|
||||
|
||||
public:
|
||||
subDeleteThread(QObject *parent, QString saveDir, arborescence *arb) : QThread(parent), save_path(saveDir), arb(arb), abort(false){}
|
||||
subDeleteThread(QObject *parent, QString saveDir, arborescence *_arb) : QThread(parent), save_path(saveDir) {
|
||||
arb = _arb;
|
||||
}
|
||||
|
||||
~subDeleteThread(){
|
||||
abort = true;
|
||||
wait();
|
||||
qDebug("subDeleteThread successfuly deleted");
|
||||
//wait();
|
||||
}
|
||||
|
||||
signals:
|
||||
// For subthreads
|
||||
void deletionSuccessST(subDeleteThread* st);
|
||||
void deletionFailureST(subDeleteThread* st);
|
||||
//void deletionFailureST(subDeleteThread* st);
|
||||
|
||||
protected:
|
||||
void run(){
|
||||
if(arb->removeFromFS(save_path))
|
||||
/*if(arb->removeFromFS(save_path))
|
||||
emit deletionSuccessST(this);
|
||||
else
|
||||
emit deletionFailureST(this);
|
||||
emit deletionFailureST(this);*/
|
||||
arb->removeFromFS(save_path);
|
||||
emit deletionSuccessST(this);
|
||||
delete arb;
|
||||
}
|
||||
};
|
||||
@@ -99,13 +102,13 @@ class deleteThread : public QThread {
|
||||
if(abort)
|
||||
return;
|
||||
mutex.lock();
|
||||
if(torrents_list.size() != 0){
|
||||
if(!torrents_list.empty()){
|
||||
QPair<QString, arborescence *> torrent = torrents_list.takeFirst();
|
||||
mutex.unlock();
|
||||
subDeleteThread *st = new subDeleteThread(0, torrent.first, torrent.second);
|
||||
subThreads << st;
|
||||
connect(st, SIGNAL(deletionSuccessST(subDeleteThread*)), this, SLOT(deleteSubThread(subDeleteThread*)));
|
||||
connect(st, SIGNAL(deletionFailureST(subDeleteThread*)), this, SLOT(deleteSubThread(subDeleteThread*)));
|
||||
//connect(st, SIGNAL(deletionFailureST(subDeleteThread*)), this, SLOT(deleteSubThread(subDeleteThread*)));
|
||||
st->start();
|
||||
}else{
|
||||
condition.wait(&mutex);
|
||||
|
@@ -18,16 +18,7 @@
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@@ -72,6 +63,14 @@
|
||||
<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>
|
||||
@@ -79,16 +78,7 @@
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
@@ -113,6 +103,14 @@
|
||||
</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>
|
||||
@@ -120,16 +118,7 @@
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
@@ -194,7 +183,8 @@
|
||||
</action>
|
||||
<action name="actionOpen_destination_folder" >
|
||||
<property name="icon" >
|
||||
<iconset resource="icons.qrc" >:/Icons/folder.png</iconset>
|
||||
<iconset resource="icons.qrc" >
|
||||
<normaloff>:/Icons/folder.png</normaloff>:/Icons/folder.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Open destination folder</string>
|
||||
@@ -242,33 +232,15 @@
|
||||
</action>
|
||||
<action name="actionBuy_it" >
|
||||
<property name="icon" >
|
||||
<iconset resource="icons.qrc" >:/Icons/money.png</iconset>
|
||||
<iconset resource="icons.qrc" >
|
||||
<normaloff>:/Icons/money.png</normaloff>:/Icons/money.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Buy it</string>
|
||||
</property>
|
||||
</action>
|
||||
<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>
|
||||
<zorder>tabBottom</zorder>
|
||||
<zorder></zorder>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="icons.qrc" />
|
||||
|
@@ -38,9 +38,7 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
|
||||
bittorrent *BTSession;
|
||||
DLListDelegate *DLDelegate;
|
||||
QStandardItemModel *DLListModel;
|
||||
bool delayedSorting;
|
||||
unsigned int nbTorrents;
|
||||
Qt::SortOrder delayedSortingOrder;
|
||||
void hideOrShowColumn(int index);
|
||||
bool loadHiddenColumns();
|
||||
void saveHiddenColumns();
|
||||
@@ -55,7 +53,6 @@ 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);
|
||||
@@ -74,7 +71,8 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
|
||||
void on_actionClearLog_triggered();
|
||||
void displayInfoBarMenu(const QPoint& pos);
|
||||
void addTorrent(QString hash);
|
||||
void sortDownloadList(int index, Qt::SortOrder startSortOrder=Qt::AscendingOrder, bool fromLoadColWidth=false);
|
||||
void sortDownloadList(int index=-1, Qt::SortOrder startSortOrder=Qt::AscendingOrder);
|
||||
void toggleDownloadListSortOrder(int index);
|
||||
void sortDownloadListFloat(int index, Qt::SortOrder sortOrder);
|
||||
void sortDownloadListString(int index, Qt::SortOrder sortOrder);
|
||||
void saveColWidthDLList() const;
|
||||
@@ -93,9 +91,9 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
|
||||
void hideOrShowColumnSeedersLeechers();
|
||||
void hideOrShowColumnRatio();
|
||||
void hideOrShowColumnEta();
|
||||
void hideOrShowColumnPriority();
|
||||
void displayUPnPError(QString msg);
|
||||
void displayUPnPSuccess(QString msg);
|
||||
void loadLastSortedColumn();
|
||||
|
||||
public slots:
|
||||
void updateDlList();
|
||||
@@ -105,10 +103,8 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
|
||||
void deleteTorrent(QString hash);
|
||||
void setBottomTabEnabled(unsigned int index, bool b);
|
||||
void propertiesSelection();
|
||||
void sortProgressColumnDelayed();
|
||||
void updateFileSizeAndProgress(QString hash);
|
||||
void showPropertiesFromHash(QString hash);
|
||||
void hidePriorityColumn(bool hide);
|
||||
|
||||
};
|
||||
|
||||
|
@@ -20,23 +20,22 @@
|
||||
|
||||
|
||||
#include "eventmanager.h"
|
||||
#include "bittorrent.h"
|
||||
#include "json.h"
|
||||
#include <QDebug>
|
||||
|
||||
EventManager::EventManager(QObject *parent, bittorrent *BTSession)
|
||||
: QObject(parent), BTSession(BTSession)
|
||||
EventManager::EventManager(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
revision = 0;
|
||||
}
|
||||
|
||||
void EventManager::update(QVariantMap event)
|
||||
{
|
||||
revision++;
|
||||
++revision;
|
||||
events << QPair<ulong, QVariantMap>(revision, event);
|
||||
emit updated();
|
||||
qDebug("Added the following event");
|
||||
qDebug() << event;
|
||||
//qDebug("Added the following event");
|
||||
//qDebug() << event;
|
||||
/* QLinkedList<QPair<ulong, QVariantMap> >::iterator i;
|
||||
for (i = events.begin(); i != events.end(); i++)
|
||||
qDebug() << *i;*/
|
||||
@@ -100,12 +99,10 @@ void EventManager::modifiedTorrent(QTorrentHandle h)
|
||||
QVariantMap event;
|
||||
QVariant v;
|
||||
|
||||
if(h.is_paused()) {
|
||||
if(BTSession->isDownloadQueued(hash) || BTSession->isUploadQueued(hash))
|
||||
v = QVariant("queued");
|
||||
else
|
||||
v = QVariant("paused");
|
||||
} else {
|
||||
if(h.is_paused())
|
||||
v = QVariant("paused");
|
||||
else
|
||||
{
|
||||
switch(h.state())
|
||||
{
|
||||
case torrent_status::finished:
|
||||
|