mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-05 19:34:17 +00:00
Add filter "Checking" to side panel (#15166)
This commit is contained in:
parent
933e56494c
commit
e5943b64c1
@ -45,6 +45,7 @@ const TorrentFilter TorrentFilter::InactiveTorrent(TorrentFilter::Inactive);
|
|||||||
const TorrentFilter TorrentFilter::StalledTorrent(TorrentFilter::Stalled);
|
const TorrentFilter TorrentFilter::StalledTorrent(TorrentFilter::Stalled);
|
||||||
const TorrentFilter TorrentFilter::StalledUploadingTorrent(TorrentFilter::StalledUploading);
|
const TorrentFilter TorrentFilter::StalledUploadingTorrent(TorrentFilter::StalledUploading);
|
||||||
const TorrentFilter TorrentFilter::StalledDownloadingTorrent(TorrentFilter::StalledDownloading);
|
const TorrentFilter TorrentFilter::StalledDownloadingTorrent(TorrentFilter::StalledDownloading);
|
||||||
|
const TorrentFilter TorrentFilter::CheckingTorrent(TorrentFilter::Checking);
|
||||||
const TorrentFilter TorrentFilter::ErroredTorrent(TorrentFilter::Errored);
|
const TorrentFilter TorrentFilter::ErroredTorrent(TorrentFilter::Errored);
|
||||||
|
|
||||||
using BitTorrent::Torrent;
|
using BitTorrent::Torrent;
|
||||||
@ -101,6 +102,8 @@ bool TorrentFilter::setTypeByName(const QString &filter)
|
|||||||
type = StalledUploading;
|
type = StalledUploading;
|
||||||
else if (filter == "stalled_downloading")
|
else if (filter == "stalled_downloading")
|
||||||
type = StalledDownloading;
|
type = StalledDownloading;
|
||||||
|
else if (filter == "checking")
|
||||||
|
type = Checking;
|
||||||
else if (filter == "errored")
|
else if (filter == "errored")
|
||||||
type = Errored;
|
type = Errored;
|
||||||
|
|
||||||
@ -180,6 +183,10 @@ bool TorrentFilter::matchState(const BitTorrent::Torrent *const torrent) const
|
|||||||
return torrent->state() == BitTorrent::TorrentState::StalledUploading;
|
return torrent->state() == BitTorrent::TorrentState::StalledUploading;
|
||||||
case StalledDownloading:
|
case StalledDownloading:
|
||||||
return torrent->state() == BitTorrent::TorrentState::StalledDownloading;
|
return torrent->state() == BitTorrent::TorrentState::StalledDownloading;
|
||||||
|
case Checking:
|
||||||
|
return (torrent->state() == BitTorrent::TorrentState::CheckingUploading)
|
||||||
|
|| (torrent->state() == BitTorrent::TorrentState::CheckingDownloading)
|
||||||
|
|| (torrent->state() == BitTorrent::TorrentState::CheckingResumeData);
|
||||||
case Errored:
|
case Errored:
|
||||||
return torrent->isErrored();
|
return torrent->isErrored();
|
||||||
default: // All
|
default: // All
|
||||||
|
@ -56,6 +56,7 @@ public:
|
|||||||
Stalled,
|
Stalled,
|
||||||
StalledUploading,
|
StalledUploading,
|
||||||
StalledDownloading,
|
StalledDownloading,
|
||||||
|
Checking,
|
||||||
Errored
|
Errored
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -74,6 +75,7 @@ public:
|
|||||||
static const TorrentFilter StalledTorrent;
|
static const TorrentFilter StalledTorrent;
|
||||||
static const TorrentFilter StalledUploadingTorrent;
|
static const TorrentFilter StalledUploadingTorrent;
|
||||||
static const TorrentFilter StalledDownloadingTorrent;
|
static const TorrentFilter StalledDownloadingTorrent;
|
||||||
|
static const TorrentFilter CheckingTorrent;
|
||||||
static const TorrentFilter ErroredTorrent;
|
static const TorrentFilter ErroredTorrent;
|
||||||
|
|
||||||
TorrentFilter() = default;
|
TorrentFilter() = default;
|
||||||
|
@ -212,6 +212,9 @@ StatusFilterWidget::StatusFilterWidget(QWidget *parent, TransferListWidget *tran
|
|||||||
auto *stalledDownloading = new QListWidgetItem(this);
|
auto *stalledDownloading = new QListWidgetItem(this);
|
||||||
stalledDownloading->setData(Qt::DisplayRole, tr("Stalled Downloading (0)"));
|
stalledDownloading->setData(Qt::DisplayRole, tr("Stalled Downloading (0)"));
|
||||||
stalledDownloading->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(QLatin1String("stalledDL")));
|
stalledDownloading->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(QLatin1String("stalledDL")));
|
||||||
|
auto *checking = new QListWidgetItem(this);
|
||||||
|
checking->setData(Qt::DisplayRole, tr("Checking (0)"));
|
||||||
|
checking->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(QLatin1String("checking")));
|
||||||
auto *errored = new QListWidgetItem(this);
|
auto *errored = new QListWidgetItem(this);
|
||||||
errored->setData(Qt::DisplayRole, tr("Errored (0)"));
|
errored->setData(Qt::DisplayRole, tr("Errored (0)"));
|
||||||
errored->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(QLatin1String("error")));
|
errored->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(QLatin1String("error")));
|
||||||
@ -238,6 +241,7 @@ void StatusFilterWidget::updateTorrentNumbers()
|
|||||||
int nbStalled = 0;
|
int nbStalled = 0;
|
||||||
int nbStalledUploading = 0;
|
int nbStalledUploading = 0;
|
||||||
int nbStalledDownloading = 0;
|
int nbStalledDownloading = 0;
|
||||||
|
int nbChecking = 0;
|
||||||
int nbErrored = 0;
|
int nbErrored = 0;
|
||||||
|
|
||||||
const QVector<BitTorrent::Torrent *> torrents = BitTorrent::Session::instance()->torrents();
|
const QVector<BitTorrent::Torrent *> torrents = BitTorrent::Session::instance()->torrents();
|
||||||
@ -261,6 +265,8 @@ void StatusFilterWidget::updateTorrentNumbers()
|
|||||||
++nbStalledUploading;
|
++nbStalledUploading;
|
||||||
if (torrent->state() == BitTorrent::TorrentState::StalledDownloading)
|
if (torrent->state() == BitTorrent::TorrentState::StalledDownloading)
|
||||||
++nbStalledDownloading;
|
++nbStalledDownloading;
|
||||||
|
if (torrent->isChecking())
|
||||||
|
++nbChecking;
|
||||||
if (torrent->isErrored())
|
if (torrent->isErrored())
|
||||||
++nbErrored;
|
++nbErrored;
|
||||||
}
|
}
|
||||||
@ -278,6 +284,7 @@ void StatusFilterWidget::updateTorrentNumbers()
|
|||||||
item(TorrentFilter::Stalled)->setData(Qt::DisplayRole, tr("Stalled (%1)").arg(nbStalled));
|
item(TorrentFilter::Stalled)->setData(Qt::DisplayRole, tr("Stalled (%1)").arg(nbStalled));
|
||||||
item(TorrentFilter::StalledUploading)->setData(Qt::DisplayRole, tr("Stalled Uploading (%1)").arg(nbStalledUploading));
|
item(TorrentFilter::StalledUploading)->setData(Qt::DisplayRole, tr("Stalled Uploading (%1)").arg(nbStalledUploading));
|
||||||
item(TorrentFilter::StalledDownloading)->setData(Qt::DisplayRole, tr("Stalled Downloading (%1)").arg(nbStalledDownloading));
|
item(TorrentFilter::StalledDownloading)->setData(Qt::DisplayRole, tr("Stalled Downloading (%1)").arg(nbStalledDownloading));
|
||||||
|
item(TorrentFilter::Checking)->setData(Qt::DisplayRole, tr("Checking (%1)").arg(nbChecking));
|
||||||
item(TorrentFilter::Errored)->setData(Qt::DisplayRole, tr("Errored (%1)").arg(nbErrored));
|
item(TorrentFilter::Errored)->setData(Qt::DisplayRole, tr("Errored (%1)").arg(nbErrored));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,6 +225,7 @@ window.addEvent('load', function() {
|
|||||||
$("stalled_filter").removeClass("selectedFilter");
|
$("stalled_filter").removeClass("selectedFilter");
|
||||||
$("stalled_uploading_filter").removeClass("selectedFilter");
|
$("stalled_uploading_filter").removeClass("selectedFilter");
|
||||||
$("stalled_downloading_filter").removeClass("selectedFilter");
|
$("stalled_downloading_filter").removeClass("selectedFilter");
|
||||||
|
$("checking_filter").removeClass("selectedFilter");
|
||||||
$("errored_filter").removeClass("selectedFilter");
|
$("errored_filter").removeClass("selectedFilter");
|
||||||
$(f + "_filter").addClass("selectedFilter");
|
$(f + "_filter").addClass("selectedFilter");
|
||||||
selected_filter = f;
|
selected_filter = f;
|
||||||
@ -383,6 +384,7 @@ window.addEvent('load', function() {
|
|||||||
updateFilter('stalled', 'QBT_TR(Stalled (%1))QBT_TR[CONTEXT=StatusFilterWidget]');
|
updateFilter('stalled', 'QBT_TR(Stalled (%1))QBT_TR[CONTEXT=StatusFilterWidget]');
|
||||||
updateFilter('stalled_uploading', 'QBT_TR(Stalled Uploading (%1))QBT_TR[CONTEXT=StatusFilterWidget]');
|
updateFilter('stalled_uploading', 'QBT_TR(Stalled Uploading (%1))QBT_TR[CONTEXT=StatusFilterWidget]');
|
||||||
updateFilter('stalled_downloading', 'QBT_TR(Stalled Downloading (%1))QBT_TR[CONTEXT=StatusFilterWidget]');
|
updateFilter('stalled_downloading', 'QBT_TR(Stalled Downloading (%1))QBT_TR[CONTEXT=StatusFilterWidget]');
|
||||||
|
updateFilter('checking', 'QBT_TR(Checking (%1))QBT_TR[CONTEXT=StatusFilterWidget]');
|
||||||
updateFilter('errored', 'QBT_TR(Errored (%1))QBT_TR[CONTEXT=StatusFilterWidget]');
|
updateFilter('errored', 'QBT_TR(Errored (%1))QBT_TR[CONTEXT=StatusFilterWidget]');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1314,6 +1314,10 @@ window.qBittorrent.DynamicTable = (function() {
|
|||||||
if (r == inactive)
|
if (r == inactive)
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
case 'checking':
|
||||||
|
if (state !== 'checkingUP' && state !== 'checkingDL' && state !== 'checkingResumeData')
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
case 'errored':
|
case 'errored':
|
||||||
if (state != 'error' && state != "unknown" && state != "missingFiles")
|
if (state != 'error' && state != "unknown" && state != "missingFiles")
|
||||||
return false;
|
return false;
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
<li id="stalled_filter"><a href="#" onclick="setFilter('stalled');return false;"><img src="icons/filterstalled.svg" alt="Stalled" />QBT_TR(Stalled (0))QBT_TR[CONTEXT=StatusFilterWidget]</a></li>
|
<li id="stalled_filter"><a href="#" onclick="setFilter('stalled');return false;"><img src="icons/filterstalled.svg" alt="Stalled" />QBT_TR(Stalled (0))QBT_TR[CONTEXT=StatusFilterWidget]</a></li>
|
||||||
<li id="stalled_uploading_filter"><a href="#" onclick="setFilter('stalled_uploading');return false;"><img src="icons/stalledUP.svg" alt="Stalled Uploading" />QBT_TR(Stalled Uploading (0))QBT_TR[CONTEXT=StatusFilterWidget]</a></li>
|
<li id="stalled_uploading_filter"><a href="#" onclick="setFilter('stalled_uploading');return false;"><img src="icons/stalledUP.svg" alt="Stalled Uploading" />QBT_TR(Stalled Uploading (0))QBT_TR[CONTEXT=StatusFilterWidget]</a></li>
|
||||||
<li id="stalled_downloading_filter"><a href="#" onclick="setFilter('stalled_downloading');return false;"><img src="icons/stalledDL.svg" alt="Stalled Downloading" />QBT_TR(Stalled Downloading (0))QBT_TR[CONTEXT=StatusFilterWidget]</a></li>
|
<li id="stalled_downloading_filter"><a href="#" onclick="setFilter('stalled_downloading');return false;"><img src="icons/stalledDL.svg" alt="Stalled Downloading" />QBT_TR(Stalled Downloading (0))QBT_TR[CONTEXT=StatusFilterWidget]</a></li>
|
||||||
|
<li id="checking_filter"><a href="#" onclick="setFilter('checking'); return false;"><img src="icons/checking.svg" alt="Checking" />QBT_TR(Checking (0))QBT_TR[CONTEXT=StatusFilterWidget]</a></li>
|
||||||
<li id="errored_filter"><a href="#" onclick="setFilter('errored');return false;"><img src="icons/error.svg" alt="Errored" />QBT_TR(Errored (0))QBT_TR[CONTEXT=StatusFilterWidget]</a></li>
|
<li id="errored_filter"><a href="#" onclick="setFilter('errored');return false;"><img src="icons/error.svg" alt="Errored" />QBT_TR(Errored (0))QBT_TR[CONTEXT=StatusFilterWidget]</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user