Skip to content

Commit

Permalink
Add disable upload checkbox to UI
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatson committed Aug 29, 2024
1 parent 7fda8c0 commit 8379672
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions desktop/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions desktop/src-tauri/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -167,6 +171,7 @@ impl Default for RqbitDesktopConfig {
persistence: Default::default(),
peer_opts: Default::default(),
http_api: Default::default(),
disable_upload: false,
}
}
}
Expand Down
1 change: 1 addition & 0 deletions desktop/src/configuration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ interface RqbitDesktopConfigUpnp {

export interface RqbitDesktopConfig {
default_download_location: PathLike;
disable_upload: boolean;
dht: RqbitDesktopConfigDht;
tcp_listen: RqbitDesktopConfigTcpListen;
upnp: RqbitDesktopConfigUpnp;
Expand Down
10 changes: 10 additions & 0 deletions desktop/src/configure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,16 @@ export const ConfigModal: React.FC<{
onChange={handleInputChange}
help="Where to download torrents by default. You can override this per torrent."
/>

<FormCheck
label="Disable upload"
name="disable_upload"
checked={config.disable_upload}
onChange={handleToggleChange}
help="Disable uploading entirely. If this is set, rqbit won't share piece availability and will disconnect on download request.
Might be useful e.g. if rqbit upload consumes all your upload bandwidth and interferes with your other Internet usage."
/>
</Tab>

<Tab name="DHT" currentTab={tab}>
Expand Down

0 comments on commit 8379672

Please sign in to comment.