From b52fa98a02bfa74766dd4a31d6a667a51ad00843 Mon Sep 17 00:00:00 2001
From: Hanabishi <13597663+HanabishiRecca@users.noreply.github.com>
Date: Fri, 5 Jul 2024 11:34:05 +0500
Subject: [PATCH] WebUI: Implement double-click behavior controls
PR #21000.
---
src/webui/www/private/scripts/dynamicTable.js | 14 ++++++++++
src/webui/www/private/views/preferences.html | 28 +++++++++++++++++++
2 files changed, 42 insertions(+)
diff --git a/src/webui/www/private/scripts/dynamicTable.js b/src/webui/www/private/scripts/dynamicTable.js
index 1fa668920..07503ea77 100644
--- a/src/webui/www/private/scripts/dynamicTable.js
+++ b/src/webui/www/private/scripts/dynamicTable.js
@@ -1536,6 +1536,20 @@ window.qBittorrent.DynamicTable = (function() {
this._this.selectRow(this.rowId);
const row = this._this.rows.get(this.rowId);
const state = row["full_data"].state;
+
+ const prefKey =
+ (state !== "uploading")
+ && (state !== "stoppedUP")
+ && (state !== "forcedUP")
+ && (state !== "stalledUP")
+ && (state !== "queuedUP")
+ && (state !== "checkingUP")
+ ? "dblclick_download"
+ : "dblclick_complete";
+
+ if (LocalPreferences.get(prefKey, "1") !== "1")
+ return true;
+
if (state.includes("stopped"))
startFN();
else
diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html
index 78ec25d9f..fab7a8e91 100644
--- a/src/webui/www/private/views/preferences.html
+++ b/src/webui/www/private/views/preferences.html
@@ -7,6 +7,30 @@
+
+