1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 00:34:04 +00:00

(trunk) #3483:Add 'finished' filter to webui

This commit is contained in:
Daniel Lee 2010-08-09 00:40:46 +00:00
parent cbf9792701
commit 4c0361f496
4 changed files with 12 additions and 1 deletions

View file

@ -61,6 +61,7 @@
<li><a href="#downloading" id="filter_downloading_link">Downloading</a></li>
<li><a href="#seeding" id="filter_seeding_link">Seeding</a></li>
<li><a href="#paused" id="filter_paused_link">Paused</a></li>
<li><a href="#finished" id="filter_finished_link">Finished</a></li>
</ul>
<input type="search" id="torrent_search" placeholder="Filter" results="0" />
</div>

View file

@ -229,6 +229,7 @@ Prefs._FilterActive = 'active';
Prefs._FilterSeeding = 'seeding';
Prefs._FilterDownloading = 'downloading';
Prefs._FilterPaused = 'paused';
Prefs._FilterFinished = 'finished';
Prefs._SortDirection = 'sort_direction';
Prefs._SortAscending = 'ascending';

View file

@ -235,6 +235,7 @@ Torrent.prototype =
|| this.state() == Torrent._StatusChecking; },
isActive: function() { return this.state() != Torrent._StatusPaused; },
isDownloading: function() { return this.state() == Torrent._StatusDownloading; },
isFinished: function() { return this._isFinishedSeeding; },
isSeeding: function() { return this.state() == Torrent._StatusSeeding; },
name: function() { return this._name; },
peersSendingToUs: function() { return this._peers_sending_to_us; },
@ -254,7 +255,7 @@ Torrent.prototype =
switch( this.state() ) {
case Torrent._StatusSeeding: return 'Seeding';
case Torrent._StatusDownloading: return 'Downloading';
case Torrent._StatusPaused: return this._isFinishedSeeding ? 'Seeding complete' : 'Paused';
case Torrent._StatusPaused: return this.isFinished() ? 'Seeding complete' : 'Paused';
case Torrent._StatusChecking: return 'Verifying local data';
case Torrent._StatusWaitingToCheck: return 'Waiting to verify';
default: return 'error';
@ -746,6 +747,9 @@ Torrent.prototype =
case Prefs._FilterPaused:
pass = !this.isActive();
break;
case Prefs._FilterFinished:
pass = this.isFinished();
break;
default:
pass = true;
break;

View file

@ -46,6 +46,7 @@ Transmission.prototype =
$('#filter_downloading_link').parent().bind('click', function(e){ tr.showDownloadingClicked(e); });
$('#filter_seeding_link').parent().bind('click', function(e){ tr.showSeedingClicked(e); });
$('#filter_paused_link').parent().bind('click', function(e){ tr.showPausedClicked(e); });
$('#filter_finished_link').parent().bind('click', function(e){ tr.showFinishedClicked(e); });
$('.inspector_tab').bind('click', function(e){ tr.inspectorTabClicked(e, this); });
$('.file_wanted_control').live('click', function(e){ tr.fileWantedClicked(e, this); });
$('.file_priority_control').live('click', function(e){ tr.filePriorityClicked(e, this); });
@ -735,6 +736,7 @@ Transmission.prototype =
case Prefs._FilterSeeding: c = '#filter_seeding_link'; break;
case Prefs._FilterDownloading: c = '#filter_downloading_link'; break;
case Prefs._FilterPaused: c = '#filter_paused_link'; break;
case Prefs._FilterFinished: c = '#filter_finished_link'; break;
}
$(c).parent().siblings().removeClass('selected');
$(c).parent().addClass('selected');
@ -758,6 +760,9 @@ Transmission.prototype =
showPausedClicked: function(event) {
this.setFilter( Prefs._FilterPaused );
},
showFinishedClicked: function(event) {
this.setFilter( Prefs._FilterFinished );
},
/*
* 'Clutch Preferences' was clicked (iPhone only)