From 8379672f014827b7cfb28d9d6c6d69253cf6e6a5 Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Thu, 29 Aug 2024 10:23:07 +0100 Subject: [PATCH] Add disable upload checkbox to UI --- desktop/src-tauri/Cargo.lock | 1 + desktop/src-tauri/src/config.rs | 5 +++++ desktop/src/configuration.tsx | 1 + desktop/src/configure.tsx | 10 ++++++++++ 4 files changed, 17 insertions(+) diff --git a/desktop/src-tauri/Cargo.lock b/desktop/src-tauri/Cargo.lock index 5afb0969..763e80cc 100644 --- a/desktop/src-tauri/Cargo.lock +++ b/desktop/src-tauri/Cargo.lock @@ -2044,6 +2044,7 @@ dependencies = [ "anyhow", "axum", "bstr", + "futures", "gethostname", "http 1.1.0", "httparse", diff --git a/desktop/src-tauri/src/config.rs b/desktop/src-tauri/src/config.rs index bb6dc904..6bea696f 100644 --- a/desktop/src-tauri/src/config.rs +++ b/desktop/src-tauri/src/config.rs @@ -143,6 +143,10 @@ pub struct RqbitDesktopConfigUpnp { #[serde(default)] pub struct RqbitDesktopConfig { pub default_download_location: PathBuf, + + #[serde(default)] + pub disable_upload: bool, + pub dht: RqbitDesktopConfigDht, pub tcp_listen: RqbitDesktopConfigTcpListen, pub upnp: RqbitDesktopConfigUpnp, @@ -167,6 +171,7 @@ impl Default for RqbitDesktopConfig { persistence: Default::default(), peer_opts: Default::default(), http_api: Default::default(), + disable_upload: false, } } } diff --git a/desktop/src/configuration.tsx b/desktop/src/configuration.tsx index 80f76778..93ee11ce 100644 --- a/desktop/src/configuration.tsx +++ b/desktop/src/configuration.tsx @@ -41,6 +41,7 @@ interface RqbitDesktopConfigUpnp { export interface RqbitDesktopConfig { default_download_location: PathLike; + disable_upload: boolean; dht: RqbitDesktopConfigDht; tcp_listen: RqbitDesktopConfigTcpListen; upnp: RqbitDesktopConfigUpnp; diff --git a/desktop/src/configure.tsx b/desktop/src/configure.tsx index bfe68de5..6dfc7231 100644 --- a/desktop/src/configure.tsx +++ b/desktop/src/configure.tsx @@ -210,6 +210,16 @@ export const ConfigModal: React.FC<{ onChange={handleInputChange} help="Where to download torrents by default. You can override this per torrent." /> + +