Browse Source

- New torrent status icons by Mateusz Tobola

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
3eeeb73af4
  1. BIN
      src/Icons/oxygen/draw-rectangle.png
  2. BIN
      src/Icons/oxygen/draw-triangle2.png
  3. BIN
      src/Icons/skin/checkingDL.png
  4. BIN
      src/Icons/skin/checkingUP.png
  5. BIN
      src/Icons/skin/downloading.png
  6. BIN
      src/Icons/skin/filteractive.png
  7. BIN
      src/Icons/skin/filterall.png
  8. BIN
      src/Icons/skin/filterinactive.png
  9. BIN
      src/Icons/skin/pausedDL.png
  10. BIN
      src/Icons/skin/pausedUP.png
  11. BIN
      src/Icons/skin/queuedDL.png
  12. BIN
      src/Icons/skin/queuedUP.png
  13. BIN
      src/Icons/skin/stalledDL.png
  14. BIN
      src/Icons/skin/stalledUP.png
  15. BIN
      src/Icons/skin/uploading.png
  16. 14
      src/icons.qrc
  17. 8
      src/transferlistfilterswidget.h
  18. 53
      src/transferlistwidget.cpp

BIN
src/Icons/oxygen/draw-rectangle.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

BIN
src/Icons/oxygen/draw-triangle2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 670 B

BIN
src/Icons/skin/checkingDL.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
src/Icons/skin/checkingUP.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
src/Icons/skin/downloading.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
src/Icons/skin/filteractive.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
src/Icons/skin/filterall.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
src/Icons/skin/filterinactive.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
src/Icons/skin/pausedDL.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
src/Icons/skin/pausedUP.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
src/Icons/skin/queuedDL.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
src/Icons/skin/queuedUP.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
src/Icons/skin/stalledDL.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
src/Icons/skin/stalledUP.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
src/Icons/skin/uploading.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

14
src/icons.qrc

@ -10,23 +10,32 @@
<file>Icons/sphere.png</file> <file>Icons/sphere.png</file>
<file>Icons/uparrow.png</file> <file>Icons/uparrow.png</file>
<file>Icons/rss16.png</file> <file>Icons/rss16.png</file>
<file>Icons/skin/checkingUP.png</file>
<file>Icons/skin/play.png</file> <file>Icons/skin/play.png</file>
<file>Icons/skin/qbittorrent22.png</file> <file>Icons/skin/qbittorrent22.png</file>
<file>Icons/skin/queuedDL.png</file>
<file>Icons/skin/new.png</file> <file>Icons/skin/new.png</file>
<file>Icons/skin/queuedUP.png</file>
<file>Icons/skin/preview.png</file> <file>Icons/skin/preview.png</file>
<file>Icons/skin/stalled.png</file> <file>Icons/skin/stalled.png</file>
<file>Icons/skin/delete.png</file> <file>Icons/skin/delete.png</file>
<file>Icons/skin/url.png</file> <file>Icons/skin/url.png</file>
<file>Icons/skin/stalledUP.png</file>
<file>Icons/skin/filteractive.png</file>
<file>Icons/skin/connected.png</file> <file>Icons/skin/connected.png</file>
<file>Icons/skin/pausedDL.png</file>
<file>Icons/skin/mascot.png</file> <file>Icons/skin/mascot.png</file>
<file>Icons/skin/pausedUP.png</file>
<file>Icons/skin/seeding.png</file> <file>Icons/skin/seeding.png</file>
<file>Icons/skin/increase.png</file> <file>Icons/skin/increase.png</file>
<file>Icons/skin/qbittorrent32.png</file> <file>Icons/skin/qbittorrent32.png</file>
<file>Icons/skin/paused.png</file> <file>Icons/skin/paused.png</file>
<file>Icons/skin/stalledDL.png</file>
<file>Icons/skin/qb_question.png</file> <file>Icons/skin/qb_question.png</file>
<file>Icons/skin/open.png</file> <file>Icons/skin/open.png</file>
<file>Icons/skin/qbittorrent16.png</file> <file>Icons/skin/qbittorrent16.png</file>
<file>Icons/skin/downloading.png</file> <file>Icons/skin/downloading.png</file>
<file>Icons/skin/filterinactive.png</file>
<file>Icons/skin/pause_all.png</file> <file>Icons/skin/pause_all.png</file>
<file>Icons/skin/play_all.png</file> <file>Icons/skin/play_all.png</file>
<file>Icons/skin/pause.png</file> <file>Icons/skin/pause.png</file>
@ -35,11 +44,14 @@
<file>Icons/skin/info.png</file> <file>Icons/skin/info.png</file>
<file>Icons/skin/tabs.gif</file> <file>Icons/skin/tabs.gif</file>
<file>Icons/skin/delete_perm.png</file> <file>Icons/skin/delete_perm.png</file>
<file>Icons/skin/checkingDL.png</file>
<file>Icons/skin/settings.png</file> <file>Icons/skin/settings.png</file>
<file>Icons/skin/exit.png</file> <file>Icons/skin/exit.png</file>
<file>Icons/skin/delete_all.png</file> <file>Icons/skin/delete_all.png</file>
<file>Icons/skin/splash.png</file> <file>Icons/skin/splash.png</file>
<file>Icons/skin/decrease.png</file> <file>Icons/skin/decrease.png</file>
<file>Icons/skin/uploading.png</file>
<file>Icons/skin/filterall.png</file>
<file>Icons/flags/czech.png</file> <file>Icons/flags/czech.png</file>
<file>Icons/flags/serbia.png</file> <file>Icons/flags/serbia.png</file>
<file>Icons/flags/iceland.png</file> <file>Icons/flags/iceland.png</file>
@ -123,7 +135,6 @@
<file>Icons/oxygen/download.png</file> <file>Icons/oxygen/download.png</file>
<file>Icons/oxygen/application-x-kgetlist-no.png</file> <file>Icons/oxygen/application-x-kgetlist-no.png</file>
<file>Icons/oxygen/gear.png</file> <file>Icons/oxygen/gear.png</file>
<file>Icons/oxygen/draw-triangle2.png</file>
<file>Icons/oxygen/remove.png</file> <file>Icons/oxygen/remove.png</file>
<file>Icons/oxygen/dialog-warning.png</file> <file>Icons/oxygen/dialog-warning.png</file>
<file>Icons/oxygen/peer.png</file> <file>Icons/oxygen/peer.png</file>
@ -148,7 +159,6 @@
<file>Icons/oxygen/urlseed.png</file> <file>Icons/oxygen/urlseed.png</file>
<file>Icons/oxygen/edit-cut.png</file> <file>Icons/oxygen/edit-cut.png</file>
<file>Icons/oxygen/unsubscribe.png</file> <file>Icons/oxygen/unsubscribe.png</file>
<file>Icons/oxygen/draw-rectangle.png</file>
<file>Icons/oxygen/subscribe16.png</file> <file>Icons/oxygen/subscribe16.png</file>
</qresource> </qresource>
</RCC> </RCC>

8
src/transferlistfilterswidget.h

@ -49,19 +49,19 @@ public:
// Add filters // Add filters
QListWidgetItem *all = new QListWidgetItem(this); QListWidgetItem *all = new QListWidgetItem(this);
all->setData(Qt::DisplayRole, tr("All") + " (0)"); all->setData(Qt::DisplayRole, tr("All") + " (0)");
all->setData(Qt::DecorationRole, QIcon(":/Icons/oxygen/folder-remote16.png")); all->setData(Qt::DecorationRole, QIcon(":/Icons/skin/filterall.png"));
QListWidgetItem *downloading = new QListWidgetItem(this); QListWidgetItem *downloading = new QListWidgetItem(this);
downloading->setData(Qt::DisplayRole, tr("Downloading") + " (0)"); downloading->setData(Qt::DisplayRole, tr("Downloading") + " (0)");
downloading->setData(Qt::DecorationRole, QIcon(":/Icons/skin/downloading.png")); downloading->setData(Qt::DecorationRole, QIcon(":/Icons/skin/downloading.png"));
QListWidgetItem *completed = new QListWidgetItem(this); QListWidgetItem *completed = new QListWidgetItem(this);
completed->setData(Qt::DisplayRole, tr("Completed") + " (0)"); completed->setData(Qt::DisplayRole, tr("Completed") + " (0)");
completed->setData(Qt::DecorationRole, QIcon(":/Icons/skin/seeding.png")); completed->setData(Qt::DecorationRole, QIcon(":/Icons/skin/uploading.png"));
QListWidgetItem *active = new QListWidgetItem(this); QListWidgetItem *active = new QListWidgetItem(this);
active->setData(Qt::DisplayRole, tr("Active") + " (0)"); active->setData(Qt::DisplayRole, tr("Active") + " (0)");
active->setData(Qt::DecorationRole, QIcon(":/Icons/oxygen/draw-triangle2.png")); active->setData(Qt::DecorationRole, QIcon(":/Icons/skin/filteractive.png"));
QListWidgetItem *inactive = new QListWidgetItem(this); QListWidgetItem *inactive = new QListWidgetItem(this);
inactive->setData(Qt::DisplayRole, tr("Inactive") + " (0)"); inactive->setData(Qt::DisplayRole, tr("Inactive") + " (0)");
inactive->setData(Qt::DecorationRole, QIcon(":/Icons/oxygen/draw-rectangle.png")); inactive->setData(Qt::DecorationRole, QIcon(":/Icons/skin/filterinactive.png"));
// SIGNAL/SLOT // SIGNAL/SLOT
connect(this, SIGNAL(currentRowChanged(int)), transferList, SLOT(applyFilter(int))); connect(this, SIGNAL(currentRowChanged(int)), transferList, SLOT(applyFilter(int)));

53
src/transferlistwidget.cpp

@ -155,18 +155,20 @@ void TransferListWidget::addTorrent(QTorrentHandle& h) {
listModel->setData(listModel->index(row, TR_HASH), QVariant(h.hash())); listModel->setData(listModel->index(row, TR_HASH), QVariant(h.hash()));
// Pause torrent if it is // Pause torrent if it is
if(h.is_paused()) { if(h.is_paused()) {
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/paused.png"))), Qt::DecorationRole); if(h.is_seed()) {
if(h.is_seed())
listModel->setData(listModel->index(row, TR_STATUS), STATE_PAUSED_UP); listModel->setData(listModel->index(row, TR_STATUS), STATE_PAUSED_UP);
else listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/pausedUP.png"))), Qt::DecorationRole);
} else {
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);
}
//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/seeding.png"))), Qt::DecorationRole); listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/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);
} else { } else {
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/stalled.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, QString::fromUtf8("grey"));
@ -204,11 +206,12 @@ void TransferListWidget::pauseTorrent(int row, bool refresh_list) {
listModel->setData(listModel->index(row, TR_DLSPEED), QVariant((double)0.0)); listModel->setData(listModel->index(row, TR_DLSPEED), QVariant((double)0.0));
listModel->setData(listModel->index(row, TR_UPSPEED), QVariant((double)0.0)); listModel->setData(listModel->index(row, TR_UPSPEED), QVariant((double)0.0));
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_NAME), QIcon(QString::fromUtf8(":/Icons/skin/paused.png")), Qt::DecorationRole);
if(h.is_seed()) { if(h.is_seed()) {
listModel->setData(listModel->index(row, TR_STATUS), STATE_PAUSED_UP); listModel->setData(listModel->index(row, TR_STATUS), STATE_PAUSED_UP);
listModel->setData(listModel->index(row, TR_NAME), QIcon(QString::fromUtf8(":/Icons/skin/pausedUP.png")), Qt::DecorationRole);
} else { } else {
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), QIcon(QString::fromUtf8(":/Icons/skin/pausedDL.png")), Qt::DecorationRole);
} }
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));
@ -226,10 +229,10 @@ void TransferListWidget::resumeTorrent(int row, bool refresh_list) {
QTorrentHandle h = BTSession->getTorrentHandle(getHashFromRow(row)); QTorrentHandle h = BTSession->getTorrentHandle(getHashFromRow(row));
if(!h.is_valid()) return; if(!h.is_valid()) return;
if(h.is_seed()) { if(h.is_seed()) {
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(":/Icons/skin/seeding.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);
} else { } else {
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(":/Icons/skin/stalled.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);
} }
if(refresh_list) if(refresh_list)
@ -261,20 +264,24 @@ int TransferListWidget::updateTorrent(int row) {
listModel->setData(listModel->index(row, TR_PRIORITY), QVariant((int)h.queue_position())); listModel->setData(listModel->index(row, TR_PRIORITY), QVariant((int)h.queue_position()));
if(h.is_queued()) { if(h.is_queued()) {
if(h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking) { if(h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking) {
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/oxygen/run-build.png"))), Qt::DecorationRole);
listModel->setData(listModel->index(row, TR_PROGRESS), QVariant((double)h.progress())); listModel->setData(listModel->index(row, TR_PROGRESS), QVariant((double)h.progress()));
if(h.is_seed()) if(h.is_seed()) {
s = STATE_CHECKING_UP; s = STATE_CHECKING_UP;
else listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/checkingUP.png"))), Qt::DecorationRole);
} else {
s = STATE_CHECKING_DL; s = STATE_CHECKING_DL;
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/checkingDL.png"))), Qt::DecorationRole);
}
listModel->setData(listModel->index(row, TR_STATUS), s); listModel->setData(listModel->index(row, TR_STATUS), s);
}else { }else {
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/oxygen/mail-queue.png"))), Qt::DecorationRole);
listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)-1)); listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)-1));
if(h.is_seed()) if(h.is_seed()) {
s = STATE_QUEUED_UP; s = STATE_QUEUED_UP;
else listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/queuedUP.png"))), Qt::DecorationRole);
} else {
s =STATE_QUEUED_DL; s =STATE_QUEUED_DL;
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/queuedDL.png"))), Qt::DecorationRole);
}
listModel->setData(listModel->index(row, TR_STATUS), s); listModel->setData(listModel->index(row, TR_STATUS), s);
} }
// Reset speeds and seeds/leech // Reset speeds and seeds/leech
@ -312,11 +319,15 @@ int TransferListWidget::updateTorrent(int row) {
case torrent_status::checking_files: case torrent_status::checking_files:
case torrent_status::queued_for_checking: case torrent_status::queued_for_checking:
case torrent_status::checking_resume_data: case torrent_status::checking_resume_data:
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/oxygen/run-build.png"))), Qt::DecorationRole); if(h.is_seed()) {
if(h.is_seed())
s = STATE_CHECKING_UP; s = STATE_CHECKING_UP;
else
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/checkingUP.png"))), Qt::DecorationRole);
} else {
s = STATE_CHECKING_DL; s = STATE_CHECKING_DL;
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/checkingDL.png"))), Qt::DecorationRole);
}
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"));
@ -329,7 +340,7 @@ int TransferListWidget::updateTorrent(int row) {
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/stalled.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));
@ -364,11 +375,11 @@ void TransferListWidget::setFinished(QTorrentHandle &h) {
row = getRowFromHash(h.hash()); row = getRowFromHash(h.hash());
if(row >= 0) { if(row >= 0) {
if(h.is_paused()) { if(h.is_paused()) {
listModel->setData(listModel->index(row, TR_NAME), QIcon(":/Icons/skin/paused.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/seeding.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, "orange");
} }

Loading…
Cancel
Save