diff --git a/src/webui/www/private/css/Window.css b/src/webui/www/private/css/Window.css index 9a71df8e3..008e760a1 100644 --- a/src/webui/www/private/css/Window.css +++ b/src/webui/www/private/css/Window.css @@ -57,7 +57,10 @@ Required by: font-weight: bold; line-height: 15px; margin: 0; + overflow: hidden; padding: 5px 10px 4px 12px; + text-overflow: ellipsis; + white-space: nowrap; } .mochaToolbarWrapper { diff --git a/src/webui/www/private/index.html b/src/webui/www/private/index.html index 868521497..86e92eb51 100644 --- a/src/webui/www/private/index.html +++ b/src/webui/www/private/index.html @@ -174,7 +174,7 @@ QBT_TR(Tags)QBT_TR[CONTEXT=TransferListWidget] QBT_TR(Tags)QBT_TR[CONTEXT=TransferListWidget] -
  • +
  • QBT_TR(Automatic Torrent Management)QBT_TR[CONTEXT=TransferListWidget] QBT_TR(Automatic Torrent Management)QBT_TR[CONTEXT=TransferListWidget]
  • QBT_TR(Limit download rate...)QBT_TR[CONTEXT=TransferListWidget] QBT_TR(Limit download rate...)QBT_TR[CONTEXT=TransferListWidget]
  • diff --git a/src/webui/www/private/scripts/mocha-init.js b/src/webui/www/private/scripts/mocha-init.js index b404c59cc..d9edc22c5 100644 --- a/src/webui/www/private/scripts/mocha-init.js +++ b/src/webui/www/private/scripts/mocha-init.js @@ -555,22 +555,36 @@ const initializeWindows = function() { autoTorrentManagementFN = function() { const hashes = torrentsTable.selectedRowsIds(); - if (hashes.length) { - let enable = false; - hashes.each((hash, index) => { - const row = torrentsTable.getRow(hash); - if (!row.full_data.auto_tmm) - enable = true; - }); - new Request({ - url: "api/v2/torrents/setAutoManagement", - method: "post", - data: { - hashes: hashes.join("|"), - enable: enable - } - }).send(); - updateMainData(); + if (hashes.length > 0) { + const enableAutoTMM = hashes.some((hash) => !(torrentsTable.getRow(hash).full_data.auto_tmm)); + if (enableAutoTMM) { + new MochaUI.Modal({ + ...window.qBittorrent.Dialog.baseModalOptions, + id: "confirmAutoTMMDialog", + title: "QBT_TR(Enable automatic torrent management)QBT_TR[CONTEXT=confirmAutoTMMDialog]", + data: { + hashes: hashes, + enable: enableAutoTMM + }, + contentURL: "views/confirmAutoTMM.html" + }); + } + else { + new Request({ + url: "api/v2/torrents/setAutoManagement", + method: "post", + data: { + hashes: hashes.join("|"), + enable: enableAutoTMM + }, + onSuccess: () => { + updateMainData(); + }, + onFailure: () => { + alert("QBT_TR(Unable to set Auto Torrent Management for the selected torrents.)QBT_TR[CONTEXT=HttpServer]"); + } + }).send(); + } } }; diff --git a/src/webui/www/private/views/confirmAutoTMM.html b/src/webui/www/private/views/confirmAutoTMM.html new file mode 100644 index 000000000..14ae0a87e --- /dev/null +++ b/src/webui/www/private/views/confirmAutoTMM.html @@ -0,0 +1,60 @@ +
    +
    + + +
    +
    +
    + + +
    + + diff --git a/src/webui/www/webui.qrc b/src/webui/www/webui.qrc index bd11d9a0a..ae1ddfeee 100644 --- a/src/webui/www/webui.qrc +++ b/src/webui/www/webui.qrc @@ -423,6 +423,7 @@ private/uploadlimit.html private/views/about.html private/views/aboutToolbar.html + private/views/confirmAutoTMM.html private/views/confirmdeletion.html private/views/confirmRecheck.html private/views/cookies.html