[Bug/High] Printer properties dialog doesn't apply selected printer and settings from ICCery #186
Notifications
Due Date
No due date set.
Depends on
Reference: gronod/iccery-v2-mac#186
Reference in New Issue
Block a user
Summary
The printer properties button (gear icon) in Stage 2 opens the OS print dialog (
NSPrintPanel), but it doesn't apply the paper size, quality, media type, or orientation selected in ICCery.Related to
Issue #180 — Epson printer quality options limited to default only
Bug Details
Current Behavior
PrintPanelService.showProperties()is called with the selected queueNSPrintPanelopens but:Binding note: "falls back to system default" is not possible on the PM path —
PMSessionSetCurrentPMPrinterfailure throwssessionBindingFailed(PrintPanelService.swift:83-87), and theNSPrinter(name:)fallback throwsnoPrinterFoundwhen it can't resolve (:93-100). The realistic residual risk is the display-name fallback binding a different queue — hardware-verify, not a proven defect.Root Cause Analysis
In
PrintPanelService.runNativePanel()(Sources/ICCery/Print/PrintPanelService.swift:64-162):NSPrintInfo()with default valuesPMPrinterCreateFromPrinterID+PMSessionSetCurrentPMPrinterPMSessionDefaultPrintSettingsandPMSessionDefaultPageFormat— these load printer defaults, not user-selected valuespanel.runModal(with: printInfo)Missing:
PMPageFormatpaper size andPMPrintSettingsquality/media/orientation beforerunModalcupsOptions/mediaType(PrintPanelService.swift:142-161) — it must extend topaperSize/quality/orientationparsed from the capturedk=vstringExpected Behavior
pageSize(A4 default)Implementation Notes
pageSize,selectedQuality,selectedMediaType,printOrientationfromPrintSessionViewModeltoPrintPanelService.showProperties()— the initial-selections plumbing for paper size + quality is #183 scope; this issue adds media type + orientationrunNativePanel(), before showing panel:PageSizeinPMPrintSettings(drivers/capture read it) andPMPageFormatviaPMPaper— the panel's paper dropdown reflectsPMPageFormat;PMPrintSettingsSetValuewrites print settings only and cannot set the page format. Path:PMPrinterGetPaperList/PMPaperGetID+PMPageFormatCreateWithPMPaper+PMSessionValidatePageFormat;printInfo.paperSize/PMPaperCreateCustomfor custom sizes. Verify exact PM calls against PrintCore headers at implementation (deprecated-but-present APIs on macOS 12)PMPrintSettingsSetValuewith detected quality key (e.g.,EPIJ_Qual,cupsPrintQuality)PMPrintSettingsSetValuewith detected media keyPMPrintSettingsSetValuewithorientation-requestedPMSessionDefaultPrintSettings/PMSessionDefaultPageFormatbut before ColorSync suppression layers ②–⑤Spec References
PMPrinterCreateFromPrinterID→PMSessionSetCurrentPMPrinterPrintOptionsstructure carriespaper_size,media_type,orientation(spec naming; Swift fields arepaperSize/mediaType/orientation)Dependencies
showPropertiesinitial-selections for paper size + quality; this issue completes media type + orientation preselect, capture-return of all fields, and binding verificationAcceptance Criteria
PrintPropertiesResult— includingpaperSize/quality/orientation, not onlycupsOptions/mediaTypePlanning errata (verified on develop@736fd08):
PMPageFormatpaper size viaPMPrintSettingsSetValue" —PMPrintSettingsSetValuewrites print settings only; the panel's paper dropdown reflectsPMPageFormat. Both writes are required:PageSizeinPMPrintSettings(drivers/capture read it) andPMPageFormatviaPMPaper(PMPrinterGetPaperList/PMPaperGetID+PMPageFormatCreateWithPMPaper+PMSessionValidatePageFormat;printInfo.paperSize/PMPaperCreateCustomfor custom). Exact PM calls verified against PrintCore headers at implementation (deprecated-but-present APIs on macOS 12).NSPrinter(name:)fallback throwsnoPrinterFoundwhen nil (:95–99). The realistic failure is a display-name fallback binding a different queue — hardware-verify, not a proven defect.cupsOptions/mediaType(currently the only fields parsed, PrintPanelService.swift:142–157) topaperSize/quality/orientationparsed from the capturedk=vstring.Errata above incorporated into the issue body — the ticket itself is now the corrected contract.