diff --git a/Changelog b/Changelog index 53414d5c9..31a5f143a 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,6 @@ * unreleased - - Christophe Dumez - v3.1.0 - FEATURE: Add command line option to daemonize qbittorrent-nox (ngaro) + - FEATURE: Add "Shutdown qBittorrent" button to Web UI (ngaro) - BUGFIX: Greatly improve RSS manager performance (closes #34) * Thu Aug 09 2012 - Christophe Dumez - v3.0.0 diff --git a/src/webui/html/index.html b/src/webui/html/index.html index ecede2147..3ea56e168 100644 --- a/src/webui/html/index.html +++ b/src/webui/html/index.html @@ -37,7 +37,7 @@
  • @@ -66,7 +66,6 @@
  • _(&About)
  • -
  • _(&Shutdown)
  • diff --git a/src/webui/httpconnection.cpp b/src/webui/httpconnection.cpp index 4c3aef84b..8816ebda0 100644 --- a/src/webui/httpconnection.cpp +++ b/src/webui/httpconnection.cpp @@ -596,6 +596,7 @@ void HttpConnection::respondCommand(const QString& command) { return; } if (command == "shutdown") { + qDebug() << "Shutdown request from Web UI"; qApp->exit(); } } diff --git a/src/webui/httpserver.cpp b/src/webui/httpserver.cpp index b78960ca8..36e6a5071 100644 --- a/src/webui/httpserver.cpp +++ b/src/webui/httpserver.cpp @@ -135,6 +135,7 @@ HttpServer::HttpServer(QObject* parent) : QTcpServer(parent) a = tr("The following parameters are supported:"); a = tr("Torrent path"); a = tr("Torrent name"); + a = tr("qBittorrent has been shutdown."); } HttpServer::~HttpServer() { diff --git a/src/webui/scripts/mocha-init.js b/src/webui/scripts/mocha-init.js index 4d9ae2c37..595ff2765 100644 --- a/src/webui/scripts/mocha-init.js +++ b/src/webui/scripts/mocha-init.js @@ -285,9 +285,12 @@ initializeWindows = function(){ addClickEvent('shutdown', function(e){ new Event(e).stop(); - new Request({url: 'command/shutdown'}).send(); - document.write("_(qBittorrent has been shutdown.)

    _(qBittorrent has been shutdown.)

    "); //TODO Can someone with artistic skills put a pretty webpage here - stop(); + new Request({url: 'command/shutdown', + onSuccess: function() { + document.write("_(qBittorrent has been shutdown.)

    _(qBittorrent has been shutdown.)

    "); + } + } + ).send(); }); // Deactivate menu header links