Commit Graph

42896 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
8f5c56ea28 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-06-02 09:53:47 +00:00
Yorik van Havre
640642eed2 Translations: Merged crowdin translations 2025-06-02 11:48:26 +02:00
Roy-043
186e9c98da BIM: Terrain should not also be in Group of Site
Addresses one of the issues mentioned in #21667.

* If the Terrain is dropped on the Site it is added to the Group (as before) but the Terrain property is then also set to None.
* If one of the objects in Group is selected as the Terrain it is removed from the Group.
2025-06-02 11:45:34 +02:00
Yorik van Havre
26e16765b0 Translations: updated ts files 2025-06-02 11:07:28 +02:00
wmayer
a88623ff24 Start: Fix possible crash when opening Start page
Procedure to trigger the crash:
* Create a document
* Create a spreadsheet and open it
* Close the 3D view
* Open the Start page
* It may or may not crash but the program is in an undefined state

The reason of the crash is caused by an inappropriate use of static_cast.
This bug is caused by PR 17152.

To fix the crash use dynamic_cast instead. If the cast fails it returns
a null pointer instead of a dangling pointer.
2025-06-02 08:22:28 +02:00
wmayer
58ba945659 App: Handle possibly raised exception in ZipFile constructor
This fixes the issue reported at:
https://forum.freecad.org/viewtopic.php?t=93619
2025-06-02 08:22:07 +02:00
Jacob Oursland
c74752c526 CI: add typing_extensions to runtime dependency for weekly build. 2025-06-01 15:38:32 -04:00
sliptonic
024276b5f7 Merge pull request #21635 from tarman3/contextmenu
CAM: Dressup context submenu
2025-06-01 12:50:14 -05:00
sliptonic
6863a1b22a Merge pull request #21684 from chennes/libareaFixEncoding
CAM(libarea): Fix encoding of clipper.cpp
2025-06-01 12:48:22 -05:00
luzpaz
269ed4537f BIM: fix typo in Arch.py (#21696) 2025-06-01 18:36:10 +02:00
Roy-043
bbe43aa6db Draft: DraftGui.py correct handling of last point (#21698)
This PR fixes a V1.1 regression.
The default for the last point should be the origin of the working plane if Global mode is off.

Forum topic:
https://forum.freecad.org/viewtopic.php?t=97452
2025-06-01 18:33:18 +02:00
tarman3
6e434183c3 CAM: Fix Job toggleVisibility 2025-06-01 14:11:38 +03:00
Roy-043
2fc0c9a12c Draft: Tweak working plane code (#21672)
* The new align_to_face_and_edge functions would align the Y axis to the edge. This should be the X axis.
* The align_to_point_and_axis functions did not accept a zero length upvec.
* Added a return value to the _next function for compatibilty with its counterpart the _previous function.
2025-06-01 09:13:19 +02:00
Chris Hennes
b7bd7e0ce2 CAM(PathSimulator): Use single-precision pi
All of PathSimulator uses floats, rather than doubles: to prevent
compiler warnings about truncation, explicitly use the single-precision
version of the standard pi constant.
2025-05-31 17:57:24 -05:00
Chris Hennes
45b484f3b3 CAM(libarea): Fix encoding of clipper.cpp
This file was encoded in ISO-8859-1, but contained characters that were illegal
in that encoding (superscripts). Convert to UTF-8.
2025-05-31 17:48:38 -05:00
wmayer
5cbeef9b33 Gui: Fix TreeWidget::addDependentToSelection
Avoid stack overflow for cyclic dependencies.

This fixes issue 20859
2025-05-31 19:41:50 +02:00
Ladislav Michl
487542185d Revert "[Gui] Fix "Select dependent objects" with cycles"
This reverts commit 01effaaab0.
2025-05-31 19:39:11 +02:00
tarman3
1cd7008641 command to open folder with macros 2025-05-30 20:02:58 +02:00
James Stanley
7093b0b9f0 PartDesign: Add OCCT progress support to FeatureTransformed.
Include `<Base/ProgressIndicator.h>` and bail out when
`Base::ProgressIndicator::getInstance().UserBreak()` returns true during
transformation loops and composite operations in
`FeatureTransformed.cpp`.
2025-05-30 18:25:32 +01:00
Joao Matos
2da938b545 Part: Add OCCT progress support to Part boolean and shape builders
Introduce a `Build(const Message_ProgressRange&)` overload in
`FCBRepAlgoAPI_BooleanOperation` (guarded by `OCC_VERSION_HEX <
0x070600`) and route user-abort checks around the operation. Add a new
`OCCTProgressIndicator` adapter (`OCCTProgressIndicator.h`) that bridges
`Message_ProgressIndicator` to `Base::ProgressIndicator`. Include
`OCCTProgressIndicator.h` where needed and update all `Build()` calls in
`TopoShape` and `TopoShapeExpansion` to pass
`OCCTProgressIndicator().Start()`, enabling singleton-based progress
reporting and user-break handling.
2025-05-30 18:25:32 +01:00
wmayer
25691764f9 Gui: Show date & time in locale specific format 2025-05-30 18:04:33 +02:00
wmayer
2aba143df1 Gui: Improve DlgAddPropertyVarSet
* Give user a hint about the reason of an invalid name. Fixes issue 21111
* Fix isTypeValid() to check for valid property type
2025-05-30 18:04:33 +02:00
wmayer
a124ce4f8f Gui: In DockWindowItems::addDockWidget replace the booleans with the enum class DockWindowOptions 2025-05-30 18:04:33 +02:00
wmayer
8d3e38fb4a Gui: Improve auto-saving
Handle possibly raised exceptions in RecoveryRunnable::run().
Since the run() method is executed within the context of a worker
thread all exceptions must be handled before returning to Qt
Concurrent as otherwise the application will be terminated.

For testing purposes load the corrupted project file from this forum
thread https://forum.freecad.org/viewtopic.php?p=823608#p823608
and wait for the auto-saving.
2025-05-30 18:04:33 +02:00
wmayer
4cfc77d9ee Gui: Move define HAS_QTBUG_129596 to separate header file 2025-05-30 18:04:33 +02:00
wmayer
892d636a37 Gui: Fix crash in ~PythonBaseWorkbench with Python 3.12 2025-05-30 18:04:33 +02:00
wmayer
3888899e7c Gui: avoid code duplication in PythonEditor 2025-05-30 18:04:33 +02:00
wmayer
9497ddf5e1 Gui: Replace calls of FCMD_SET_EDIT with Gui::cmdSetEdit 2025-05-30 18:04:33 +02:00
wmayer
dec434e153 Gui: Handle exception when trying to start editing an object 2025-05-30 18:04:33 +02:00
wmayer
da6bafe246 Gui: Fix crash in Command::keySequenceToAccel
If FreeCAD is loaded without GUI it isn't allowed to access the
QKeySequence class as it will cause a crash. So, it checks
beforehand if QApplication::instance() is null.

This fixes issue 16407
2025-05-30 18:04:33 +02:00
wmayer
a0899cc65d Gui: Improve document recovery
When checking for recovery files also check for validity of the
actual project file. In case it's broken but has a never date
then still process the recovery file.

This is done to reduce the chance of data loss as described in
issue 18044
2025-05-30 18:04:33 +02:00
wmayer
87fca2c943 Gui: Use QDialogButtonBox in DlgExpressionInput
This way the order of buttons is more consistent than using
separate QPushButtons.

This fixes issue 19902
2025-05-30 18:04:33 +02:00
wmayer
efe02a8675 Gui: Fix stackoverflow when loading corrupted file
If an object has a link to itself it may cause a stackoverflow
in several cases:
* If the method claimChildren3D() returns a list containing the
  object of the view provider then Document::handleChildren3D()
  will add a SoGroup to itself as a child. This will result into
  a stackoverflow as soon as an action traverses the scene.
* If the method claimChildren() returns a list containing the
  object of the view provider then DocumentItem::createNewItem()
  causes an infinite loop with DocumentItem::populateItem()

Solution:
* Inside Document::handleChildren3D() avoid to add a SoGroup to itself
* In this specific case fix ViewProviderCoordinateSystem::claimChildren()
  to avoid a cyclic dependency

Hint: Since PR 18126 FreeCAD is vulnerable for this problem.

This fixes issue 19682
2025-05-30 18:04:33 +02:00
wmayer
59717fc607 Gui: Fix crash when trying to transform link object
This is a regression caused by PR 17564.

ViewProviderDragger has the member 'forwardedViewProvider' that is used
to handle the editing by the parent object. This means that inside
ViewProviderLink::startEditing 'transformDragger' can be null but this
isn't checked so that accessing the member causes a segmentation fault
or a failing assert in debug mode, respectively.

Solution:
Make sure that transformDragger is not null before accessing it.

This fixes 19542.
2025-05-30 18:04:33 +02:00
wmayer
c21b330a98 Gui: Fix command StdCmdProperties
The command is only able to show the property view in case it's
invisible. But it fails to raise the widget. And if in the preferences
'Combined' mode is set it fails completely.

Solution:
The method DockWindowManager::activate already does everything what's
needed. Now the command only must be changed to access the right
docked widget.
2025-05-30 18:04:33 +02:00
wmayer
55a9123040 Gui: Make AccelLineEdit a subclass of QKeySequenceEdit
The class QKeySequenceEdit already implements the relevant
functionality and properly handles shortcuts using the Shift key.

This fixes issue 19320
2025-05-30 18:04:33 +02:00
James Stanley
a2de481445 Base: Add Base::ProgressIndicator for OCCT progress reporting
Introduce a new `ProgressIndicator` base class
(`ProgressIndicator.h`/`.cpp`) with a singleton-managed, no-op default
implementation matching OCCT’s `Message_ProgressIndicator` interface.
Update `CMakeLists.txt` to include the new sources.
2025-05-30 14:10:28 +01:00
wmayer
05feaea9bd Gui: Do not round color values set in property editor
Do not use the number of decimals from the user settings to pass
the material to the property as this will cause some unexpected
rounding effects.

This fixes issue 19048
2025-05-30 14:21:53 +02:00
wmayer
0cce0f14bf Gui: Fix DlgPreferencesImp::minimumDialogWidth() to return a reasonable width
The current implementation always returns a width that is too small
so that a scrollbar is shown. Especially on the General page this is
unfortunate as some important controls are truncated or completely
hidden.

Another problem of this implementation is that when loading a not
yet loaded workbench in the 'Available workbenches' page then the
computed size will be by far too high leading to a dialog that all
the sudden covers most of the screen.

Solution:
The correct width is the sum of:
width of the tree view + width of the biggest page + spacing of the layout
This fixes both of the above problems.
2025-05-30 14:21:53 +02:00
wmayer
d969045bd9 Gui: Fix several methods in Workbench to list all items
* Fix Workbench::listToolbars() to also return custom toolbars or added by a manipulator
* Fix Workbench::getToolbarItems() to also return custom toolbars or added by a manipulator
* Fix Workbench::listMenus() to also return menus added by a manipulator

Fixes issue 18647
2025-05-30 14:21:53 +02:00
wmayer
8b11c0672b Gui: Adjust transform dragger after undo/redo
When performing undo/redo after tansforming an object it flips back
to its original position but the dragger does not.

This commit set the dragger's placement to the object placement.

Fixes issue 18914
2025-05-30 14:21:53 +02:00
wmayer
c42dfe1ef3 Gui: Fix undo/redo behaviour in transformation tool
If the user clicks on undo while the transformation dialog is
open the currently active transaction will be closed.
From now on any change of the placement won't be recorded any
more so that e.g. canceling the dialog or an undo after
accepting the dialog leads to unexpected behaviour.

To fix the issue two new virtual methods onUndo() and onRedo()
are added to TaskDialog and reimplemented in TaskTransformDialog.
These functions make sure to open a new transaction.

This fixes issue 19152
2025-05-30 14:21:53 +02:00
wmayer
30ccf2ab26 Gui: Use Py::SmartPtr instead of raw pointer
Using the raw pointer may result into a crash in case the Python
object is accessed by the interpreter after the NavigationStyle
has been destroyed.
2025-05-30 14:21:53 +02:00
wmayer
b006a37010 Gui: Add Action::setBlockedChecked
Remove the second parameter of Action::setChecked and
provide Action::setBlockedChecked instead.
2025-05-30 14:21:53 +02:00
tarman3
70d243584a CAM: Simulator - Drilling - RetractMode G98/G99 2025-05-30 08:52:54 +03:00
tarman3
34b449bd0c CAM: Drilling - Retract mode readonly 2025-05-30 00:23:38 +03:00
sliptonic
f3b6c29784 Merge pull request #21303 from tarman3/array
CAM: Added property CycleTime to old Array
2025-05-29 15:43:47 -05:00
Gonzalo Odiard
a07d9f032f App: Make Label property on Document read only (#21562)
Fixes: #10010
2025-05-29 22:43:34 +02:00
Alfredo Monclus
8f2ff7d7f6 Gui: property-editor open the combo directly and apply after selection
Previously you had to make 4 clicks to apply a combo
1 to enter edit, 1 to open the combo, 1 to select, and 1 to defocus and apply

with this commit only 2 clicks:
1 to open the combo and 1 to select
2025-05-29 22:41:37 +02:00
Alfredo Monclus
f3f2a2a9f7 Gui: property-editor add property copy context menu 2025-05-29 22:40:59 +02:00