[Gui] Fix string encoding for document, object and subobject names in PropertyLink, SelectionSearch, PD Sketch Based Tasks, Part Primitives and Document handling.
* The number_length function did not take imperial dimensions into account. For `9" + 7/8"` it would return 1.
* In ArchRoof reference number_length function from DraftGui.py to avoid duplicate code.
Fixes an issue where Chipload and similar mixin-defined properties were added to
the schema but not reliably restored, because parameter restoration did not always
apply them to the toolbit object. This change ensures Chipload is restored from saved
data and displayed using the user's preferred unit schema, even when no document
is open. This update also ensures the toolbit editor respects the user’s unit schema
preference during editing, even outside an open document.
src/Mod/CAM/Path/Tool/toolbit/models/base.py:
- Restore Chipload (and other parameters) to toolbit.obj if the property exists.
src/Mod/CAM/Path/Tool/toolbit/ui/editor.py:
- Set units schema to user preference when opening the toolbit editor, so Chipload and other values display correctly.
* #25474 Added read-only warnings when saving documents
Block saving a file and notify user if windows is unable to save to the file for any reason, or the read-only attribute is checked. Also check std::filesystem::perms for write permission and other checks in FileInfo::isWritable(), although it doesn't seem to matter on windows.
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
* BIM: fix handling of BIM_Sketch view properties
The handling of the sketch view properties was not correct:
* AutoColor was not set to `False`.
* PointSize was missing.
* PointColor was not set to the DefaultShapeVertexColor preference.
* Grid values were never applied. Sketches do not have a GridSnap property and gridSize is not the correct Draft preference.
* Sketch grid snap is a global setting that affects all sketches, the code should not change that setting IMO.
* Remove trailing white space
For some platforms due to event loop and timer triggering being not
deterministic stylesheets could be loaded before style parameters were
fully loaded. This caused warnings about style parameters to appear
potentially confusing users.
This commit changes the stylesheet loading to happen much earlier in the
process so the stylesheet is applied before theme preselection has
chance to happen.
* BIM: Implement smart base removal for Walls
Previously, removing the Base object from an Arch Wall would cause the
wall to reset its position to the document origin and could lead to
unintended geometric changes for complex walls.
This commit introduces a "smart debasing" mechanism integrated into the
Component Task Panel's "Remove" button:
- For walls based on a single straight line, the operation now preserves
the wall's global position and parametric `Length`, making it an
independent object.
- For walls with complex bases (multi-segment, curved), a warning dialog
is now presented to the user, explaining the consequences (shape
alteration and position reset) before allowing the operation to
proceed.
This is supported by new API functions `Arch.is_debasable()` and
`Arch.debaseWall()`, which contain the core logic for the feature.
Fixes: https://github.com/FreeCAD/FreeCAD/issues/24453
* BIM: Move wall debasing logic into ArchWall proxy
The logic for handling the removal of a wall's base object was previously
implemented directly within the generic `ComponentTaskPanel` in
`ArchComponent.py`. This created a tight coupling, forcing the generic
component UI to have specific knowledge about the `ArchWall` type.
This commit refactors the implementation to follow a more object-oriented
and polymorphic design:
1. A new overridable method, `handleComponentRemoval(subobject)`, has been
added to the base `ArchComponent` proxy class. Its default implementation
maintains the standard removal behavior.
2. The `_Wall` proxy class in `ArchWall.py` now overrides this method. All
wall-specific debasing logic, including the eligibility check and the
user-facing warning dialog, now resides entirely within this override.
3. The `ComponentTaskPanel.removeElement` method has been simplified. It is
now a generic dispatcher that calls `handleComponentRemoval` on the
proxy of the object being edited, with no specific knowledge of object types.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* BIM: Correct user warning
The operation can indeed be undone.
Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>