mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 04:54:18 +00:00
Add 'Resumed' filter
This commit is contained in:
parent
0f56440dec
commit
f5f9e206fb
@ -39,6 +39,8 @@ QTorrentFilter::QTorrentFilter(QString filter, QString label)
|
||||
type_ = Completed;
|
||||
else if (filter == "paused")
|
||||
type_ = Paused;
|
||||
else if (filter == "resumed")
|
||||
type_ = Resumed;
|
||||
else if (filter == "active")
|
||||
type_ = Active;
|
||||
else if (filter == "inactive")
|
||||
@ -57,6 +59,8 @@ bool QTorrentFilter::apply(const QTorrentHandle& h) const
|
||||
return isTorrentCompleted(h);
|
||||
case Paused:
|
||||
return isTorrentPaused(h);
|
||||
case Resumed:
|
||||
return isTorrentResumed(h);
|
||||
case Active:
|
||||
return isTorrentActive(h);
|
||||
case Inactive:
|
||||
@ -98,6 +102,14 @@ bool QTorrentFilter::isTorrentPaused(const QTorrentHandle &h) const
|
||||
|| state == QTorrentState::Error;
|
||||
}
|
||||
|
||||
bool QTorrentFilter::isTorrentResumed(const QTorrentHandle &h) const
|
||||
{
|
||||
const QTorrentState state = h.torrentState();
|
||||
|
||||
return state != QTorrentState::PausedUploading
|
||||
&& state != QTorrentState::PausedDownloading;
|
||||
}
|
||||
|
||||
bool QTorrentFilter::isTorrentActive(const QTorrentHandle &h) const
|
||||
{
|
||||
const QTorrentState state = h.torrentState();
|
||||
|
@ -40,6 +40,7 @@ public:
|
||||
Downloading,
|
||||
Completed,
|
||||
Paused,
|
||||
Resumed,
|
||||
Active,
|
||||
Inactive
|
||||
};
|
||||
@ -55,6 +56,7 @@ private:
|
||||
bool isTorrentDownloading(const QTorrentHandle &h) const;
|
||||
bool isTorrentCompleted(const QTorrentHandle &h) const;
|
||||
bool isTorrentPaused(const QTorrentHandle &h) const;
|
||||
bool isTorrentResumed(const QTorrentHandle &h) const;
|
||||
bool isTorrentActive(const QTorrentHandle &h) const;
|
||||
bool isTorrentInactive(const QTorrentHandle &h) const;
|
||||
bool torrentHasLabel(const QTorrentHandle &h) const;
|
||||
|
@ -212,7 +212,7 @@ void WebApplication::action_public_images()
|
||||
}
|
||||
|
||||
// GET params:
|
||||
// - filter (string): all, downloading, completed, paused, active, inactive
|
||||
// - filter (string): all, downloading, completed, paused, resumed, active, inactive
|
||||
// - label (string): torrent label for filtering by it (empty string means "unlabeled"; no "label" param presented means "any label")
|
||||
// - sort (string): name of column for sorting by its value
|
||||
// - reverse (bool): enable reverse sorting
|
||||
|
@ -2,6 +2,7 @@
|
||||
<li id="all_filter"><a href="#" onclick="setFilter('all');return false;"><img src="images/skin/filterall.png"/>QBT_TR(All)QBT_TR</a></li>
|
||||
<li id="downloading_filter"><a href="#" onclick="setFilter('downloading');return false;"><img src="images/skin/downloading.png"/>QBT_TR(Downloading)QBT_TR</a></li>
|
||||
<li id="completed_filter"><a href="#" onclick="setFilter('completed');return false;"><img src="images/skin/uploading.png"/>QBT_TR(Completed)QBT_TR</a></li>
|
||||
<li id="resumed_filter"><a href="#" onclick="setFilter('resumed');return false;"><img src="images/skin/resumed.png"/>QBT_TR(Resumed)QBT_TR</a></li>
|
||||
<li id="paused_filter"><a href="#" onclick="setFilter('paused');return false;"><img src="images/skin/paused.png"/>QBT_TR(Paused)QBT_TR</a></li>
|
||||
<li id="active_filter"><a href="#" onclick="setFilter('active');return false;"><img src="images/skin/filteractive.png"/>QBT_TR(Active)QBT_TR</a></li>
|
||||
<li id="inactive_filter"><a href="#" onclick="setFilter('inactive');return false;"><img src="images/skin/filterinactive.png"/>QBT_TR(Inactive)QBT_TR</a></li>
|
||||
|
@ -96,6 +96,7 @@ window.addEvent('load', function () {
|
||||
$("downloading_filter").removeClass("selectedFilter");
|
||||
$("completed_filter").removeClass("selectedFilter");
|
||||
$("paused_filter").removeClass("selectedFilter");
|
||||
$("resumed_filter").removeClass("selectedFilter");
|
||||
$("active_filter").removeClass("selectedFilter");
|
||||
$("inactive_filter").removeClass("selectedFilter");
|
||||
$(f + "_filter").addClass("selectedFilter");
|
||||
|
@ -261,6 +261,10 @@ var dynamicTable = new Class({
|
||||
if (!~state.indexOf('paused'))
|
||||
return false;
|
||||
break;
|
||||
case 'resumed':
|
||||
if (~state.indexOf('paused'))
|
||||
return false;
|
||||
break;
|
||||
case 'active':
|
||||
if ((state != 'uploading') && (state != 'downloading'))
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user