Convert draft_shield from enum to checkbox #538

Open
opened 2026-04-05 16:22:25 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @gerchowl on 3/1/2026

Summary

  • Convert draft_shield from a two-value enum (disabled/enabled) to a simple coBool checkbox
  • Removes unnecessary enum machinery (DraftShield enum, static maps)
  • Adds legacy migration in handle_legacy(): "disabled"/"limited" -> "0", "enabled" -> "1"

Changes

  • PrintConfig.hpp: Remove DraftShield enum, change config option type to ConfigOptionBool
  • PrintConfig.cpp: Remove enum static maps, update definition from coEnum to coBool, update legacy handler, update has_skirt() helper
  • Print.cpp: Replace all == dsEnabled / != dsDisabled comparisons with .value / !.value
  • GCode.cpp: Same enum-to-bool replacements
  • ConfigManipulation.cpp: Replace opt_enum<DraftShield> with opt_bool

Test plan

  • CI build passes
  • Draft shield checkbox toggles correctly in UI
  • Loading legacy projects with draft_shield: "disabled" / "enabled" / "limited" migrates correctly
  • Skirt height field disables when draft shield is checked

🤖 Generated with Claude Code

*Originally created by @gerchowl on 3/1/2026* ## Summary - Convert `draft_shield` from a two-value enum (`disabled`/`enabled`) to a simple `coBool` checkbox - Removes unnecessary enum machinery (`DraftShield` enum, static maps) - Adds legacy migration in `handle_legacy()`: `"disabled"`/`"limited"` -> `"0"`, `"enabled"` -> `"1"` ## Changes - `PrintConfig.hpp`: Remove `DraftShield` enum, change config option type to `ConfigOptionBool` - `PrintConfig.cpp`: Remove enum static maps, update definition from `coEnum` to `coBool`, update legacy handler, update `has_skirt()` helper - `Print.cpp`: Replace all `== dsEnabled` / `!= dsDisabled` comparisons with `.value` / `!.value` - `GCode.cpp`: Same enum-to-bool replacements - `ConfigManipulation.cpp`: Replace `opt_enum<DraftShield>` with `opt_bool` ## Test plan - [ ] CI build passes - [ ] Draft shield checkbox toggles correctly in UI - [ ] Loading legacy projects with `draft_shield: "disabled"` / `"enabled"` / `"limited"` migrates correctly - [ ] Skirt height field disables when draft shield is checked 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OrcaSlicer#538