diff --git a/Cargo.lock b/Cargo.lock index 5b98d26..79ed566 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2245,7 +2245,7 @@ dependencies = [ [[package]] name = "pdf-presenter" -version = "0.1.93" +version = "0.1.94" dependencies = [ "bytemuck", "chrono", diff --git a/Cargo.toml b/Cargo.toml index fcea899..1aa76dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ default-members = ["crates/pdf-presenter"] resolver = "3" [workspace.package] -version = "0.1.93" +version = "0.1.94" edition = "2024" license = "MIT" repository = "https://proxy.dandaedre.com/gitea/idle-org/pdf-presenter" diff --git a/crates/pdf-presenter/src/localization.rs b/crates/pdf-presenter/src/localization.rs index 7d5d3ea..e43392d 100644 --- a/crates/pdf-presenter/src/localization.rs +++ b/crates/pdf-presenter/src/localization.rs @@ -237,6 +237,10 @@ fn fr(text: &str) -> &str { "Quick settings" => "Réglages rapides", "Memory and cache" => "Mémoire et cache", "Storage and preparation" => "Stockage et préparation", + "Application executable" => "Exécutable de l’application", + "This is the running portable executable. Use its containing folder to find or remove the application." => { + "Il s’agit de l’exécutable portable en cours d’utilisation. Son dossier permet de retrouver ou supprimer l’application." + } "Storage locations" => "Emplacements de stockage", "Preparing slide…" => "Préparation de la diapositive…", "Slide ready" => "Diapositive prête", @@ -615,6 +619,8 @@ fn es(text: &str) -> &str { "Memory and cache" => "Memoria y caché", "Disk cache" => "Caché de disco", "Storage and preparation" => "Almacenamiento y preparación", + "Application executable" => "Ejecutable de la aplicación", + "This is the running portable executable. Use its containing folder to find or remove the application." => "Este es el ejecutable portátil en uso. Utilice la carpeta que lo contiene para encontrar o eliminar la aplicación.", "Storage locations" => "Ubicaciones de almacenamiento", "Preparing slide…" => "Preparando diapositiva…", "Slide ready" => "Diapositiva lista", @@ -764,6 +770,8 @@ fn ja(text: &str) -> &str { "Memory and cache" => "メモリとキャッシュ", "Disk cache" => "ディスクキャッシュ", "Storage and preparation" => "保存場所と準備", + "Application executable" => "アプリケーションの実行ファイル", + "This is the running portable executable. Use its containing folder to find or remove the application." => "現在実行中のポータブル実行ファイルです。アプリを見つけたり削除したりするには、このファイルがあるフォルダーを使用してください。", "Storage locations" => "保存場所", "Preparing slide…" => "スライドを準備中…", "Slide ready" => "スライドの準備完了", @@ -832,6 +840,8 @@ fn zh_cn(text: &str) -> &str { "Enable page zoom" => "启用页面缩放", "Page zoom" => "页面缩放", "Reset zoom" => "重置缩放", "Disable zoom" => "禁用缩放", "Keep zoom enabled" => "保持缩放启用", "Memory and cache" => "内存和缓存", "Disk cache" => "磁盘缓存", "Storage and preparation" => "存储和准备", "Storage locations" => "存储位置", + "Application executable" => "应用程序可执行文件", + "This is the running portable executable. Use its containing folder to find or remove the application." => "这是当前运行的便携版可执行文件。可通过其所在文件夹查找或删除本应用程序。", "Preparing slide…" => "正在准备幻灯片…", "Slide ready" => "幻灯片已就绪", "Loading into memory…" => "正在加载到内存…", "Could not load slide" => "无法加载幻灯片", "Quit presentation?" => "退出演示?", "Quit presentation" => "退出演示", "This closes Presenter and all Slides windows." => "这将关闭演讲者窗口和所有幻灯片窗口。", @@ -878,7 +888,9 @@ fn de(text: &str) -> &str { "Live browsing" => "Live-Durchsuchen", "Change on click" => "Bei Klick wechseln", "Show selected" => "Auswahl zeigen", "Enable page zoom" => "Seitenzoom aktivieren", "Page zoom" => "Seitenzoom", "Reset zoom" => "Zoom zurücksetzen", "Memory and cache" => "Speicher und Cache", "Disk cache" => "Datenträgercache", - "Storage and preparation" => "Speicher und Vorbereitung", "Quit presentation?" => "Präsentation beenden?", + "Storage and preparation" => "Speicher und Vorbereitung", "Application executable" => "Anwendungsdatei", + "This is the running portable executable. Use its containing folder to find or remove the application." => "Dies ist die aktuell ausgeführte portable Anwendungsdatei. Über ihren Ordner können Sie die Anwendung finden oder entfernen.", + "Quit presentation?" => "Präsentation beenden?", "Quit presentation" => "Präsentation beenden", "This closes Presenter and all Slides windows." => "Dadurch werden der Präsentator und alle Folienfenster geschlossen.", "Swap displays…" => "Bildschirme tauschen…", "Go to slide" => "Zu Folie springen", "Keep these display settings?" => "Diese Bildschirmeinstellungen behalten?", "Keep changes" => "Änderungen behalten", @@ -919,7 +931,9 @@ fn pt_br(text: &str) -> &str { "Safe browsing" => "Navegação segura", "Live browsing" => "Navegação ao vivo", "Change on click" => "Alterar ao clicar", "Show selected" => "Mostrar selecionado", "Enable page zoom" => "Ativar zoom da página", "Page zoom" => "Zoom da página", "Reset zoom" => "Redefinir zoom", "Memory and cache" => "Memória e cache", "Disk cache" => "Cache em disco", - "Storage and preparation" => "Armazenamento e preparação", "Quit presentation?" => "Sair da apresentação?", + "Storage and preparation" => "Armazenamento e preparação", "Application executable" => "Executável do aplicativo", + "This is the running portable executable. Use its containing folder to find or remove the application." => "Este é o executável portátil em uso. Use a pasta que o contém para encontrar ou remover o aplicativo.", + "Quit presentation?" => "Sair da apresentação?", "Quit presentation" => "Sair da apresentação", "This closes Presenter and all Slides windows." => "Isso fecha o Apresentador e todas as janelas de slides.", "Swap displays…" => "Trocar telas…", "Go to slide" => "Ir para o slide", "Keep these display settings?" => "Manter estas configurações de tela?", "Keep changes" => "Manter alterações", diff --git a/crates/pdf-presenter/src/presenter_ui.rs b/crates/pdf-presenter/src/presenter_ui.rs index 508e334..896adcf 100644 --- a/crates/pdf-presenter/src/presenter_ui.rs +++ b/crates/pdf-presenter/src/presenter_ui.rs @@ -2556,6 +2556,21 @@ fn preferences_window(ctx: &egui::Context, s: &mut Studio, open: &mut bool) { layout_section(ui, tr(&locale, "Storage and preparation"), |ui| { ui.label(s.preparation_status()); ui.separator(); + ui.label( + egui::RichText::new(tr(&locale, "Application executable")).strong(), + ); + let executable = s.executable_path().display().to_string(); + ui.add( + egui::Label::new(egui::RichText::new(&executable).monospace()) + .selectable(true) + .wrap(), + ) + .on_hover_text(&executable); + ui.small(tr( + &locale, + "This is the running portable executable. Use its containing folder to find or remove the application.", + )); + ui.separator(); ui.label(format!( "{}: {}", tr(&locale, "Processed slides"), diff --git a/crates/pdf-presenter/src/studio.rs b/crates/pdf-presenter/src/studio.rs index 618fa30..01509a5 100644 --- a/crates/pdf-presenter/src/studio.rs +++ b/crates/pdf-presenter/src/studio.rs @@ -324,6 +324,9 @@ impl Studio { .as_ref() .map_or_else(|| "empty".into(), |d| d.key.clone()) } + pub fn executable_path(&self) -> &std::path::Path { + &self.worker_program + } pub fn frame(&self, page: usize) -> Option> { [self.target_edge, 512, 1280, 320] .iter() diff --git a/crates/pdf-presenter/tests/presenter_ui.rs b/crates/pdf-presenter/tests/presenter_ui.rs index dc501b8..15f9ab4 100644 --- a/crates/pdf-presenter/tests/presenter_ui.rs +++ b/crates/pdf-presenter/tests/presenter_ui.rs @@ -1794,6 +1794,42 @@ fn preferences_window_stays_on_the_presenter_that_opened_it() { assert!(!render(1, "two")); } +#[test] +fn preferences_show_the_running_executable_path() { + fn contains(shape: &egui::Shape, text: &str) -> bool { + match shape { + egui::Shape::Text(label) => label.galley.text() == text, + egui::Shape::Vec(shapes) => shapes.iter().any(|shape| contains(shape, text)), + _ => false, + } + } + let ctx = Context::default(); + let mut s = studio(); + s.preferences_open = true; + let expected = s.executable_path().display().to_string(); + let mut ui = UiState::default(); + let mut output = ctx.run_ui(input(Vec2::new(1280., 900.)), |root| { + presenter_ui::presenter(root, &mut s, &mut ui) + }); + for _ in 0..2 { + output = ctx.run_ui(input(Vec2::new(1280., 900.)), |root| { + presenter_ui::presenter(root, &mut s, &mut ui) + }); + } + assert!( + output + .shapes + .iter() + .any(|shape| contains(&shape.shape, "Application executable")) + ); + assert!( + output + .shapes + .iter() + .any(|shape| contains(&shape.shape, &expected)) + ); +} + #[test] fn any_presenter_can_edit_and_save_another_presenter_layout() { fn find(shape: &egui::Shape, label: &str) -> Option { diff --git a/docs/changelog.md b/docs/changelog.md index c2df50c..4183084 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,14 @@ ## Unreleased +### 0.1.94 + +- Show the full, selectable path of the running portable executable under + **Preferences → Storage and preparation**, with guidance for finding its folder + when updating or removing the application. +- Linux formatting, warnings-denied Clippy/rustdoc, workspace tests, build and + 13 Python helper tests pass. Full GUI coverage is 83.83% against the 75% floor. + ### 0.1.93 - Move the open source name out of the Presenter header and into a dedicated bottom diff --git a/docs/user-guide.md b/docs/user-guide.md index e3e20e0..7ff3012 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -27,6 +27,9 @@ To update, close PDF Presenter, download and extract the new portable release, and run its executable. Settings and saved layouts live in your user configuration directory, outside the extracted folder. If you installed the Linux launcher, rerun its installer from the new location so it points to the updated binary. +**Menu → Preferences… → Storage and preparation** shows the full path of the +currently running executable, so you can find its portable folder when updating or +removing the application. Physical display routing, sleep prevention and clean-machine compatibility still need broader acceptance testing. Rehearse on the displays you plan to use before a