mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 04:18:39 +00:00
(trunk) #3483:Add 'finished' filter to webui
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user