Repository navigation
macOS: open presentations from Finder, Open With and the Dock (#138, #347) - #432
Conversation
…ting to the system region (storytold#463) * Issue storytold#432: global Units preference (mm, cm, in, pt), defaulting to the system region Preferences ▸ Documents and view ▸ Units sets the unit for page sizes (Document Properties, Print), Header & Footer margins, the start of Set Page Boxes and the Measure tool on pages without a viewport scale. On first start it follows the system region: AppleMeasurementUnits on macOS, Region ▸ Measurement system (iMeasure) on Windows, then LC_ALL / LC_MEASUREMENT / LANG; inches for US, LR and MM, millimetres elsewhere. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Issue storytold#432: macOS falls back to AppleLocale when the measurement system was never set AppleMeasurementUnits only exists in the global domain once someone changed Measurement system in System Settings, and apps started from the Finder get no LANG, so a German Mac with untouched settings landed on inches. The region of AppleLocale (always present) decides next; AppleMeasurementUnits still wins. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01REz7wTfQgnopyvN9eQJJVu * Issue storytold#432: Units labels in the Arabic and Italian catalogs new on main Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01REz7wTfQgnopyvN9eQJJVu * Issue storytold#432: the Print dialog's PDF page size follows the Units preference Main's new "PDF page: {w} × {h} in" label was always in inches. It now uses the preferred unit like the sheet size next to it; each catalog keeps its wording with the size in place of the inch values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Tristan von Kries <tristan@MacBook-Pro-von-Tristan.local> Co-authored-by: Brandon Thomas <echelon@gmail.com>
The macOS bundle declared the .deckcraft and .pptx types but listed no CFBundleDocumentTypes, so DeckCraft never appeared under Open With and couldn't be made the default app for presentations. Finder opens also arrive as a kAEOpenDocuments Apple event, not argv, which winit doesn't handle, so a double-clicked file wouldn't have loaded anyway. - Info.plist.in: document types for DeckCraft Presentation (Owner) and PowerPoint Presentation (Alternate, so PowerPoint/Keynote stay preferred unless the user picks DeckCraft). - apple_events.rs: register an open-documents handler with the pinned fmv-macos-events crate GridCraft already uses, and open the paths each frame; failures show in the status bar. - Ignore the -psn_ argument older macOS passes on a Finder launch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WxAm8VMKHa5w6kwkjBaT3D
…, log the change Windows (deckcraft.wxs) and Linux (the desktop file) already offer DeckCraft for .deckcraft, .pptx, .potx and .ppsx; the macOS Info.plist now declares the same four, so a template or a slide show opens from Finder as well. A test in apps/deckcraft reads the three packaging files and fails when they drift apart, and checks every document type names its content type (Finder's "Change All" needs it). Progress log row for storytold#138 and storytold#347. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
b3aa24e to
9632162
Compare
skylartaylor
left a comment
There was a problem hiding this comment.
Looks good to merge. The document declarations cover the same four formats as the other desktop packages, and the pinned macOS adapter is registered before the event loop, retained for its lifetime, and wakes egui when another event arrives. The packaging and launch-argument regression tests cover the missing declarations and Finder's legacy argument.
I checked this head merged into current main (63831cd), without the follow-up change applied. A temporary macOS bundle passed cold PPTX opening, later PPTX/native/POTX/PPSX opens, invalid-file handling with existing documents retained, and Apple-event quit. Formatting, clippy, PDF dependency checks, assets, layering and WebAssembly checks pass. The remaining workspace tests pass with the unchanged intermittent a_line_that_is_not_a_request_closes_the_connection test excluded; that test also failed in earlier local runs. The fork's hosted workflows have now been approved and are running.
No blocking code findings. I'll follow this with a small change to call the newer open_from_system path, so Finder-opened .ppsx files start their slideshow just as command-line opens do, with regression tests. Thanks for retaining the original work from #311.
Fixes #138, fixes #347.
On macOS, DeckCraft set as the default app for
.pptxlaunched on a double-click and then showed "DeckCraft cannot open files in the Office Open XML presentation format":Info.plisthad noCFBundleDocumentTypes, and the file arrives as akAEOpenDocumentsApple event that winit 0.30 doesn't handle.This builds on #311 by @mendy-cohen, whose commit I kept as is (the same
fmv-macos-eventsapproach as GridCraft,-psn_ignored), and adds what the packaging rules ask for:.potxand.ppsxtoo. The Windows installer (deckcraft.wxs) and the Linux desktop file already offer DeckCraft for.deckcraft,.pptx,.potxand.ppsx; the macOS plist now declares the same four (org.openxmlformats.presentationml.templateand.slideshowimported like.presentation). The pptx reader takes all three.apps/deckcraft/src/main.rs): reads the three packaging files and fails when the sets drift apart, and checks every document type names its content type (Finder's "Change All" needs it).ROADMAP.md.PowerPoint stays the default until the user picks DeckCraft (
LSHandlerRankAlternate).Testing
packaging/macos/package.sh --arch aarch64(ad-hoc signature) installed to /Applications, DeckCraft chosen as the default app for.pptx:open "Проверка Finder (1).pptx"(what a Finder double-click sends) launches DeckCraft with the deck open:document.inspectover the control port shows the file's path and both slides, where 0.5.0 showed the "cannot open files in the Office Open XML presentation format" alert;open -a DeckCraftwith a.potx, a.ppsxand a.deckcraftwhile DeckCraft is running: each opens in the running app;quit app "DeckCraft"from AppleScript quits it (theEvent::Quitpath);--versionstill prints and exits; the log has no errors or warnings.cargo test -p deckcraft(20 passed, the new test included),cargo clippy -p deckcraft --all-targets -- -D warnings,cargo fmt --check,plutil -linton the rendered plist.The other open fixes for the same bug: #68, #180, #186, #311.
🤖 Generated with Claude Code