5 Commits
Author SHA1 Message Date
Hakan SevenandClaude Fable 5.1 92ce142c03 fix: drop the stray lock fixture; align merged plot code across targets
- tests/fixtures/plot/.page-setups-metric.dxf.ocs.lock was the app's own
  single-instance lock file, committed by accident in #1343; remove it and
  ignore *.ocs.lock.
- load_plotsettings_into_dialog: #1343's refresh_custom_scale_fields borrowed
  self while #1360 still wrote through the plot_dialog borrow; write the
  style error first.
- The wasm list_printers stub returns the Result #1358 gave the native one.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-19 23:06:09 +03:00
PanosandClaude Opus 5 1448909b6f feat(options): OK / Apply / Close with a discard guard
The Options window used to commit every control the moment it was
touched, with no way back but re-editing. It now works like the Drafting
Settings window: changes still show at once (a theme, a cursor size or a
language is seen immediately), but nothing is committed until Apply or OK.
Close — and the window's × or Esc — puts everything back the way it was
when the window opened or Apply was last pressed, asking first when there
is something to lose.

The commit point is a snapshot of the persisted configuration plus the
drawing variables the 3D Modeling page edits (with the drawing's modified
flag), so every control the window has or gains is covered without being
registered; reverting re-applies the snapshot the way start-up does and
re-bakes text or regenerates solids when those settings moved.

The "unsaved changes" guard is now a shared modal helper used by both
windows.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-18 14:53:54 +03:00
PanosandClaude Opus 5 74936063f9 feat(plot): PSETUPIN and page-setup import, page setup for new layouts
- PSETUPIN / -PSETUPIN: with no arguments a file picker offers the chosen
  drawing's named page setups in the Plot dialog; `PSETUPIN <file>` opens
  the same chooser on that file; `PSETUPIN <file> *` or
  `PSETUPIN <file> name,name` import straight away. Same-named setups are
  replaced, the import is one undo step, and the report counts both.
- The Plot dialog's page-setup list gains "Import…": the chooser shows the
  source drawing's setups with a tick each, All, Import and Cancel, and
  selects the first imported setup afterwards. The source is read off the
  UI thread with the same reader the editor uses for its own setups
  (`scene::document_page_setups`), and handles that only meant something
  in the source drawing (plot view, visual style) are dropped on import.
- Options → General → Plotting: "Show the page setup for new layouts"
  opens the Plot / Page Setup dialog whenever a layout is created
  (persisted with the plot preferences).

Tests: the document reader, the command (all / named / unknown / missing
file / undo) against a drawing saved by the app, the chooser flow, and the
new-layout option. Nine new strings in all 21 locales.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-18 14:53:09 +03:00
PanosandClaude Opus 5 7efb04a666 feat(plot): page-setup units, custom scale, hide-paperspace, save-to-layout and the plot sysvars
Plot dialog:
- "Units" (millimetres / inches) is the page setup's own unit: the offsets
  and the custom scale are shown in it, the stored ratio converts with it
  so the plotted result and the paper space's unit stay the same
- "Custom: [paper] mm = [drawing] units" spells the picked scale in that
  unit and accepts a typed ratio, which selects the list's name for it or
  becomes a ratio entry of its own
- "Hide paperspace objects" is the page setup's plot-hidden flag; it is no
  longer derived from the "Hidden Line" shade mode
- "Save changes to layout" (paper layouts, on by default) writes the dialog
  into the layout when a plot is sent; previews never touch it
- offsets are labelled in the page-setup unit and kept in millimetres in
  the file

System variables (typeable, through SETVAR, listed by SETVAR ?):
- PLOTOFFSET, PAPERUPDATE, PLOTROTMODE, PLOTTRANSPARENCYOVERRIDE and
  BACKGROUNDPLOT live with the persisted plot preferences: the plot origin
  counts from the printable corner unless PLOTOFFSET says the paper edge;
  a printer that does not list the sheet either warns or switches to its
  default sheet; transparency can be forced on or off; BACKGROUNDPLOT bit 1
  is the dialog's background switch and bit 2 drives batch plots
- CTAB and TILEMODE read and switch the current layout

Tests cover every new control and variable; six new strings in all 21
locales; the Plot dialog grows to 940×690 for the two extra rows.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-18 14:53:01 +03:00
PanosandClaude Opus 5 8e09bd8463 fix(plot): follow the fixture's page-setup conventions
A drawing saved by a commercial CAD application (tests/fixtures/plot,
provided by Panos: one 10 m line, three layouts) corrects several
assumptions of the previous commit:

- rotation is relative to the medium's own orientation: an unchanged sheet
  keeps the driver's exact medium (its PDF driver lists landscape media of
  its own, written with rotation 0; a system printer's portrait A3 plotted
  landscape carries 90); only a newly picked sheet is written as the
  catalogue's portrait medium
- the stored scale factor (DXF 147) is the ratio × 25.4 on millimetre page
  setups and the plain ratio on inch ones; the "use standard scale" bit
  stays clear for standard and custom scales and is set for fit-to-paper;
  a standard code is kept across a paper-unit conversion ("1:1" on an
  inch page setup over a millimetre paper space is 1 in = 25.4 units)
- layout plots take the same scale path as every other area, so a foreign
  layout's paper-space unit survives
- "plot with plot styles" / "display plot styles" round-trip as the
  dialog's checkboxes, independent of a style table being named
- layout limits place the sheet at minus its displayed margins, the way the
  source application does (the printable corner is the paper-space origin);
  the margin ↔ rotation mapping shared by the printable-area guide now
  turns the medium's top margin into the layout's left one at 90°

The fixture round-trips through the dialog with every stored field
unchanged; picking a new sheet on it writes the canonical form.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-17 18:04:38 +03:00