mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 17:23:07 -07:00
Add confirmation to resume/pause all
This adds a confirmation dialog to Pause All and Resume All. First I wanted to only add it in Tray, but honestly, clicking around in the menu, using hotkeys might trigger it just as easy. Closes #17683. PR #17945.
This commit is contained in:
parent
22fb9797c4
commit
162273da47
2 changed files with 39 additions and 5 deletions
|
@ -979,18 +979,34 @@ const initializeWindows = function() {
|
|||
}
|
||||
};
|
||||
|
||||
['pause', 'resume'].each(function(item) {
|
||||
addClickEvent(item + 'All', function(e) {
|
||||
new Event(e).stop();
|
||||
addClickEvent('pauseAll', (e) => {
|
||||
new Event(e).stop();
|
||||
|
||||
if (confirm('QBT_TR(Would you like to pause all torrents?)QBT_TR[CONTEXT=MainWindow]')) {
|
||||
new Request({
|
||||
url: 'api/v2/torrents/' + item,
|
||||
url: 'api/v2/torrents/pause',
|
||||
method: 'post',
|
||||
data: {
|
||||
hashes: "all"
|
||||
}
|
||||
}).send();
|
||||
updateMainData();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
addClickEvent('resumeAll', (e) => {
|
||||
new Event(e).stop();
|
||||
|
||||
if (confirm('QBT_TR(Would you like to resume all torrents?)QBT_TR[CONTEXT=MainWindow]')) {
|
||||
new Request({
|
||||
url: 'api/v2/torrents/resume',
|
||||
method: 'post',
|
||||
data: {
|
||||
hashes: "all"
|
||||
}
|
||||
}).send();
|
||||
updateMainData();
|
||||
}
|
||||
});
|
||||
|
||||
['pause', 'resume', 'recheck'].each(function(item) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue