Fixes#17027.
The `DraftTaskPanel.reject()` function can be called multiple times if Esc is pressed during a fast mouse move. We need to prevent multiple calls to `draftToolBar.escape()` as this will lead to multiple calls to `gui_utils.end_all_events()` which results in a crash.
* Updated ts files
* merged crowdin translations
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix double-import on exception in ImportGUI.readDXF
The python code has a try/catch block intended to detect if the ImportGUI module is present and if so use its readDXF method, otherwise use Import.readDXF.
The block was incorrectly structured so that Import.readDXF would also be called if ImportGUI.readDXF raised an exception, causing the DXF file contents to be loaded twice into the drawing (at least, up to the point where the exception occurred)
* Make ImpExpDxfRead::MakeLayer use centralized accessor for Draft module
The importer class already had a method to find the python Draft module, but MakeLayer was doing the work itself. Now it uses the centralized accessor, which has also been improved to generate a message if the module can't be loaded.
* Give compounded objects names related to the containing layer name
If "Use Layers" is set and also "Group layers into blocks" the names of the generated compound objects will be based on the name of the containing layer.
If "Use Layers" is not set this will not occur because in general objects from several layers would be compounded together.
Fixes (partially) #16068, the remaining fix is likely just an explanation of the interaction of the options.
closes#13597
* Use correct (new) property name OverrideShapeAppearanceChildren
This corrects a bug created by commit 495a96a which renamed the layer property "OverrideShapeColorChildren" to "OverrideShapeAppearanceChildren" but missed this particular reference to the property by its old name.
The code here called PyObject_SetAttrString which, due to the wrong attribute name, set an expection state in the Python engine, ultimately causing the next attempt at importing a module to fail, with various consequences depending on why the module is being imported.
* Wrap PyObject_SetAttrString and PyObject_GetAttrString with error-checkers
In DEBUG compiles these methods are wrapped to report errors which can occur if the property cannot be referenced.
* Make some error-printers static instead of const
They don't need the CDxfRead object to work
* Display exceptions raised by ReadEntity
Although the DXF reader has an ignore-errors flag, it should still report any errors it encounters. The flag is deemed to mean that, after an error, the reader should continue to try to read the file rather than quitting on the first error.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Place objects in layer all at once rather than one at a time.
This reduces (by a factor of the number of objects in the layer) the number of times that the layer contents are traversed to set the properties of the contained objects.
This means the layer insertion of O(n) rather then O(n^2) on the number of objects.
Also remove a loop invariant in view_layer so the chidren are not traversed if colours or appearnces are not inherited from the layer.
Fixes#15732
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Remove O(n^2) time on DXF import
Accumulates the contents of each layer in a local Python list, then at the end assignes all the objects at once into the layer. This avoids a very slow process of traversing the objects so far and (re-)updating their properties each time a new object is added.
Fixes#16604
* Correct last change to not damage existing layer contents.
The layer could already have contents if the DXF file is being Imported rather than Opened.
The original change would lose the previous layer contents.
* updated ts files
* merged crowdin translations
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This fixes a regression introduced in V0.19 (!) when the type of linear dimensions was changed from "Dimension" to "LinearDimension".
Forum topic:
https://forum.freecad.org/viewtopic.php?t=90292
Fixes: #16201
Changing the Group property type of layers to `App::PropertyLinkListHidden` also means that they longer occur in the InList of nested objects. This side-effect was missed in #14506.
Selecting an edge or vertex of a solid was not handled properly. The tool does not support these subelements, but the code did not call self.finish() is such cases.
* Draft: Fix cursor scaling
The get_cursor_with_tail function was rewritten to match the Sketcher cursor code. Hopefully this fixes the scaling issue.
Related issue:
#13696
Related forum topic:
https://forum.freecad.org/viewtopic.php?t=89494
@maxwxyz
Can you check if this code fixes the issue? Apart from the size the 'hot' pixel should be checked. If you approach a vertical line from the left or right it should get highlighted at the same distance.
* [DraftBind] Bug-fix Consecutive Face Touch at Corner
Bug-fix Consecutive face (Wall segment) touch at corner.
Forum Discussion : https://forum.freecad.org/viewtopic.php?p=769213#p769213
* [DraftBind] Bug-fix Consecutive Face Touch at Corner
Update following commit at https://github.com/FreeCAD/FreeCAD/pull/15350
* Minor formatting changes
coding_conventions.md says variable_names_without_capitals
* Use areColinear to find problematic edge pairs
It is clearer to use `areColinear` instead of `findIntersection` to detect problematic edge pairs.
@paullee0 Please check. Thanks.
* Use Shape.section() to find touching edges
Using `areColinear` indeed does not work here.
But the `findIntersection` function is very confusing IMO. It finds intersections for collinear edges which does not make sense.
Let's use `Shape.section()` instead.
Also improved the 'ascii art' a little.
* typo
* Some minor improvements.
* [DraftBind] Bug-fix Consecutive Face Touch at Corner
Update handling closed wire(s) case
* Typo
* [DraftBind] Bug-fix Consecutive Face Touch at Corner
Further update handling closed wire(s) case :
# if wires are closed, 1st & last series of faces might be connected
# except when
# 1) there are only 2 series, connecting would return invalid shape
# 2) 1st series of faces happens to be [], i.e. 1st edge pairs touch
---------
Co-authored-by: Roy-043 <info@b-k-g.nl>
* Updated ts files
* Merged crowdin translations
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
QT treats setting minimum size very seriously - it applies even if
the size required by the control is smaller than specified resulting in
rendering too small controls.
* Updated ts files
* Merged crowdin translations
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Fixes#14823.
Depending on the order and location of the picked points, the Placement of the Box could be unexpected. The Height value was always positive if points were picked, a negative Height entered in the input box would lead to errors.
Additonally:
* Avoided some code duplication.
* Added a proper transaction to make the command undoable.