From cdad0dc7d32308c84153e6e4d7e2ef227b8a91d3 Mon Sep 17 00:00:00 2001 From: Thomas Piccirello Date: Sun, 22 Jul 2018 20:33:17 -0400 Subject: [PATCH 1/2] Add WebUI Force Reannounce option --- src/webui/api/torrentscontroller.cpp | 8 ++++++++ src/webui/api/torrentscontroller.h | 1 + src/webui/www/private/index.html | 1 + src/webui/www/private/scripts/mocha-init.js | 14 ++++++++++++++ src/webui/www/private/transferlist.html | 3 +++ 5 files changed, 27 insertions(+) diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index 12ddcddfb..3446fb8e1 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -795,6 +795,14 @@ void TorrentsController::recheckAction() applyToTorrents(hashes, [](BitTorrent::TorrentHandle *torrent) { torrent->forceRecheck(); }); } +void TorrentsController::reannounceAction() +{ + checkParams({"hashes"}); + + const QStringList hashes {params()["hashes"].split('|')}; + applyToTorrents(hashes, [](BitTorrent::TorrentHandle *torrent) { torrent->forceReannounce(); }); +} + void TorrentsController::setCategoryAction() { checkParams({"hashes", "category"}); diff --git a/src/webui/api/torrentscontroller.h b/src/webui/api/torrentscontroller.h index 03d870f93..0abaa30a3 100644 --- a/src/webui/api/torrentscontroller.h +++ b/src/webui/api/torrentscontroller.h @@ -49,6 +49,7 @@ private slots: void resumeAction(); void pauseAction(); void recheckAction(); + void reannounceAction(); void renameAction(); void setCategoryAction(); void createCategoryAction(); diff --git a/src/webui/www/private/index.html b/src/webui/www/private/index.html index ee31e38ba..3497b5882 100644 --- a/src/webui/www/private/index.html +++ b/src/webui/www/private/index.html @@ -127,6 +127,7 @@
  • QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget] QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]
  • QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget] QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]
  • QBT_TR(Force recheck)QBT_TR[CONTEXT=TransferListWidget] QBT_TR(Force recheck)QBT_TR[CONTEXT=TransferListWidget]
  • +
  • QBT_TR(Force reannounce)QBT_TR[CONTEXT=TransferListWidget] QBT_TR(Force reannounce)QBT_TR[CONTEXT=TransferListWidget]
  • QBT_TR(Priority)QBT_TR[CONTEXT=TransferListWidget]