WebUI: Always close one window

Closing all windows is overly broad and never the intention.

PR #21804.
This commit is contained in:
Thomas Piccirello 2024-11-16 04:12:35 -03:00 committed by GitHub
parent 0f12d077c8
commit 1cd3c586c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 70 additions and 70 deletions

View file

@ -16,11 +16,11 @@
defaultEventType: "keydown", defaultEventType: "keydown",
events: { events: {
"Escape": function(event) { "Escape": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { "Esc": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -52,7 +52,7 @@
alert("QBT_TR(Unable to add peers. Please ensure you are adhering to the IP:port format.)QBT_TR[CONTEXT=HttpServer]"); alert("QBT_TR(Unable to add peers. Please ensure you are adhering to the IP:port format.)QBT_TR[CONTEXT=HttpServer]");
}, },
onSuccess: () => { onSuccess: () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
}).send(); }).send();
}); });
@ -65,7 +65,7 @@
<label for="peers">QBT_TR(List of peers to add (one IP per line):)QBT_TR[CONTEXT=PeersAdditionDialog]</label> <label for="peers">QBT_TR(List of peers to add (one IP per line):)QBT_TR[CONTEXT=PeersAdditionDialog]</label>
<textarea id="peers" rows="10" style="width: 100%;" placeholder="QBT_TR(Format: IPv4:port / [IPv6]:port)QBT_TR[CONTEXT=PeersAdditionDialog]"></textarea> <textarea id="peers" rows="10" style="width: 100%;" placeholder="QBT_TR(Format: IPv4:port / [IPv6]:port)QBT_TR[CONTEXT=PeersAdditionDialog]"></textarea>
<div style="margin-top: 10px; text-align: center;"> <div style="margin-top: 10px; text-align: center;">
<button type="button" onclick="parent.qBittorrent.Client.closeWindows();">QBT_TR(Cancel)QBT_TR[CONTEXT=PeersAdditionDialog]</button> <button type="button" onclick="parent.qBittorrent.Client.closeFrameWindow(window);">QBT_TR(Cancel)QBT_TR[CONTEXT=PeersAdditionDialog]</button>
<button type="button" id="addPeersOk">QBT_TR(Ok)QBT_TR[CONTEXT=PeersAdditionDialog]</button> <button type="button" id="addPeersOk">QBT_TR(Ok)QBT_TR[CONTEXT=PeersAdditionDialog]</button>
</div> </div>
</div> </div>

View file

@ -17,11 +17,11 @@
defaultEventType: "keydown", defaultEventType: "keydown",
events: { events: {
"Escape": function(event) { "Escape": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { "Esc": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -41,7 +41,7 @@
urls: $("trackersUrls").value urls: $("trackersUrls").value
}, },
onComplete: () => { onComplete: () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
}).send(); }).send();
}); });

View file

@ -17,11 +17,11 @@
defaultEventType: "keydown", defaultEventType: "keydown",
events: { events: {
"Escape": function(event) { "Escape": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { "Esc": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -39,7 +39,7 @@
urls: $("urls").value.split("\n").map(w => encodeURIComponent(w.trim())).filter(w => (w.length > 0)).join("|") urls: $("urls").value.split("\n").map(w => encodeURIComponent(w.trim())).filter(w => (w.length > 0)).join("|")
}, },
onComplete: () => { onComplete: () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
}).send(); }).send();
}); });

View file

@ -18,7 +18,7 @@
$("cancelBtn").addEventListener("click", (e) => { $("cancelBtn").addEventListener("click", (e) => {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
}); });
$("confirmBtn").addEventListener("click", (e) => { $("confirmBtn").addEventListener("click", (e) => {
e.preventDefault(); e.preventDefault();
@ -36,7 +36,7 @@
++completionCount; ++completionCount;
if (completionCount === paths.length) { if (completionCount === paths.length) {
window.parent.qBittorrent.Rss.updateRssFeedList(); window.parent.qBittorrent.Rss.updateRssFeedList();
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
} }
}).send(); }).send();

View file

@ -20,7 +20,7 @@
$("cancelBtn").focus(); $("cancelBtn").focus();
$("cancelBtn").addEvent("click", (e) => { $("cancelBtn").addEvent("click", (e) => {
e.stopPropagation(); e.stopPropagation();
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
}); });
$("confirmBtn").addEvent("click", (e) => { $("confirmBtn").addEvent("click", (e) => {
e.stopPropagation(); e.stopPropagation();
@ -33,7 +33,7 @@
urls: urls, urls: urls,
}, },
onComplete: () => { onComplete: () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
}).send(); }).send();
}); });

View file

@ -187,7 +187,7 @@
$("download_frame").addEventListener("load", () => { $("download_frame").addEventListener("load", () => {
if (submitted) if (submitted)
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
}); });
window.qBittorrent.pathAutofill.attachPathAutofill(); window.qBittorrent.pathAutofill.attachPathAutofill();

View file

@ -45,7 +45,7 @@
}, },
onComplete: () => { onComplete: () => {
window.parent.updateMainData(); window.parent.updateMainData();
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
}).send(); }).send();
} }
@ -58,7 +58,7 @@
"limit": limit "limit": limit
}, },
onComplete: () => { onComplete: () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
}).send(); }).send();
} }
@ -72,11 +72,11 @@
event.preventDefault(); event.preventDefault();
}, },
"Escape": function(event) { "Escape": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { "Esc": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }

View file

@ -21,11 +21,11 @@
event.preventDefault(); event.preventDefault();
}, },
"Escape": function(event) { "Escape": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { "Esc": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -52,7 +52,7 @@
newUrl: $("trackerUrl").value newUrl: $("trackerUrl").value
}, },
onComplete: () => { onComplete: () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
}).send(); }).send();
}); });

View file

@ -21,11 +21,11 @@
event.preventDefault(); event.preventDefault();
}, },
"Escape": function(event) { "Escape": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { "Esc": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -47,7 +47,7 @@
newUrl: encodeURIComponent($("url").value.trim()), newUrl: encodeURIComponent($("url").value.trim()),
}, },
onComplete: () => { onComplete: () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
}).send(); }).send();
}); });

View file

@ -22,11 +22,11 @@
event.preventDefault(); event.preventDefault();
}, },
"Escape": function(event) { "Escape": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { "Esc": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -94,7 +94,7 @@
}, },
onSuccess: () => { onSuccess: () => {
window.parent.updateMainData(); window.parent.updateMainData();
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
}, },
onFailure: () => { onFailure: () => {
alert("QBT_TR(Unable to set category)QBT_TR[CONTEXT=Category]"); alert("QBT_TR(Unable to set category)QBT_TR[CONTEXT=Category]");
@ -120,7 +120,7 @@
}, },
onSuccess: () => { onSuccess: () => {
window.parent.updateMainData(); window.parent.updateMainData();
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
}, },
onFailure: () => { onFailure: () => {
alert("QBT_TR(Unable to create category)QBT_TR[CONTEXT=Category]"); alert("QBT_TR(Unable to create category)QBT_TR[CONTEXT=Category]");
@ -137,7 +137,7 @@
}, },
onSuccess: () => { onSuccess: () => {
window.parent.updateMainData(); window.parent.updateMainData();
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
}, },
onFailure: () => { onFailure: () => {
alert("QBT_TR(Unable to edit category)QBT_TR[CONTEXT=Category]"); alert("QBT_TR(Unable to edit category)QBT_TR[CONTEXT=Category]");

View file

@ -21,11 +21,11 @@
event.preventDefault(); event.preventDefault();
}, },
"Escape": (event) => { "Escape": (event) => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": (event) => { "Esc": (event) => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -55,7 +55,7 @@
}, },
onSuccess: (response) => { onSuccess: (response) => {
window.parent.qBittorrent.Rss.updateRssFeedList(); window.parent.qBittorrent.Rss.updateRssFeedList();
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
}, },
onFailure: (response) => { onFailure: (response) => {
if (response.status === 409) if (response.status === 409)

View file

@ -22,11 +22,11 @@
event.preventDefault(); event.preventDefault();
}, },
"Escape": (event) => { "Escape": (event) => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": (event) => { "Esc": (event) => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -55,7 +55,7 @@
}, },
onSuccess: (response) => { onSuccess: (response) => {
window.parent.qBittorrent.Rss.updateRssFeedList(); window.parent.qBittorrent.Rss.updateRssFeedList();
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
}, },
onFailure: (response) => { onFailure: (response) => {
if (response.status === 409) if (response.status === 409)

View file

@ -21,11 +21,11 @@
event.preventDefault(); event.preventDefault();
}, },
"Escape": function(event) { "Escape": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { "Esc": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -69,7 +69,7 @@
tags: tagName, tags: tagName,
}, },
onComplete: () => { onComplete: () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
}).send(); }).send();
break; break;
@ -85,7 +85,7 @@
tags: tagName, tags: tagName,
}, },
onComplete: () => { onComplete: () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
}).send(); }).send();
break; break;

View file

@ -21,11 +21,11 @@
event.preventDefault(); event.preventDefault();
}, },
"Escape": function(event) { "Escape": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { "Esc": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -57,7 +57,7 @@
name: name name: name
}, },
onComplete: () => { onComplete: () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
}).send(); }).send();
} }

View file

@ -21,11 +21,11 @@
event.preventDefault(); event.preventDefault();
}, },
"Escape": (event) => { "Escape": (event) => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": (event) => { "Esc": (event) => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -64,7 +64,7 @@
}, },
onSuccess: (response) => { onSuccess: (response) => {
window.parent.qBittorrent.Rss.updateRssFeedList(); window.parent.qBittorrent.Rss.updateRssFeedList();
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
}, },
onFailure: (response) => { onFailure: (response) => {
if (response.status === 409) if (response.status === 409)

View file

@ -22,11 +22,11 @@
event.preventDefault(); event.preventDefault();
}, },
"Escape": function(event) { "Escape": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { "Esc": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -74,7 +74,7 @@
newPath: newPath newPath: newPath
}, },
onSuccess: () => { onSuccess: () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
}, },
onFailure: () => { onFailure: () => {
alert("QBT_TR(Failed to update name)QBT_TR[CONTEXT=HttpServer]"); alert("QBT_TR(Failed to update name)QBT_TR[CONTEXT=HttpServer]");

View file

@ -65,11 +65,11 @@
defaultEventType: "keydown", defaultEventType: "keydown",
events: { events: {
"Escape": function(event) { "Escape": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { "Esc": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -285,7 +285,7 @@
$("renameButton").value = replaceOperation; $("renameButton").value = replaceOperation;
}); });
$("closeButton").addEventListener("click", () => { $("closeButton").addEventListener("click", () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}); });
// synchronize header scrolling to table body // synchronize header scrolling to table body

View file

@ -30,7 +30,7 @@ window.qBittorrent.Client ??= (() => {
const exports = () => { const exports = () => {
return { return {
closeWindow: closeWindow, closeWindow: closeWindow,
closeWindows: closeWindows, closeFrameWindow: closeFrameWindow,
getSyncMainDataInterval: getSyncMainDataInterval, getSyncMainDataInterval: getSyncMainDataInterval,
isStopped: isStopped, isStopped: isStopped,
stop: stop, stop: stop,
@ -51,8 +51,8 @@ window.qBittorrent.Client ??= (() => {
MochaUI.closeWindow(window); MochaUI.closeWindow(window);
}; };
const closeWindows = () => { const closeFrameWindow = (window) => {
MochaUI.closeAll(); closeWindow(window.frameElement.closest("div.mocha").id);
}; };
const getSyncMainDataInterval = () => { const getSyncMainDataInterval = () => {

View file

@ -21,11 +21,11 @@
event.preventDefault(); event.preventDefault();
}, },
"Escape": function(event) { "Escape": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { "Esc": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -59,7 +59,7 @@
location: location location: location
}, },
onSuccess: () => { onSuccess: () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
}, },
onFailure: (xhr) => { onFailure: (xhr) => {
$("error_div").textContent = xhr.response; $("error_div").textContent = xhr.response;

View file

@ -24,11 +24,11 @@
event.preventDefault(); event.preventDefault();
}, },
"Escape": function(event) { "Escape": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { "Esc": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }
@ -115,7 +115,7 @@
inactiveSeedingTimeLimit: inactiveSeedingTimeLimitValue inactiveSeedingTimeLimit: inactiveSeedingTimeLimitValue
}, },
onComplete: () => { onComplete: () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
}).send(); }).send();
}); });

View file

@ -172,7 +172,7 @@
$("upload_frame").addEventListener("load", () => { $("upload_frame").addEventListener("load", () => {
if (submitted) if (submitted)
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
}); });
if ((Browser.platform === "ios") || ((Browser.platform === "mac") && (navigator.maxTouchPoints > 1))) if ((Browser.platform === "ios") || ((Browser.platform === "mac") && (navigator.maxTouchPoints > 1)))

View file

@ -45,7 +45,7 @@
}, },
onComplete: () => { onComplete: () => {
window.parent.updateMainData(); window.parent.updateMainData();
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
}).send(); }).send();
} }
@ -58,7 +58,7 @@
"limit": limit "limit": limit
}, },
onComplete: () => { onComplete: () => {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
} }
}).send(); }).send();
} }
@ -72,11 +72,11 @@
event.preventDefault(); event.preventDefault();
}, },
"Escape": function(event) { "Escape": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { "Esc": function(event) {
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeFrameWindow(window);
event.preventDefault(); event.preventDefault();
} }
} }

View file

@ -69,7 +69,7 @@
}); });
cancelButton.focus(); cancelButton.focus();
cancelButton.addEventListener("click", (e) => { window.qBittorrent.Client.closeWindows(); }); cancelButton.addEventListener("click", (e) => { window.qBittorrent.Client.closeWindow("confirmDeletionPage"); });
confirmButton.addEventListener("click", (e) => { confirmButton.addEventListener("click", (e) => {
// Some torrents might be removed when waiting for user input, so refetch the torrent list // Some torrents might be removed when waiting for user input, so refetch the torrent list
@ -88,7 +88,7 @@
torrentsTable.deselectAll(); torrentsTable.deselectAll();
updateMainData(); updateMainData();
updatePropertiesPanel(); updatePropertiesPanel();
window.qBittorrent.Client.closeWindows(); window.qBittorrent.Client.closeWindow("confirmDeletionPage");
}, },
onFailure: () => { onFailure: () => {
alert("QBT_TR(Unable to delete torrents.)QBT_TR[CONTEXT=HttpServer]"); alert("QBT_TR(Unable to delete torrents.)QBT_TR[CONTEXT=HttpServer]");

View file

@ -3042,12 +3042,12 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
data: settings, data: settings,
onFailure: () => { onFailure: () => {
alert("QBT_TR(Unable to save program preferences, qBittorrent is probably unreachable.)QBT_TR[CONTEXT=HttpServer]"); alert("QBT_TR(Unable to save program preferences, qBittorrent is probably unreachable.)QBT_TR[CONTEXT=HttpServer]");
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeWindow("preferencesPage");
}, },
onSuccess: () => { onSuccess: () => {
// Close window // Close window
window.parent.location.reload(); window.parent.location.reload();
window.parent.qBittorrent.Client.closeWindows(); window.parent.qBittorrent.Client.closeWindow("preferencesPage");
} }
}); });
}; };