misterdownloadmanager: The ultimate open-source, clean-room download manager written from scratch in pure Rust for Windows, Mac, and Linux
Rust bittorrent-clientdebriddownload-acceleratordownload-managerdownloadmanagereguifile-downloadergallery-dlidmidm-alternativeinternet-download-managerm3u8-downloadermagnetplaylist-downloaderreal-debridrusttorrent-clientvideo-downloaderyoutube-downloaderyt-dlp
fix(app): make window closing configurable and safe (#457)
awishtodiexzdf511c0705f5
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f2e478e8..ada4b521 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -11,6 +11,7 @@ Each release's notes on GitHub come from its section here (`## [X.Y.Z]`, see### Fixed+- With no tray icon to come back from, closing or minimizing the main window now leaves it in the taskbar, with downloads still going, instead of hiding it with no way back. **Options → General → Keep running when closing the window** (on by default) makes closing quit MDM when unticked ([#457](https://github.com/anefzaoui/misterdownloadmanager/pull/457)).- Crash reports: a crash monitor that can't open its connection no longer makes MDM wait five seconds at start or stays behind as a second process ([#458](https://github.com/anefzaoui/misterdownloadmanager/pull/458)).- Download File Info no longer stays open but out of sight, with every later download waiting behind it ([#440](https://github.com/anefzaoui/misterdownloadmanager/issues/440)). The next one after answering **Create folder** came up as an invisible window, and on Windows one hidden with a minimized main window is now shown again, as is the duplicate question- A file name sent by a site in plain UTF-8 now reaches MDM readable from Firefox and browsers built on it, such as Floorp, Waterfox and Zen: an Arabic name was saved as unreadable symbols ([#447](https://github.com/anefzaoui/misterdownloadmanager/issues/447)). A name written with percent signs in the same header is decoded as well. The add-on carries the fixdiff --git a/ROADMAP.md b/ROADMAP.mdindex 0de0b47e..13d0f315 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -512,6 +512,9 @@ These ship in a later version, when they're ready.### Bugs being looked into+- 🔄 Closing the main window follows a setting (on by default, MDM keeps running), and with no+ tray icon the window goes to the taskbar instead of vanishing: fix in review+ ([#457](https://github.com/anefzaoui/misterdownloadmanager/pull/457))- 🔄 Download File Info staying open but invisible, with later browser downloads waiting behindit ([#440](https://github.com/anefzaoui/misterdownloadmanager/issues/440)): fix in review- 🔄 Arabic and other non-Latin file names saved unreadable, from Firefox and browsers built on itdiff --git a/crates/app/src/app.rs b/crates/app/src/app.rsindex 4f16cf2e..c93a46f1 100644--- a/crates/app/src/app.rs+++ b/crates/app/src/app.rs@@ -2883,8 +2883,24 @@ impl App {}/// Whether the tray icon is shown somewhere (Linux: a tray host is there; asked when the- /// window is closed, the host may come and go).+ /// window is closed, the host may come and go). On Windows and macOS the icon itself is+ /// asked: the shell can accept it and still show nothing, and a window hidden with no icon+ /// to click has no way back. Cached for the per-frame minimize path.fn tray_shown(&self) -> bool {+ #[cfg(any(target_os = "windows", target_os = "macos"))]+ if let Some(tray) = &self.tray {+ return tray.visible();+ }+ crate::tray::available()+ }++ /// [`tray_shown`] without the cache, for the close decision: an icon can disappear between+ /// the cached answer and the close, and hiding then would be a ghost window.+ fn tray_shown_now(&self) -> bool {+ #[cfg(any(target_os = "windows", target_os = "macos"))]+ if let Some(tray) = &self.tray {+ return tray.visible_now();+ }crate::tray::available()}@@ -3000,16 +3016,26 @@ impl App {};self.run(cmd, None, ctx);}- // Closing hides the window in the tray; downloads and queues go on. On Linux only when a- // tray host shows the icon (#59: without one the window couldn't come back, nor close):- // otherwise closing closes, as any window's does.- if self.tray.is_some()- && !self.exiting- && ctx.input(|i| i.viewport().close_requested())- && self.tray_shown()- {- ctx.send_viewport_cmd(egui::ViewportCommand::CancelClose);- self.hide_to_tray(ctx);+ // Closing hides the window in the tray; downloads and queues go on. With no icon the shell+ // shows (Windows, macOS: a tray that exists but says it has none) the window goes to the+ // taskbar or the Dock instead: still reachable, downloads still going. Everywhere else+ // closing closes, as any window's does: Options' "Keep running when closing the window"+ // off, no tray at all, or Linux with no tray host (#59: a hidden window couldn't come+ // back, and one that merely minimized could never be closed).+ if !self.exiting && ctx.input(|i| i.viewport().close_requested()) {+ let keep = self.tray.is_some() && self.settings.close_to_tray;+ if keep && self.tray_shown_now() {+ tracing::info!("close: hidden to the notification area");+ ctx.send_viewport_cmd(egui::ViewportCommand::CancelClose);+ self.hide_to_tray(ctx);+ } else if keep && cfg!(not(target_os = "linux")) {+ tracing::info!("close: no visible tray icon; minimizing to the taskbar");+ ctx.send_viewport_cmd(egui::ViewportCommand::CancelClose);+ ctx.send_viewport_cmd(egui::ViewportCommand::Minimized(true));+ } else {+ tracing::info!("close: quitting");+ self.exiting = true;+ }}// Options → General → "Minimize to the notification area" (#63): Minimize hides the// window there too, where a tray shows the icon. Wayland can't hide a window: there itdiff --git a/crates/app/src/options.rs b/crates/app/src/options.rsindex e1b158b1..d806d452 100644--- a/crates/app/src/options.rs+++ b/crates/app/src/options.rs@@ -434,7 +434,7 @@ impl OptionsDialog {if portable {s.launch_on_startup = false;}- let checks: [(f32, &mut bool, &str); 6] = [+ let checks: [(f32, &mut bool, &str); 7] = [(94.0,&mut s.launch_on_startup,@@ -470,6 +470,13 @@ impl OptionsDialog {// i18n: checkbox: the Minimize button hides MDM's windows to the notification area (system tray) instead of the taskbarcrate::i18n::mark("Minimize to the notification area"),),+ // MDM's: the × hides the window in the notification area, or quits.+ (+ 210.0,+ &mut s.close_to_tray,+ // i18n: checkbox: closing keeps MDM running, in the notification area when available or else the taskbar, instead of quitting+ crate::i18n::mark("Keep running when closing the window"),+ ),];// Greyed where no tray shows MDM's icon (some Linux desktops): nothing could bring the// window back from there.@@ -478,7 +485,7 @@ impl OptionsDialog {// Portable: nothing is written to the registry, so no start with Windows. Manifest 2// extensions: an IDM-era Chrome policy with no meaning for MDM's extension (MV3):// shown as IDM has it, greyed (D-021).- let enabled = !(portable && i == 0) && i != 2 && (i != 5 || tray);+ let enabled = !(portable && i == 0) && i != 2 && (i < 5 || tray);let check = winui::checkbox_light(ui, o + vec2(30.0, y), v, label, enabled);// Where a start with the session leaves the window (#226).if i == 0 && enabled && check.hovered() {@@ -491,15 +498,20 @@ impl OptionsDialog {"Started with the computer, it starts minimized: no notification area shows its icon here",)});+ } else if i == 6 && check.hovered() {+ // i18n: tooltip of the close-setting: checked keeps MDM running when the window closes, in the notification area when available or else the taskbar; downloads continue; unchecked closing quits+ check.on_hover_text(crate::i18n::t(+ "Checked, closing the window keeps MDM running: it hides in the notification area when available, or minimizes to the taskbar otherwise, and downloads continue; unchecked, closing quits MDM",+ ));}}group(ui,o,16.0,- 215.0,+ 234.0,392.0,- 179.0,+ 160.0,"Capture downloads from the following browsers:",);// Check list: one row per browser in the shared row list (Space ticks the selected@@ -510,7 +522,7 @@ impl OptionsDialog {let ev = winui::row_list(ui,"browsers",- r(o, 30.0, 225.0, 362.0, 97.0),+ r(o, 30.0, 244.0, 362.0, 78.0),browsers.len(),17.0,&mut self.browser_rows,diff --git a/crates/app/src/settings.rs b/crates/app/src/settings.rsindex 9af0f891..2bf5a52c 100644--- a/crates/app/src/settings.rs+++ b/crates/app/src/settings.rs@@ -140,6 +140,10 @@ pub struct Settings {/// notification area, as closing the main window does (#63). On by default (the/// maintainer's choice), for existing lists too. Only where a tray shows MDM's icon.pub minimize_to_tray: bool,+ /// General: closing the main window keeps MDM running, hidden in the notification area (else+ /// closing quits). On by default, for existing lists too, in every copy. Only where a tray+ /// shows MDM's icon.+ pub close_to_tray: bool,pub mv2_extensions: bool,pub advanced_integration: bool,/// General: "Capture downloads from the following browsers" (name, on).@@ -376,6 +380,7 @@ impl Default for Settings {extension_never_ask: false,clipboard_autostart: true,minimize_to_tray: true,+ close_to_tray: true,mv2_extensions: true,advanced_integration: true,browsers: BROWSERS.iter().map(|b| (b.to_string(), true)).collect(),@@ -1310,5 +1315,18 @@ pub(crate) mod sealed {let old: crate::settings::Settings = serde_json::from_value(plain).unwrap();assert_eq!(old.site_logins[0].2, "pw");}++ #[test]+ fn the_close_button_keeps_mdm_running_unless_told_otherwise() {+ let s: crate::settings::Settings =+ serde_json::from_value(serde_json::json!({})).unwrap();+ assert!(+ s.close_to_tray,+ "a list from before the option goes on hiding"+ );+ let s: crate::settings::Settings =+ serde_json::from_value(serde_json::json!({ "close_to_tray": false })).unwrap();+ assert!(!s.close_to_tray);+ }}}diff --git a/crates/app/src/tray.rs b/crates/app/src/tray.rsindex 9aad17f3..d94e90c5 100644--- a/crates/app/src/tray.rs+++ b/crates/app/src/tray.rs@@ -58,6 +58,10 @@ pub struct Tray {download_ids: Arc<Mutex<Vec<(MenuId, u64)>>>,/// Every entry with its English text, to translate again when the language changes.labels: Vec<(Entry, &'static str)>,+ /// What [`Tray::visible`] last saw and when: the minimize path asks every frame, and the+ /// shell shouldn't be asked that often (a second of staleness is enough).+ #[cfg(any(target_os = "windows", target_os = "macos"))]+ visible_checked: std::cell::Cell<Option<(bool, std::time::Instant)>>,}/// A menu entry whose text is translated.@@ -68,6 +72,38 @@ enum Entry {}impl Tray {+ /// Whether the shell is really showing the icon. `tray-icon` ignores a failed+ /// `Shell_NotifyIcon(NIM_ADD)` (it waits for the taskbar to be recreated), so `Tray::new`+ /// returning `Some` doesn't mean the user can see or click the icon. Asking for its rect is+ /// the only way to know. Linux has no such query: its [`available`] stands for it.+ #[cfg(any(target_os = "windows", target_os = "macos"))]+ pub fn visible(&self) -> bool {+ // Off-screen tests can't make the shell answer reliably: the variable says what to+ // answer (the startup tray test uses it with MDM_TEST_TRAY).+ if let Some(v) = std::env::var_os("MDM_TEST_TRAY_VISIBLE") {+ return v == "1";+ }+ if let Some((shown, checked)) = self.visible_checked.get()+ && checked.elapsed() < std::time::Duration::from_secs(1)+ {+ return shown;+ }+ self.visible_now()+ }++ /// [`visible`] without the one-second cache: closing asks once and must not use an answer+ /// from before the icon went away.+ #[cfg(any(target_os = "windows", target_os = "macos"))]+ pub fn visible_now(&self) -> bool {+ if let Some(v) = std::env::var_os("MDM_TEST_TRAY_VISIBLE") {+ return v == "1";+ }+ let shown = self.tray.rect().is_some();+ self.visible_checked+ .set(Some((shown, std::time::Instant::now())));+ shown+ }+/// The icon and its menu; events wake `ctx`. None if the shell refuses the icon.pub fn new(ctx: &egui::Context, rgba: Vec<u8>, size: u32, limiter: bool) -> Option<Tray> {let menu = Menu::new();@@ -183,6 +219,8 @@ impl Tray {shown_downloads: Default::default(),download_ids,labels,+ #[cfg(any(target_os = "windows", target_os = "macos"))]+ visible_checked: Default::default(),})}diff --git a/crates/app/tests/close_without_tray.rs b/crates/app/tests/close_without_tray.rsnew file mode 100644index 00000000..17d560b0--- /dev/null+++ b/crates/app/tests/close_without_tray.rs@@ -0,0 +1,227 @@+//! The close button follows Options' close-to-tray choice and the icon the shell really shows:+//! off quits; on hides; on with no visible icon minimizes to the taskbar instead (downloads+//! continue, and the window stays reachable); with no tray at all it quits, as ever. The real app,+//! off the screens, with data folders of its own; a tray object whose visibility+//! MDM_TEST_TRAY_VISIBLE decides, or no tray object. Windows only (WM_CLOSE), so it runs on+//! request:+//! `cargo test -p mdm-app --test close_without_tray -- --ignored`.++#![cfg(windows)]++use std::path::{Path, PathBuf};+use std::process::{Child, Command, ExitStatus};+use std::time::{Duration, Instant};++const APP: &str = env!("CARGO_BIN_EXE_misterdownloadmanager");+/// The main window's title (main.rs MAIN_TITLE).+const MAIN: &str = concat!("Mister Download Manager ", env!("CARGO_PKG_VERSION"));++/// The app, ended and reaped however the test leaves it (a failed assert too).+struct Process(Child);++impl std::ops::Deref for Process {+ type Target = Child;++ fn deref(&self) -> &Child {+ &self.0+ }+}++impl std::ops::DerefMut for Process {+ fn deref_mut(&mut self) -> &mut Child {+ &mut self.0+ }+}++impl Drop for Process {+ fn drop(&mut self) {+ let _ = self.0.kill();+ let _ = self.0.wait();+ }+}++/// The app's log so far (every file of `logs/`).+fn log(data: &Path) -> String {+ let mut all = String::new();+ if let Ok(dir) = std::fs::read_dir(data.join("logs")) {+ for f in dir.flatten() {+ all += &std::fs::read_to_string(f.path()).unwrap_or_default();+ }+ }+ all+}++/// Wait until the log has `line`, failing if the app quits first or `wait` passes.+fn wait_for(app: &mut Child, data: &Path, line: &str, wait: Duration) {+ let until = Instant::now() + wait;+ loop {+ let text = log(data);+ assert!(!text.contains("panic"), "the app panicked:\n{text}");+ if text.contains(line) {+ return;+ }+ if let Some(status) = app.try_wait().unwrap() {+ panic!("the app closed ({status}) before '{line}':\n{text}");+ }+ assert!(+ Instant::now() < until,+ "no '{line}' after {wait:?}:\n{text}"+ );+ std::thread::sleep(Duration::from_millis(200));+ }+}++/// Wait until the app exits, failing if `wait` passes.+fn wait_exit(app: &mut Child, wait: Duration) -> ExitStatus {+ let until = Instant::now() + wait;+ loop {+ if let Some(status) = app.try_wait().unwrap() {+ return status;+ }+ assert!(Instant::now() < until, "the app didn't exit");+ std::thread::sleep(Duration::from_millis(200));+ }+}++/// The app's environment: off the screens, its own data folder, its tray icon, and whether the+/// test says that icon is visible (MDM_TEST_TRAY_VISIBLE).+fn env<'a>(cmd: &'a mut Command, data: &Path, visible: bool) -> &'a mut Command {+ cmd.env("MDM_DATA_DIR", data)+ .env("MDM_OFFSCREEN", "1")+ .env("MDM_TEST_TRAY", "1")+ .env("MDM_TEST_TRAY_VISIBLE", if visible { "1" } else { "0" })+}++/// The app's environment with no tray object at all (off-screen copies have none unless asked).+fn env_no_tray<'a>(cmd: &'a mut Command, data: &Path) -> &'a mut Command {+ cmd.env("MDM_DATA_DIR", data).env("MDM_OFFSCREEN", "1")+}++/// A data folder whose first start asks nothing and checks nothing, with the close-to-tray+/// choice set.+fn data(dir: &Path, name: &str, close_to_tray: bool) -> PathBuf {+ let data = dir.join(name);+ std::fs::create_dir_all(&data).unwrap();+ let settings = serde_json::json!({+ "update_check": false, "helpers_asked": true, "language_asked": true,+ "extension_never_ask": true, "close_to_tray": close_to_tray,+ "language": "en",+ "torrent_dht": false, "torrent_lsd": false, "torrent_upnp": false,+ "torrent_incoming": false,+ });+ std::fs::write(+ data.join("downloads.json"),+ serde_json::json!({ "next_id": 1, "items": [], "version": 2, "settings": settings })+ .to_string(),+ )+ .unwrap();+ data+}++/// Post WM_CLOSE to the app's main window. True when one was found.+fn close_main(pid: u32) -> bool {+ let script = r#"+Add-Type @'+using System;+using System.Text;+using System.Runtime.InteropServices;+public static class CW {+ public delegate bool P(IntPtr h, IntPtr l);+ [DllImport("user32.dll")] public static extern bool EnumWindows(P f, IntPtr l);+ [DllImport("user32.dll")] public static extern uint GetWindowThreadProcessId(IntPtr h, out uint p);+ [DllImport("user32.dll", CharSet=CharSet.Unicode)] public static extern int GetWindowText(IntPtr h, StringBuilder s, int n);+ [DllImport("user32.dll")] public static extern bool PostMessage(IntPtr h, uint m, IntPtr w, IntPtr l);+}+'@+$script:closed = $false+[CW]::EnumWindows({+ param($h, $l)+ $p = 0+ [CW]::GetWindowThreadProcessId($h, [ref]$p) | Out-Null+ if ($p -eq PID) {+ $t = New-Object System.Text.StringBuilder 512+ [CW]::GetWindowText($h, $t, 512) | Out-Null+ if ($t.ToString() -eq 'TITLE') {+ [CW]::PostMessage($h, 0x10, [IntPtr]::Zero, [IntPtr]::Zero) | Out-Null+ $script:closed = $true+ }+ }+ $true+}, [IntPtr]::Zero) | Out-Null+$script:closed+"#+ .replace("PID", &pid.to_string())+ .replace("TITLE", MAIN);+ let out = Command::new("powershell")+ .args(["-NoProfile", "-NonInteractive", "-Command", &script])+ .output()+ .unwrap();+ String::from_utf8_lossy(&out.stdout).trim() == "True"+}++#[test]+#[ignore = "opens the app's windows (off-screen): needs OpenGL or Direct3D; run with --ignored"]+fn closing_follows_the_option_and_the_tray_icon() {+ let dir = tempfile::tempdir().unwrap();+ let wait = Duration::from_secs(60);++ // The option off: closing quits, as a window's × does.+ let data1 = data(dir.path(), "off", false);+ let mut app = Process(env(&mut Command::new(APP), &data1, true).spawn().unwrap());+ wait_for(&mut app, &data1, "tray icon shown", wait);+ assert!(close_main(app.id()), "no main window to close");+ let status = wait_exit(&mut app, Duration::from_secs(20));+ assert!(status.success(), "{status}");+ assert!(log(&data1).contains("close: quitting"), "{}", log(&data1));++ // The option on and the icon there: closing hides it, and /exit still quits.+ let data2 = data(dir.path(), "on", true);+ let mut app = Process(env(&mut Command::new(APP), &data2, true).spawn().unwrap());+ wait_for(&mut app, &data2, "first frame drawn", wait);+ assert!(close_main(app.id()), "no main window to close");+ wait_for(+ &mut app,+ &data2,+ "close: hidden to the notification area",+ Duration::from_secs(10),+ );+ assert!(+ app.try_wait().unwrap().is_none(),+ "the app quit instead of hiding"+ );+ let _ = env(&mut Command::new(APP), &data2, true)+ .arg("/exit")+ .status();+ let _ = wait_exit(&mut app, Duration::from_secs(20));++ // The option on but no icon the shell shows: keeping running leaves the window in the+ // taskbar, not hidden and not quitting; downloads carry on and /exit still quits.+ let data3 = data(dir.path(), "no-icon", true);+ let mut app = Process(env(&mut Command::new(APP), &data3, false).spawn().unwrap());+ wait_for(&mut app, &data3, "tray icon shown", wait);+ assert!(close_main(app.id()), "no main window to close");+ wait_for(+ &mut app,+ &data3,+ "close: no visible tray icon; minimizing to the taskbar",+ Duration::from_secs(10),+ );+ assert!(+ app.try_wait().unwrap().is_none(),+ "the app quit instead of minimizing"+ );+ let _ = env(&mut Command::new(APP), &data3, false)+ .arg("/exit")+ .status();+ let _ = wait_exit(&mut app, Duration::from_secs(20));++ // No tray at all: closing quits, whatever the option says (#59: nothing could bring a hidden+ // window back, and scripts ending an off-screen copy rely on it).+ let data4 = data(dir.path(), "no-tray", true);+ let mut app = Process(env_no_tray(&mut Command::new(APP), &data4).spawn().unwrap());+ wait_for(&mut app, &data4, "first frame drawn", wait);+ assert!(close_main(app.id()), "no main window to close");+ let status = wait_exit(&mut app, Duration::from_secs(20));+ assert!(status.success(), "{status}");+ assert!(log(&data4).contains("close: quitting"), "{}", log(&data4));+}diff --git a/crates/app/tests/startup_tray.rs b/crates/app/tests/startup_tray.rsindex 89c7282f..90206679 100644--- a/crates/app/tests/startup_tray.rs+++ b/crates/app/tests/startup_tray.rs@@ -54,7 +54,9 @@ fn wait_for(app: &mut Child, data: &Path, line: &str, wait: Duration) {fn env<'a>(cmd: &'a mut Command, data: &Path, startup: &Startup) -> &'a mut Command {cmd.env("MDM_DATA_DIR", data).env("MDM_OFFSCREEN", "1")- .env("MDM_TEST_TRAY", "1");+ .env("MDM_TEST_TRAY", "1")+ // A test's shell isn't asked where the icon is: say it is shown (app.rs tray_shown).+ .env("MDM_TEST_TRAY_VISIBLE", "1");#[cfg(windows)]cmd.env("MDM_TEST_RUN_VALUE", &startup.name);#[cfg(unix)]diff --git a/docs/getting-started.md b/docs/getting-started.mdindex 9303b7a7..1486d7fd 100644--- a/docs/getting-started.md+++ b/docs/getting-started.md@@ -234,7 +234,7 @@ used, and how to make and share one.## The tray icon-Closing the main window doesn't quit MDM. It hides in the notification area, and downloads, queues and schedules carry on.+Closing the main window doesn't quit MDM. It hides in the notification area, and downloads, queues and schedules carry on. To make closing quit (a portable copy's folder can then be deleted), untick **Options → General → Keep running when closing the window**. If there is no icon for MDM at all — not in the notification area, nor behind the ^ hidden icons — the window minimizes to the taskbar instead, so downloads continue and there is a way back. An icon behind ^ can be clicked to bring the window back, and starting MDM again always does.On Linux this needs a tray, which most desktops have (KDE Plasma, Xfce, Cinnamon, Ubuntu's GNOME or GNOME with the AppIndicator extension, waybar's tray). On a desktop without one (some tiling window managers), closing the window quits MDM, since there would be nowhere to bring it back from.@@ -245,7 +245,7 @@ On Linux this needs a tray, which most desktops have (KDE Plasma, Xfce, Cinnamon- Right-click it for **Add new download**, **Add batch download**, **Downloads in progress**, **Speed Limiter**, **Scheduler**, the main download queue, **Options** and **Exit**.- **Downloads in progress** lists the running downloads. Choose one to see its progress window.-Minimize hides the main window there too, while **Minimize to the notification area** is on in **Options → General**. It is on by default.+Minimize hides the main window there too, while **Minimize to the notification area** is on in **Options → General**. It is on by default; where the tray has no icon, Minimize sends the window to the taskbar instead.A download's progress window can go there as well, with its Minimize or with its **Hide to the notification area** button: a short dash with an arrow down to the corner.diff --git a/docs/images/help/options-general.webp b/docs/images/help/options-general.webpindex 183208d8..622f8978 100644Binary files a/docs/images/help/options-general.webp and b/docs/images/help/options-general.webp differdiff --git a/docs/options.md b/docs/options.mdindex e08cd09f..db523986 100644--- a/docs/options.md+++ b/docs/options.md@@ -15,7 +15,8 @@ Some buttons are greyed. They belong to features that aren't built yet.- **Offer to download links copied to the clipboard** — when you copy a link whose file type is on the **File types** page, **Download File Info** opens with it, ready to start (or the download starts at once, with **Show start download dialog** off). It keeps to archives, programs, music, videos, PDF and any type you added yourself, so copying the address of a picture, a font or a 3D model to use somewhere else never starts a download. On by default.- **Use advanced browser integration** — let the browser extension hand downloads to MDM. Turn it off to keep every download in the browser.- **Confirm before deleting downloads** — ask before taking downloads off the list. On by default; **Don't show this dialog again** in that question turns it off, and ticking it here turns it back on.-- **Minimize to the notification area** — Minimize hides the main window, and a download's progress window, in the notification area, as closing the main window does; downloads go on. On by default. Greyed where no tray shows MDM's icon (some Linux desktops); in a Wayland session the main window stays minimized in the dock, since Wayland can't hide a window.+- **Keep running when closing the window** — closing the main window hides it in the notification area instead of quitting, and downloads, queues and schedules go on. On by default; unticked, closing quits MDM (so a [portable copy](portable.md)'s folder can then be deleted). If there is no icon for MDM at all — not even behind the ^ hidden icons — the window minimizes to the taskbar instead, so downloads continue and the window stays reachable; an icon behind ^ can be clicked to bring it back, or start MDM again. Greyed where no tray shows MDM's icon (some Linux desktops): closing quits there.+- **Minimize to the notification area** — Minimize hides the main window, and a download's progress window, in the notification area; downloads go on. On by default. Where the tray has no icon, the main window minimizes to the taskbar instead. The close setting above is separate; when it is on, closing hides there too (or minimizes to the taskbar if there is no icon at all). Greyed where no tray shows MDM's icon (some Linux desktops); in a Wayland session the main window stays minimized in the dock, since Wayland can't hide a window.- **Capture downloads from the following browsers** — untick a browser to leave its downloads alone.- **Customize MDM Download panels in browsers → Edit...** — the download button over videos on web pages: turn it off, or list the sites it never shows on (separate them by spaces; `*.example.com` covers its subdomains). See [Browser integration](browser-integration.md#the-download-button-over-videos).diff --git a/i18n/en.tsv b/i18n/en.tsvindex f7c729e2..842b0f54 100644--- a/i18n/en.tsv+++ b/i18n/en.tsv@@ -614,6 +614,9 @@Check for updates at every start Check for updates at every start#. text in helpers.rsCheck your connection, then try again, or get them later from the video window. Check your connection, then try again, or get them later from the video window.+#. text in the Options window+#. tooltip of the close-setting: checked keeps MDM running when the window closes, in the notification area when available or else the taskbar; downloads continue; unchecked closing quits+ Checked, closing the window keeps MDM running: it hides in the notification area when available, or minimizes to the taskbar otherwise, and downloads continue; unchecked, closing quits MDM Checked, closing the window keeps MDM running: it hides in the notification area when available, or minimizes to the taskbar otherwise, and downloads continue; unchecked, closing quits MDM#. message or event log entry in the main window#. event log entry after Recheck: {have} and {total} are sizes ("1.2 GB of 4 GB there")Checked: {have} of {total} there Checked: {have} of {total} there@@ -1595,6 +1598,9 @@Kazakhstan Kazakhstan#. text in a dialog box; text in a download's progress window; text in the Add torrent windowKBytes/sec KBytes/sec+#. text in the Options window+#. checkbox: closing keeps MDM running, in the notification area when available or else the taskbar, instead of quitting+ Keep running when closing the window Keep running when closing the window#. checkbox in the Add torrent windowKeep sharing torrents after they finish Keep sharing torrents after they finish#. text in countries.rsdiff --git a/i18n/ro.tsv b/i18n/ro.tsvindex 1ee8907b..884058a2 100644--- a/i18n/ro.tsv+++ b/i18n/ro.tsv@@ -820,6 +820,10 @@#. text in helpers.rs#, machineCheck your connection, then try again, or get them later from the video window. Verificați-vă conexiunea, apoi încercați din nou sau obțineți-le mai târziu din fereastra video.+#. text in the Options window+#. tooltip of the close-setting: checked keeps MDM running when the window closes, in the notification area when available or else the taskbar; downloads continue; unchecked closing quits+#, machine+ Checked, closing the window keeps MDM running: it hides in the notification area when available, or minimizes to the taskbar otherwise, and downloads continue; unchecked, closing quits MDM Bifat, la închiderea ferestrei MDM continuă să ruleze: fereastra se ascunde în zona de notificare când aceasta este disponibilă, altfel se minimizează în bara de activități, iar descărcările continuă; nebifat, MDM se închide.#. message or event log entry in the main window#. event log entry after Recheck: {have} and {total} are sizes ("1.2 GB of 4 GB there")#, machine@@ -2155,6 +2159,8 @@#. text in a dialog box; text in a download's progress window; text in the Add torrent window#, machineKBytes/sec KB/sec+#. text in the Options window+ Keep running when closing the window Continuă rularea la închiderea ferestrei#. checkbox in the Add torrent window#, machineKeep sharing torrents after they finish Continuați partajarea torrenturilor după finalizare