mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 15:27:54 +00:00
Add 'unpaused' torrent filter
the inverse of paused because complete and active have an inverse
This commit is contained in:
parent
b5c00df107
commit
89f34b4ae7
BIN
src/Icons/skin/unpaused.png
Normal file
BIN
src/Icons/skin/unpaused.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 431 B |
@ -361,6 +361,7 @@
|
|||||||
<file>Icons/skin/tabs.gif</file>
|
<file>Icons/skin/tabs.gif</file>
|
||||||
<file>Icons/skin/toolbox-divider.gif</file>
|
<file>Icons/skin/toolbox-divider.gif</file>
|
||||||
<file>Icons/skin/toolbox-divider2.gif</file>
|
<file>Icons/skin/toolbox-divider2.gif</file>
|
||||||
|
<file>Icons/skin/unpaused.png</file>
|
||||||
<file>Icons/skin/uploading.png</file>
|
<file>Icons/skin/uploading.png</file>
|
||||||
<file>Icons/oxygen/system-log-out.png</file>
|
<file>Icons/oxygen/system-log-out.png</file>
|
||||||
<file>Icons/oxygen/go-bottom.png</file>
|
<file>Icons/oxygen/go-bottom.png</file>
|
||||||
|
@ -32,6 +32,6 @@
|
|||||||
#define TORRENTFILTERENUM_H
|
#define TORRENTFILTERENUM_H
|
||||||
|
|
||||||
namespace TorrentFilter {
|
namespace TorrentFilter {
|
||||||
enum TorrentFilter {ALL, DOWNLOADING, COMPLETED, PAUSED, ACTIVE, INACTIVE};
|
enum TorrentFilter {ALL, DOWNLOADING, COMPLETED, PAUSED, UNPAUSED, ACTIVE, INACTIVE};
|
||||||
}
|
}
|
||||||
#endif // TORRENTFILTERENUM_H
|
#endif // TORRENTFILTERENUM_H
|
||||||
|
@ -194,6 +194,9 @@ TransferListFiltersWidget::TransferListFiltersWidget(QWidget *parent, TransferLi
|
|||||||
QListWidgetItem *paused = new QListWidgetItem(statusFilters);
|
QListWidgetItem *paused = new QListWidgetItem(statusFilters);
|
||||||
paused->setData(Qt::DisplayRole, QVariant(tr("Paused") + " (0)"));
|
paused->setData(Qt::DisplayRole, QVariant(tr("Paused") + " (0)"));
|
||||||
paused->setData(Qt::DecorationRole, QIcon(":/Icons/skin/paused.png"));
|
paused->setData(Qt::DecorationRole, QIcon(":/Icons/skin/paused.png"));
|
||||||
|
QListWidgetItem *unpaused = new QListWidgetItem(statusFilters);
|
||||||
|
unpaused->setData(Qt::DisplayRole, QVariant(tr("Unpaused") + " (0)"));
|
||||||
|
unpaused->setData(Qt::DecorationRole, QIcon(":/Icons/skin/unpaused.png"));
|
||||||
QListWidgetItem *active = new QListWidgetItem(statusFilters);
|
QListWidgetItem *active = new QListWidgetItem(statusFilters);
|
||||||
active->setData(Qt::DisplayRole, QVariant(tr("Active") + " (0)"));
|
active->setData(Qt::DisplayRole, QVariant(tr("Active") + " (0)"));
|
||||||
active->setData(Qt::DecorationRole, QIcon(":/Icons/skin/filteractive.png"));
|
active->setData(Qt::DecorationRole, QIcon(":/Icons/skin/filteractive.png"));
|
||||||
@ -265,6 +268,7 @@ void TransferListFiltersWidget::updateTorrentNumbers() {
|
|||||||
statusFilters->item(TorrentFilter::DOWNLOADING)->setData(Qt::DisplayRole, QVariant(tr("Downloading")+" ("+QString::number(report.nb_downloading)+")"));
|
statusFilters->item(TorrentFilter::DOWNLOADING)->setData(Qt::DisplayRole, QVariant(tr("Downloading")+" ("+QString::number(report.nb_downloading)+")"));
|
||||||
statusFilters->item(TorrentFilter::COMPLETED)->setData(Qt::DisplayRole, QVariant(tr("Completed")+" ("+QString::number(report.nb_seeding)+")"));
|
statusFilters->item(TorrentFilter::COMPLETED)->setData(Qt::DisplayRole, QVariant(tr("Completed")+" ("+QString::number(report.nb_seeding)+")"));
|
||||||
statusFilters->item(TorrentFilter::PAUSED)->setData(Qt::DisplayRole, QVariant(tr("Paused")+" ("+QString::number(report.nb_paused)+")"));
|
statusFilters->item(TorrentFilter::PAUSED)->setData(Qt::DisplayRole, QVariant(tr("Paused")+" ("+QString::number(report.nb_paused)+")"));
|
||||||
|
statusFilters->item(TorrentFilter::UNPAUSED)->setData(Qt::DisplayRole, QVariant(tr("Unpaused")+" ("+QString::number(report.nb_active+report.nb_inactive-report.nb_paused)+")"));
|
||||||
statusFilters->item(TorrentFilter::ACTIVE)->setData(Qt::DisplayRole, QVariant(tr("Active")+" ("+QString::number(report.nb_active)+")"));
|
statusFilters->item(TorrentFilter::ACTIVE)->setData(Qt::DisplayRole, QVariant(tr("Active")+" ("+QString::number(report.nb_active)+")"));
|
||||||
statusFilters->item(TorrentFilter::INACTIVE)->setData(Qt::DisplayRole, QVariant(tr("Inactive")+" ("+QString::number(report.nb_inactive)+")"));
|
statusFilters->item(TorrentFilter::INACTIVE)->setData(Qt::DisplayRole, QVariant(tr("Inactive")+" ("+QString::number(report.nb_inactive)+")"));
|
||||||
}
|
}
|
||||||
|
@ -222,6 +222,9 @@ bool TransferListSortModel::matchStatusFilter(int sourceRow, const QModelIndex &
|
|||||||
case TorrentFilter::PAUSED:
|
case TorrentFilter::PAUSED:
|
||||||
return (state == TorrentModelItem::STATE_PAUSED_UP || state == TorrentModelItem::STATE_PAUSED_DL);
|
return (state == TorrentModelItem::STATE_PAUSED_UP || state == TorrentModelItem::STATE_PAUSED_DL);
|
||||||
|
|
||||||
|
case TorrentFilter::UNPAUSED:
|
||||||
|
return (state != TorrentModelItem::STATE_PAUSED_UP && state != TorrentModelItem::STATE_PAUSED_DL);
|
||||||
|
|
||||||
case TorrentFilter::ACTIVE:
|
case TorrentFilter::ACTIVE:
|
||||||
if (state == TorrentModelItem::STATE_STALLED_DL) {
|
if (state == TorrentModelItem::STATE_STALLED_DL) {
|
||||||
const qulonglong up_speed = model->index(sourceRow, TorrentModelItem::TR_UPSPEED, sourceParent).data().toULongLong();
|
const qulonglong up_speed = model->index(sourceRow, TorrentModelItem::TR_UPSPEED, sourceParent).data().toULongLong();
|
||||||
|
Loading…
Reference in New Issue
Block a user