Browse Source

* More exit tweaking to make shutdown faster

* Fixed active upload icon in Web UI
* Fixed text alignment in Web UI preferences dialog
* Fixes to ratio display in Web UI transfer list and properties panel
* Edited Queued/Paused/Checking icons so that they are the same for complete/incomplete torrents (easier to understand)
* Color torrents in UI transfer list as in qBittorrent < 2.0 (more easily understandable)
* Progress and size are now updated when files are filtered in torrent properties
adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
4dc8959f67
  1. 2
      Changelog
  2. 20
      src/GUI.cpp
  3. BIN
      src/Icons/skin/checkingDL.png
  4. BIN
      src/Icons/skin/checkingUP.png
  5. BIN
      src/Icons/skin/pausedDL.png
  6. BIN
      src/Icons/skin/pausedUP.png
  7. BIN
      src/Icons/skin/queuedDL.png
  8. BIN
      src/Icons/skin/queuedUP.png
  9. BIN
      src/Icons/skin/stalledDL.png
  10. BIN
      src/Icons/skin/stalledUP.png
  11. 22
      src/bittorrent.cpp
  12. 3
      src/bittorrent.h
  13. 18
      src/eventmanager.cpp
  14. 4
      src/main.cpp
  15. 2
      src/propertieswidget.cpp
  16. 24
      src/torrentfilesmodel.h
  17. 25
      src/transferlistwidget.cpp
  18. 2
      src/transferlistwidget.h
  19. 12
      src/webui/preferences.html
  20. 6
      src/webui/scripts/dynamicTable.js

2
Changelog

@ -4,7 +4,7 @@
- FEATURE: Display more information regarding the torrent in its properties - FEATURE: Display more information regarding the torrent in its properties
- FEATURE: Various optimizations to save CPU and memory - FEATURE: Various optimizations to save CPU and memory
- FEATURE: Folder scanning now works with CIFS and NFS mounted folders - FEATURE: Folder scanning now works with CIFS and NFS mounted folders
- FEATURE: Speed up qBittorrent startup - FEATURE: Speed up qBittorrent startup and shutdown
- FEATURE: Display per-torrent peer list - FEATURE: Display per-torrent peer list
- FEATURE: Make sure torrent files are always sorted by name - FEATURE: Make sure torrent files are always sorted by name
- FEATURE: Seeds and Peers columns are now sortable - FEATURE: Seeds and Peers columns are now sortable

20
src/GUI.cpp

@ -196,17 +196,21 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
GUI::~GUI() { GUI::~GUI() {
qDebug("GUI destruction"); qDebug("GUI destruction");
hide(); hide();
// Async deletion of Bittorrent session as early as possible
// in order to speed up exit
session_proxy sp = BTSession->asyncDeletion();
// Delete other GUI objects
delete status_bar; delete status_bar;
delete transferList;
delete guiUpdater;
if(rssWidget) if(rssWidget)
delete rssWidget; delete rssWidget;
delete searchEngine; delete searchEngine;
delete transferListFilters; delete transferListFilters;
delete properties; delete properties;
delete transferList;
delete hSplitter; delete hSplitter;
delete vSplitter; delete vSplitter;
delete guiUpdater;
qDebug("1");
if(systrayCreator) { if(systrayCreator) {
delete systrayCreator; delete systrayCreator;
} }
@ -214,19 +218,21 @@ GUI::~GUI() {
delete systrayIcon; delete systrayIcon;
delete myTrayIconMenu; delete myTrayIconMenu;
} }
qDebug("2");
localServer->close(); localServer->close();
delete localServer; delete localServer;
delete tabs; delete tabs;
qDebug("3");
// Keyboard shortcuts // Keyboard shortcuts
delete switchSearchShortcut; delete switchSearchShortcut;
delete switchSearchShortcut2; delete switchSearchShortcut2;
delete switchTransferShortcut; delete switchTransferShortcut;
delete switchRSSShortcut; delete switchRSSShortcut;
qDebug("4"); // Delete BTSession objects
delete BTSession; delete BTSession;
qDebug("5"); // May freeze for a few seconds after the next line
// because the Bittorrent session proxy will
// actually be deleted now and destruction
// becomes synchronous
qDebug("Exiting GUI destructor...");
} }
void GUI::displayRSSTab(bool enable) { void GUI::displayRSSTab(bool enable) {

BIN
src/Icons/skin/checkingDL.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
src/Icons/skin/checkingUP.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
src/Icons/skin/pausedDL.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
src/Icons/skin/pausedUP.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
src/Icons/skin/queuedDL.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
src/Icons/skin/queuedUP.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
src/Icons/skin/stalledDL.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
src/Icons/skin/stalledUP.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

22
src/bittorrent.cpp

@ -63,7 +63,7 @@
enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4}; enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4};
// Main constructor // Main constructor
Bittorrent::Bittorrent() : preAllocateAll(false), addInPause(false), ratio_limit(-1), UPnPEnabled(false), NATPMPEnabled(false), LSDEnabled(false), DHTEnabled(false), queueingEnabled(false), geoipDBLoaded(false) { Bittorrent::Bittorrent() : preAllocateAll(false), addInPause(false), ratio_limit(-1), UPnPEnabled(false), NATPMPEnabled(false), LSDEnabled(false), DHTEnabled(false), queueingEnabled(false), geoipDBLoaded(false), exiting(false) {
resolve_countries = false; resolve_countries = false;
// To avoid some exceptions // To avoid some exceptions
fs::path::default_name_check(fs::no_check); fs::path::default_name_check(fs::no_check);
@ -102,9 +102,24 @@ Bittorrent::Bittorrent() : preAllocateAll(false), addInPause(false), ratio_limit
qDebug("* BTSession constructed"); qDebug("* BTSession constructed");
} }
session_proxy Bittorrent::asyncDeletion() {
qDebug("Bittorrent session async deletion IN");
exiting = true;
// Do some BT related saving
saveDHTEntry();
saveSessionState();
saveFastResumeData();
// Delete session
session_proxy sp = s->abort();
delete s;
qDebug("Bittorrent session async deletion OUT");
return sp;
}
// Main destructor // Main destructor
Bittorrent::~Bittorrent() { Bittorrent::~Bittorrent() {
qDebug("BTSession deletion"); qDebug("BTSession destructor IN");
if(!exiting) {
// Do some BT related saving // Do some BT related saving
saveDHTEntry(); saveDHTEntry();
saveSessionState(); saveSessionState();
@ -112,6 +127,7 @@ Bittorrent::~Bittorrent() {
// Delete session // Delete session
session_proxy sp = s->abort(); session_proxy sp = s->abort();
delete s; delete s;
}
// Disable directory scanning // Disable directory scanning
disableDirectoryScanning(); disableDirectoryScanning();
// Delete our objects // Delete our objects
@ -129,7 +145,7 @@ Bittorrent::~Bittorrent() {
delete httpServer; delete httpServer;
if(timerETA) if(timerETA)
delete timerETA; delete timerETA;
qDebug("Deleting session..."); qDebug("BTSession destructor OUT");
} }
void Bittorrent::preAllocateAllFiles(bool b) { void Bittorrent::preAllocateAllFiles(bool b) {

3
src/bittorrent.h

@ -120,6 +120,8 @@ private:
// Web UI // Web UI
QPointer<HttpServer> httpServer; QPointer<HttpServer> httpServer;
QStringList url_skippingDlg; QStringList url_skippingDlg;
// Fast exit (async)
bool exiting;
protected: protected:
QString getSavePath(QString hash); QString getSavePath(QString hash);
@ -163,6 +165,7 @@ public slots:
void downloadFromUrl(QString url); void downloadFromUrl(QString url);
void deleteTorrent(QString hash, bool delete_local_files = false); void deleteTorrent(QString hash, bool delete_local_files = false);
void startUpTorrents(); void startUpTorrents();
session_proxy asyncDeletion();
/* Needed by Web UI */ /* Needed by Web UI */
void pauseAllTorrents(); void pauseAllTorrents();
void pauseTorrent(QString hash); void pauseTorrent(QString hash);

18
src/eventmanager.cpp

@ -161,18 +161,10 @@ QVariantMap EventManager::getPropGeneralInfo(QString hash) const {
data["time_elapsed"] = elapsed_txt; data["time_elapsed"] = elapsed_txt;
data["nb_connections"] = QString::number(h.num_connections())+" ("+tr("%1 max", "e.g. 10 max").arg(QString::number(h.connections_limit()))+")"; data["nb_connections"] = QString::number(h.num_connections())+" ("+tr("%1 max", "e.g. 10 max").arg(QString::number(h.connections_limit()))+")";
// Update ratio info // Update ratio info
float ratio; double ratio = BTSession->getRealRatio(h.hash());
if(h.total_payload_download() == 0){ if(ratio > 100.)
if(h.total_payload_upload() == 0) data["share_ratio"] = QString::fromUtf8("");
ratio = 1.;
else else
ratio = 10.; // Max ratio
}else{
ratio = (double)h.total_payload_upload()/(double)h.total_payload_download();
if(ratio > 10.){
ratio = 10.;
}
}
data["share_ratio"] = QString(QByteArray::number(ratio, 'f', 1)); data["share_ratio"] = QString(QByteArray::number(ratio, 'f', 1));
} }
return data; return data;
@ -210,7 +202,7 @@ void EventManager::modifiedTorrent(QTorrentHandle h)
case torrent_status::finished: case torrent_status::finished:
case torrent_status::seeding: case torrent_status::seeding:
if(h.upload_payload_rate() > 0) { if(h.upload_payload_rate() > 0) {
event["state"] = QVariant("seeding"); event["state"] = QVariant("uploading");
} else { } else {
event["state"] = QVariant("stalledUP"); event["state"] = QVariant("stalledUP");
} }
@ -263,7 +255,7 @@ void EventManager::modifiedTorrent(QTorrentHandle h)
event["seed"] = QVariant(h.is_seed()); event["seed"] = QVariant(h.is_seed());
double ratio = BTSession->getRealRatio(hash); double ratio = BTSession->getRealRatio(hash);
if(ratio > 100.) if(ratio > 100.)
QString::fromUtf8(""); event["ratio"] = QString::fromUtf8("");
else else
event["ratio"] = QVariant(QString::number(ratio, 'f', 1)); event["ratio"] = QVariant(QString::number(ratio, 'f', 1));
event["hash"] = QVariant(hash); event["hash"] = QVariant(hash);

4
src/main.cpp

@ -211,8 +211,10 @@ int main(int argc, char *argv[]){
} }
int ret = app->exec(); int ret = app->exec();
delete window; delete window;
qDebug("app children: %d", app->children().size()); qDebug("GUI was deleted!");
qDebug("Deleting app...");
delete app; delete app;
qDebug("App was deleted! All good.");
return ret; return ret;
} }

2
src/propertieswidget.cpp

@ -356,8 +356,8 @@ void PropertiesWidget::loadDynamicData() {
// Files progress // Files progress
std::vector<size_type> fp; std::vector<size_type> fp;
h.file_progress(fp); h.file_progress(fp);
PropListModel->updateFilesProgress(fp);
PropListModel->updateFilesPriorities(h.file_priorities()); PropListModel->updateFilesPriorities(h.file_priorities());
PropListModel->updateFilesProgress(fp);
} }
} catch(invalid_handle e) {} } catch(invalid_handle e) {}
} }

24
src/torrentfilesmodel.h

@ -133,13 +133,13 @@ public:
Q_ASSERT(type == FOLDER); Q_ASSERT(type == FOLDER);
qulonglong size = 0; qulonglong size = 0;
foreach(TreeItem* child, childItems) { foreach(TreeItem* child, childItems) {
if(child->getPriority() > 0)
size += child->getSize(); size += child->getSize();
} }
setSize(size); setSize(size);
} }
void setProgress(qulonglong done) { void setProgress(qulonglong done) {
if(done == total_done) return;
total_done = done; total_done = done;
qulonglong size = getSize(); qulonglong size = getSize();
Q_ASSERT(total_done <= size); Q_ASSERT(total_done <= size);
@ -149,6 +149,7 @@ public:
else else
progress = 1.; progress = 1.;
Q_ASSERT(progress >= 0. && progress <= 1.); Q_ASSERT(progress >= 0. && progress <= 1.);
//qDebug("setProgress(%s): %f", getName().toLocal8Bit().data(), progress);
itemData.replace(2, progress); itemData.replace(2, progress);
if(parentItem) if(parentItem)
parentItem->updateProgress(); parentItem->updateProgress();
@ -169,9 +170,12 @@ public:
if(type == ROOT) return; if(type == ROOT) return;
Q_ASSERT(type == FOLDER); Q_ASSERT(type == FOLDER);
total_done = 0; total_done = 0;
//qDebug("Folder %s is updating its progress", getName().toLocal8Bit().data());
foreach(TreeItem* child, childItems) { foreach(TreeItem* child, childItems) {
if(child->getPriority() > 0)
total_done += child->getTotalDone(); total_done += child->getTotalDone();
} }
//qDebug("Folder: total_done: %llu/%llu", total_done, getSize());
Q_ASSERT(total_done <= getSize()); Q_ASSERT(total_done <= getSize());
setProgress(total_done); setProgress(total_done);
} }
@ -180,16 +184,24 @@ public:
return itemData.value(3).toInt(); return itemData.value(3).toInt();
} }
void setPriority(int priority) { void setPriority(int new_prio) {
if(getPriority() != priority) { int old_prio = getPriority();
itemData.replace(3, priority); if(old_prio != new_prio) {
itemData.replace(3, new_prio);
// Update parent // Update parent
if(parentItem) if(parentItem) {
if(new_prio == 0 || old_prio == 0) {
// Files got filtered or unfiltered
// Update parent size and progress
parentItem->updateSize();
parentItem->updateProgress();
}
parentItem->updatePriority(); parentItem->updatePriority();
} }
}
// Update children // Update children
foreach(TreeItem* child, childItems) { foreach(TreeItem* child, childItems) {
child->setPriority(priority); child->setPriority(new_prio);
} }
} }

25
src/transferlistwidget.cpp

@ -163,7 +163,7 @@ void TransferListWidget::addTorrent(QTorrentHandle& h) {
listModel->setData(listModel->index(row, TR_STATUS), STATE_PAUSED_DL); listModel->setData(listModel->index(row, TR_STATUS), STATE_PAUSED_DL);
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/pausedDL.png"))), Qt::DecorationRole); listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/pausedDL.png"))), Qt::DecorationRole);
} }
//setRowColor(row, QString::fromUtf8("red")); setRowColor(row, QString::fromUtf8("red"));
}else{ }else{
if(h.is_seed()) { if(h.is_seed()) {
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/stalledUP.png"))), Qt::DecorationRole); listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/stalledUP.png"))), Qt::DecorationRole);
@ -172,7 +172,7 @@ void TransferListWidget::addTorrent(QTorrentHandle& h) {
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/stalledDL.png"))), Qt::DecorationRole); listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/stalledDL.png"))), Qt::DecorationRole);
listModel->setData(listModel->index(row, TR_STATUS), STATE_STALLED_DL); listModel->setData(listModel->index(row, TR_STATUS), STATE_STALLED_DL);
} }
//setRowColor(row, QString::fromUtf8("grey")); setRowColor(row, QApplication::palette().color(QPalette::WindowText));
} }
// Select first torrent to be added // Select first torrent to be added
if(listModel->rowCount() == 1) if(listModel->rowCount() == 1)
@ -184,12 +184,12 @@ void TransferListWidget::addTorrent(QTorrentHandle& h) {
} }
} }
/*void TransferListWidget::setRowColor(int row, QColor color) { void TransferListWidget::setRowColor(int row, QColor color) {
unsigned int nbColumns = listModel->columnCount()-1; unsigned int nbColumns = listModel->columnCount()-1;
for(unsigned int i=0; i<nbColumns; ++i) { for(unsigned int i=0; i<nbColumns; ++i) {
listModel->setData(listModel->index(row, i), QVariant(color), Qt::ForegroundRole); listModel->setData(listModel->index(row, i), QVariant(color), Qt::ForegroundRole);
} }
}*/ }
void TransferListWidget::deleteTorrent(int row, bool refresh_list) { void TransferListWidget::deleteTorrent(int row, bool refresh_list) {
listModel->removeRow(row); listModel->removeRow(row);
@ -216,7 +216,7 @@ void TransferListWidget::pauseTorrent(int row, bool refresh_list) {
} }
listModel->setData(listModel->index(row, TR_SEEDS), QVariant(0.0)); listModel->setData(listModel->index(row, TR_SEEDS), QVariant(0.0));
listModel->setData(listModel->index(row, TR_PEERS), QVariant(0.0)); listModel->setData(listModel->index(row, TR_PEERS), QVariant(0.0));
//setRowColor(row, QString::fromUtf8("red")); setRowColor(row, QString::fromUtf8("red"));
if(refresh_list) if(refresh_list)
refreshList(); refreshList();
} }
@ -236,6 +236,7 @@ void TransferListWidget::resumeTorrent(int row, bool refresh_list) {
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(":/Icons/skin/stalledDL.png")), Qt::DecorationRole); listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(":/Icons/skin/stalledDL.png")), Qt::DecorationRole);
listModel->setData(listModel->index(row, TR_STATUS), STATE_STALLED_DL); listModel->setData(listModel->index(row, TR_STATUS), STATE_STALLED_DL);
} }
setRowColor(row, QApplication::palette().color(QPalette::WindowText));
if(refresh_list) if(refresh_list)
refreshList(); refreshList();
} }
@ -312,7 +313,7 @@ int TransferListWidget::updateTorrent(int row) {
listModel->setData(listModel->index(row, TR_UPSPEED), QVariant((double)0.)); listModel->setData(listModel->index(row, TR_UPSPEED), QVariant((double)0.));
listModel->setData(listModel->index(row, TR_SEEDS), QVariant(0.0)); listModel->setData(listModel->index(row, TR_SEEDS), QVariant(0.0));
listModel->setData(listModel->index(row, TR_PEERS), QVariant(0.0)); listModel->setData(listModel->index(row, TR_PEERS), QVariant(0.0));
//setRowColor(row, QString::fromUtf8("grey")); setRowColor(row, QString::fromUtf8("grey"));
return s; return s;
} }
} }
@ -340,7 +341,7 @@ int TransferListWidget::updateTorrent(int row) {
} }
listModel->setData(listModel->index(row, TR_PROGRESS), QVariant((double)h.progress())); listModel->setData(listModel->index(row, TR_PROGRESS), QVariant((double)h.progress()));
listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)-1)); listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)-1));
//setRowColor(row, QString::fromUtf8("grey")); setRowColor(row, QString::fromUtf8("grey"));
break; break;
case torrent_status::downloading: case torrent_status::downloading:
case torrent_status::downloading_metadata: case torrent_status::downloading_metadata:
@ -348,12 +349,12 @@ int TransferListWidget::updateTorrent(int row) {
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/downloading.png"))), Qt::DecorationRole); listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/downloading.png"))), Qt::DecorationRole);
listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)BTSession->getETA(hash))); listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)BTSession->getETA(hash)));
s = STATE_DOWNLOADING; s = STATE_DOWNLOADING;
//setRowColor(row, QString::fromUtf8("green")); setRowColor(row, QString::fromUtf8("green"));
}else{ }else{
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/stalledDL.png"))), Qt::DecorationRole); listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/stalledDL.png"))), Qt::DecorationRole);
listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)-1)); listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)-1));
s = STATE_STALLED_DL; s = STATE_STALLED_DL;
//setRowColor(row, QApplication::palette().color(QPalette::WindowText)); setRowColor(row, QApplication::palette().color(QPalette::WindowText));
} }
listModel->setData(listModel->index(row, TR_DLSPEED), QVariant((double)h.download_payload_rate())); listModel->setData(listModel->index(row, TR_DLSPEED), QVariant((double)h.download_payload_rate()));
listModel->setData(listModel->index(row, TR_PROGRESS), QVariant((double)h.progress())); listModel->setData(listModel->index(row, TR_PROGRESS), QVariant((double)h.progress()));
@ -363,9 +364,11 @@ int TransferListWidget::updateTorrent(int row) {
if(h.upload_payload_rate() > 0) { if(h.upload_payload_rate() > 0) {
s = STATE_SEEDING; s = STATE_SEEDING;
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/uploading.png"))), Qt::DecorationRole); listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/uploading.png"))), Qt::DecorationRole);
setRowColor(row, "orange");
} else { } else {
s = STATE_STALLED_UP; s = STATE_STALLED_UP;
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/stalledUP.png"))), Qt::DecorationRole); listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/stalledUP.png"))), Qt::DecorationRole);
setRowColor(row, QApplication::palette().color(QPalette::WindowText));
} }
} }
// Common to both downloads and uploads // Common to both downloads and uploads
@ -389,11 +392,11 @@ void TransferListWidget::setFinished(QTorrentHandle &h) {
if(h.is_paused()) { if(h.is_paused()) {
listModel->setData(listModel->index(row, TR_NAME), QIcon(":/Icons/skin/pausedUP.png"), Qt::DecorationRole); listModel->setData(listModel->index(row, TR_NAME), QIcon(":/Icons/skin/pausedUP.png"), Qt::DecorationRole);
listModel->setData(listModel->index(row, TR_STATUS), STATE_PAUSED_UP); listModel->setData(listModel->index(row, TR_STATUS), STATE_PAUSED_UP);
//setRowColor(row, "red"); setRowColor(row, "red");
}else{ }else{
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(":/Icons/skin/stalledUP.png")), Qt::DecorationRole); listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(":/Icons/skin/stalledUP.png")), Qt::DecorationRole);
listModel->setData(listModel->index(row, TR_STATUS), STATE_STALLED_UP); listModel->setData(listModel->index(row, TR_STATUS), STATE_STALLED_UP);
//setRowColor(row, "orange"); setRowColor(row, QApplication::palette().color(QPalette::WindowText));
} }
listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)-1)); listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)-1));
listModel->setData(listModel->index(row, TR_DLSPEED), QVariant((double)0.)); listModel->setData(listModel->index(row, TR_DLSPEED), QVariant((double)0.));

2
src/transferlistwidget.h

@ -84,7 +84,7 @@ protected slots:
#endif #endif
void toggleSelectedTorrentsSequentialDownload(); void toggleSelectedTorrentsSequentialDownload();
void toggleSelectedFirstLastPiecePrio(); void toggleSelectedFirstLastPiecePrio();
//void setRowColor(int row, QColor color); void setRowColor(int row, QColor color);
public slots: public slots:
void refreshList(); void refreshList();

12
src/webui/preferences.html

@ -14,10 +14,10 @@
<div style="padding-left: 30px;"> <div style="padding-left: 30px;">
<table> <table>
<tr> <tr>
<td style="vertical-align: bottom;"><input type="checkbox" id="up_limit_checkbox" onClick="updateUpLimitEnabled();"/></td><td style="text-align: right; padding-right: 3px;">_(Upload:)</td><td><input type="text" id="up_limit_value" style="width: 4em;"/>&nbsp;&nbsp;_(KiB/s)</td> <td style="vertical-align: bottom;"><input type="checkbox" id="up_limit_checkbox" onClick="updateUpLimitEnabled();"/></td><td style="padding-right: 3px;">_(Upload:)</td><td><input type="text" id="up_limit_value" style="width: 4em;"/>&nbsp;&nbsp;_(KiB/s)</td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: bottom;"><input type="checkbox" id="dl_limit_checkbox" onClick="updateDlLimitEnabled();"/></td><td style="text-align: right; padding-right: 3px;">_(Download:)</td><td><input type="text" id="dl_limit_value" style="width: 4em;"/>&nbsp;&nbsp;_(KiB/s)</td> <td style="vertical-align: bottom;"><input type="checkbox" id="dl_limit_checkbox" onClick="updateDlLimitEnabled();"/></td><td style="padding-right: 3px;">_(Download:)</td><td><input type="text" id="dl_limit_value" style="width: 4em;"/>&nbsp;&nbsp;_(KiB/s)</td>
</tr> </tr>
</table> </table>
</div> </div>
@ -28,13 +28,13 @@
<div style="padding-left: 30px;"> <div style="padding-left: 30px;">
<table> <table>
<tr> <tr>
<td style="vertical-align: bottom;"><input type="checkbox" id="max_connec_checkbox" onClick="updateMaxConnecEnabled();"/></td><td style="text-align: right; padding-right: 3px;">_(Global maximum number of connections:)</td><td><input type="text" id="max_connec_value" style="width: 4em;"/></td> <td style="vertical-align: bottom;"><input type="checkbox" id="max_connec_checkbox" onClick="updateMaxConnecEnabled();"/></td><td style="padding-right: 3px;">_(Global maximum number of connections:)</td><td><input type="text" id="max_connec_value" style="width: 4em;"/></td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: bottom;"><input type="checkbox" id="max_connec_per_torrent_checkbox" onClick="updateMaxConnecPerTorrentEnabled();" style="margin-bottom: -2px;"/></td><td style="text-align: right; padding-right: 3px;">_(Maximum number of connections per torrent:)</td><td><input type="text" id="max_connec_per_torrent_value" style="width: 4em;"/></td> <td style="vertical-align: bottom;"><input type="checkbox" id="max_connec_per_torrent_checkbox" onClick="updateMaxConnecPerTorrentEnabled();" style="margin-bottom: -2px;"/></td><td style="padding-right: 3px;">_(Maximum number of connections per torrent:)</td><td><input type="text" id="max_connec_per_torrent_value" style="width: 4em;"/></td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: bottom;"><input type="checkbox" id="max_uploads_per_torrent_checkbox" onClick="updateMaxUploadsPerTorrentEnabled();" style="margin-bottom: -2px;"/></td><td style="text-align: right; padding-right: 3px;">_(Maximum number of upload slots per torrent:)</td><td><input type="text" id="max_uploads_per_torrent_value" style="width: 4em;"/></td> <td style="vertical-align: bottom;"><input type="checkbox" id="max_uploads_per_torrent_checkbox" onClick="updateMaxUploadsPerTorrentEnabled();" style="margin-bottom: -2px;"/></td><td style="padding-right: 3px;">_(Maximum number of upload slots per torrent:)</td><td><input type="text" id="max_uploads_per_torrent_value" style="width: 4em;"/></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -45,7 +45,7 @@
<div style="padding-left: 30px;"> <div style="padding-left: 30px;">
<table> <table>
<tr> <tr>
<td style="vertical-align: bottom;"><input type="checkbox" id="dht_checkbox"/></td><td style="text-align: right;">_(Enable DHT network (decentralized))</td> <td style="vertical-align: bottom;"><input type="checkbox" id="dht_checkbox"/></td><td>_(Enable DHT network (decentralized))</td>
</tr> </tr>
</table> </table>
</div> </div>

6
src/webui/scripts/dynamicTable.js

@ -194,21 +194,21 @@ var dynamicTable = new Class ({
} }
break; break;
case 'completed': case 'completed':
if(status == "seeding" || status == "stalledUP" || status == "checkingUP" || status == "pausedUP" || status == "queuedUP") { if(status == "uploading" || status == "stalledUP" || status == "checkingUP" || status == "pausedUP" || status == "queuedUP") {
tr.removeClass("invisible"); tr.removeClass("invisible");
} else { } else {
tr.addClass("invisible"); tr.addClass("invisible");
} }
break; break;
case 'active': case 'active':
if(status == "downloading" || status == "seeding") { if(status == "downloading" || status == "uploading") {
tr.removeClass("invisible"); tr.removeClass("invisible");
} else { } else {
tr.addClass("invisible"); tr.addClass("invisible");
} }
break; break;
case 'inactive': case 'inactive':
if(status != "downloading" && status != "seeding") { if(status != "downloading" && status != "uploading") {
tr.removeClass("invisible"); tr.removeClass("invisible");
} else { } else {
tr.addClass("invisible"); tr.addClass("invisible");

Loading…
Cancel
Save