1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-04 10:54:35 +00:00

Merge pull request #40 from ngaro/master

Add shutdown button to the Web UI
This commit is contained in:
Christophe Dumez 2012-08-19 11:57:28 -07:00
commit 0fe09aa088
3 changed files with 11 additions and 0 deletions

View File

@ -66,6 +66,7 @@
<li><a id="aboutLink"><img class="MyMenuIcon" src="theme/help-about" width="16" height="16" onload="fixPNG(this)"/>_(&About)</a></li>
</ul>
</li>
<li><a class="returnFalse" id="shutdownLink">_(&Shutdown)</a></li>
</ul>
</div>
<div id="mochaToolbar">

View File

@ -595,6 +595,9 @@ void HttpConnection::respondCommand(const QString& command) {
QBtSession::instance()->recheckTorrent(m_parser.post("hash"));
return;
}
if (command == "shutdown") {
qApp->exit();
}
}
void HttpConnection::decreaseTorrentsPriority(const QStringList &hashes) {

View File

@ -283,6 +283,13 @@ initializeWindows = function(){
});
});
addClickEvent('shutdown', function(e){
new Event(e).stop();
new Request({url: 'command/shutdown'}).send();
document.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><title>_(qBittorrent has been shutdown.)</title><style type=\"text/css\">body { text-align: center; }</style></head><body><h1>_(qBittorrent has been shutdown.)</h1></body></html>"); //TODO Can someone with artistic skills put a pretty webpage here
stop();
});
// Deactivate menu header links
$$('a.returnFalse').each(function(el){
el.addEvent('click', function(e){