mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-15 01:00:17 +00:00
- Allow to delete permanently from WebUI
This commit is contained in:
parent
028041f874
commit
1544300616
@ -224,7 +224,12 @@ void HttpConnection::respondCommand(QString command)
|
||||
}
|
||||
if(command == "delete")
|
||||
{
|
||||
emit deleteTorrent(parser.post("hash"));
|
||||
emit deleteTorrent(parser.post("hash"), false);
|
||||
return;
|
||||
}
|
||||
if(command == "deletePerm")
|
||||
{
|
||||
emit deleteTorrent(parser.post("hash"), true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ class HttpConnection : public QObject
|
||||
signals:
|
||||
void UrlReadyToBeDownloaded(QString url);
|
||||
void torrentReadyToBeDownloaded(QString, bool, QString, bool);
|
||||
void deleteTorrent(QString hash);
|
||||
void deleteTorrent(QString hash, bool permanently);
|
||||
void resumeTorrent(QString hash);
|
||||
void pauseTorrent(QString hash);
|
||||
void resumeAllTorrents();
|
||||
|
@ -63,7 +63,7 @@ void HttpServer::newHttpConnection()
|
||||
//connect connection to BTSession
|
||||
connect(connection, SIGNAL(UrlReadyToBeDownloaded(QString)), BTSession, SLOT(downloadUrlAndSkipDialog(QString)));
|
||||
connect(connection, SIGNAL(torrentReadyToBeDownloaded(QString, bool, QString, bool)), BTSession, SLOT(addTorrent(QString, bool, QString, bool)));
|
||||
connect(connection, SIGNAL(deleteTorrent(QString)), BTSession, SLOT(deleteTorrent(QString)));
|
||||
connect(connection, SIGNAL(deleteTorrent(QString, bool)), BTSession, SLOT(deleteTorrent(QString, bool)));
|
||||
connect(connection, SIGNAL(pauseTorrent(QString)), BTSession, SLOT(pauseTorrent(QString)));
|
||||
connect(connection, SIGNAL(resumeTorrent(QString)), BTSession, SLOT(resumeTorrent(QString)));
|
||||
connect(connection, SIGNAL(pauseAllTorrents()), BTSession, SLOT(pauseAllTorrents()));
|
||||
|
@ -41,6 +41,7 @@
|
||||
<li class="divider"><a id="resumeLink">Start</a></li>
|
||||
<li><a id="pauseLink">Pause</a></li>
|
||||
<li class="divider"><a id="deleteLink">Delete</a></li>
|
||||
<li><a id="deletePermLink">Delete from HD</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
@ -57,7 +58,8 @@
|
||||
<div id="mochaToolbar">
|
||||
<a id="downloadButton"><img class="mochaToolButton" title="Download from URL" src="images/skin/url.png"/></a>
|
||||
<a id="uploadButton"><img class="mochaToolButton" title="Download local torrent" src="images/skin/open.png"/></a>
|
||||
<a id="deleteButton"><img class="mochaToolButton" title="Delete" src="images/skin/delete.png"/></a>
|
||||
<a id="deleteButton"><img class="mochaToolButton" title="Delete" src="images/skin/delete.png"/></a>
|
||||
<a id="deletePermButton"><img class="mochaToolButton" title="Delete from HD" src="images/skin/delete_perm.png"/></a>
|
||||
<a id="resumeButton"><img class="mochaToolButton" title="Resume" src="images/skin/play.png"/></a>
|
||||
<a id="pauseButton"><img class="mochaToolButton" title="Pause" src="images/skin/pause.png"/></a>
|
||||
<a id="resumeAllButton"><img class="mochaToolButton" title="Resume all" src="images/skin/play_all.png"/></a>
|
||||
|
@ -68,6 +68,20 @@ initializeWindows = function(){
|
||||
}
|
||||
});
|
||||
|
||||
addClickEvent('deletePerm', function(e){
|
||||
new Event(e).stop();
|
||||
if($("Tab1").hasClass('active')) {
|
||||
var h = myTable.selectedIds();
|
||||
} else {
|
||||
var h = myTableUP.selectedIds();
|
||||
}
|
||||
if(h.length && confirm('Are you sure you want to delete from hard drive the selected item in download list?')) {
|
||||
h.each(function(item, index){
|
||||
new Request({url: '/command/deletePerm', method: 'post', data: {hash: item}}).send();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
['pause','resume'].each(function(item) {
|
||||
addClickEvent(item, function(e){
|
||||
new Event(e).stop();
|
||||
|
Loading…
x
Reference in New Issue
Block a user