1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-13 16:28:06 +00:00

WebUI: Implement delete torrents by category

This commit is contained in:
buinsky 2016-01-22 15:13:35 +03:00
parent 2c24c0bfbf
commit ead592647a
3 changed files with 23 additions and 0 deletions

View File

@ -131,6 +131,7 @@
<li><a href="#DeleteUnusedCategories"><img src="theme/list-remove" alt="QBT_TR(Remove unused categories)QBT_TR"/> QBT_TR(Remove unused categories)QBT_TR</a></li> <li><a href="#DeleteUnusedCategories"><img src="theme/list-remove" alt="QBT_TR(Remove unused categories)QBT_TR"/> QBT_TR(Remove unused categories)QBT_TR</a></li>
<li class="separator"><a href="#StartTorrentsByCategory"><img src="theme/media-playback-start" alt="QBT_TR(Resume torrents)QBT_TR"/> QBT_TR(Resume torrents)QBT_TR</a></li> <li class="separator"><a href="#StartTorrentsByCategory"><img src="theme/media-playback-start" alt="QBT_TR(Resume torrents)QBT_TR"/> QBT_TR(Resume torrents)QBT_TR</a></li>
<li><a href="#PauseTorrentsByCategory"><img src="theme/media-playback-pause" alt="QBT_TR(Pause torrents)QBT_TR"/> QBT_TR(Pause torrents)QBT_TR</a></li> <li><a href="#PauseTorrentsByCategory"><img src="theme/media-playback-pause" alt="QBT_TR(Pause torrents)QBT_TR"/> QBT_TR(Pause torrents)QBT_TR</a></li>
<li><a href="#DeleteTorrentsByCategory"><img src="theme/edit-delete" alt="QBT_TR(Delete torrents)QBT_TR"/> QBT_TR(Delete torrents)QBT_TR</a></li>
</ul> </ul>
<div id="desktopFooterWrapper"> <div id="desktopFooterWrapper">
<div id="desktopFooter"> <div id="desktopFooter">

View File

@ -34,6 +34,9 @@
}, },
PauseTorrentsByCategory : function (element, ref) { PauseTorrentsByCategory : function (element, ref) {
pauseTorrentsByCategoryFN(element.id); pauseTorrentsByCategoryFN(element.id);
},
DeleteTorrentsByCategory : function (element, ref) {
deleteTorrentsByCategoryFN(element.id);
} }
}, },
offsets : { offsets : {

View File

@ -417,6 +417,25 @@ initializeWindows = function() {
} }
}; };
deleteTorrentsByCategoryFN = function (categoryHash) {
var h = torrentsTable.getFilteredTorrentsHashes('all', categoryHash);
if (h.length) {
new MochaUI.Window({
id: 'confirmDeletionPage',
title: "QBT_TR(Deletion confirmation)QBT_TR",
loadMethod: 'iframe',
contentURL: 'confirmdeletion.html?hashes=' + h.join("|"),
scrollbars: false,
resizable: false,
maximizable: false,
padding: 10,
width: 424,
height: 140
});
updateMainData();
}
};
['pauseAll', 'resumeAll'].each(function(item) { ['pauseAll', 'resumeAll'].each(function(item) {
addClickEvent(item, function(e) { addClickEvent(item, function(e) {
new Event(e).stop(); new Event(e).stop();