WebUI: Improve torrent deletion

* Added 'Confirm when deleting torrents' option to the WebUI
* Confirm deletion dialog now uses MUI.Modal

PR #21289.
Closes #18345.
This commit is contained in:
skomerko
2024-09-13 16:28:02 +02:00
committed by GitHub
parent a0c32110f1
commit 0ea35c54a3
4 changed files with 202 additions and 99 deletions

View File

@@ -9,6 +9,10 @@
<fieldset class="settings">
<legend>QBT_TR(Transfer list)QBT_TR[CONTEXT=OptionsDialog]</legend>
<div class="formRow" style="margin-bottom: 3px;" title="QBT_TR(Shows a confirmation dialog upon torrent deletion)QBT_TR[CONTEXT=OptionsDialog]">
<input type="checkbox" id="confirmTorrentDeletion">
<label for="confirmTorrentDeletion">QBT_TR(Confirm when deleting torrents)QBT_TR[CONTEXT=OptionsDialog]</label>
</div>
<div class="formRow" style="margin-bottom: 3px;">
<input type="checkbox" id="useAltRowColorsInput">
<label for="useAltRowColorsInput">QBT_TR(Use alternating row colors)QBT_TR[CONTEXT=OptionsDialog]</label>
@@ -2107,6 +2111,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
document.getElementById("hideZeroFiltersCheckbox").checked = (LocalPreferences.get("hide_zero_status_filters", "false") === "true");
$("dblclickDownloadSelect").value = LocalPreferences.get("dblclick_download", "1");
$("dblclickCompleteSelect").value = LocalPreferences.get("dblclick_complete", "1");
document.getElementById("confirmTorrentDeletion").checked = pref.confirm_torrent_deletion;
document.getElementById("useAltRowColorsInput").checked = (LocalPreferences.get("use_alt_row_colors", "true") === "true");
$("filelog_checkbox").checked = pref.file_log_enabled;
$("filelog_save_path_input").value = pref.file_log_path;
@@ -2522,6 +2527,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
LocalPreferences.set("hide_zero_status_filters", document.getElementById("hideZeroFiltersCheckbox").checked.toString());
LocalPreferences.set("dblclick_download", $("dblclickDownloadSelect").value);
LocalPreferences.set("dblclick_complete", $("dblclickCompleteSelect").value);
settings["confirm_torrent_deletion"] = document.getElementById("confirmTorrentDeletion").checked;
LocalPreferences.set("use_alt_row_colors", document.getElementById("useAltRowColorsInput").checked.toString());
settings["file_log_enabled"] = $("filelog_checkbox").checked;
settings["file_log_path"] = $("filelog_save_path_input").value;