Commit Graph

39255 Commits

Author SHA1 Message Date
wmayer
2137dbc8d0 Tests: Add unit test for PR #16576 2024-11-22 12:02:30 +01:00
wmayer
98fec525b0 PD: move refine model parameter to separate function 2024-11-22 11:59:49 +01:00
wmayer
0e0df5b92e Part: move refine model parameter to separate function 2024-11-22 11:59:49 +01:00
wmayer
e299c46a94 Part: move model check to separate function
This is to avoid code duplication.
2024-11-22 11:59:49 +01:00
wmayer
f3d84b601f PD: Fix convoluted event handling of dress-up task boxes 2024-11-22 11:55:46 +01:00
wmayer
a4bc06219b Tests: Add unit test to explore a null shape 2024-11-22 10:52:45 +01:00
Max Wilfinger
2197d626b4 Update PROBLEM_REPORT.yml
Add "needs confirmation" as default tag for new issues.
2024-11-22 07:50:01 +01:00
wmayer
5771c94523 App: Apply clang format (part 2) 2024-11-21 21:17:42 +01:00
wmayer
fcea9343b3 Mesh: Fix linter warnings 2024-11-21 21:16:55 +01:00
wmayer
7a2bfb7370 Mesh: Fix linter warnings 2024-11-21 18:30:22 +01:00
wmayer
4e82a0af48 App: Apply clang format (part 1) 2024-11-21 07:54:24 +01:00
wmayer
ee18317e08 Part: Expose Geometry::isSame() to Python 2024-11-20 23:37:39 +01:00
wmayer
2819ca438e Start: fixes #17857: Icon-files of the startup screen are not removed from /tmp
It's basically a port of #10951 to the new start page implementation.

Note: Icon files are not removed but re-used instead.

The commit adds some new functions:

* getThumbnailsImage()
  Returns the name of the PNG inside a project file

* getThumbnailsName()
  Returns the directory name containing the image files

* getThumnailsParentDir()
  Returns the parent directory of the directory containing the image files

* getThumbnailsDir()
  Returns the path to the thumbnail directory. There is no need to always create a unique directory
  after each restart because it doesn't harm if the thumbnail directoy contains deprecated files.

* createThumbnailsDir()
  Creates the thumbnail directoy if it doesn't exist yet.

* getSha1Hash
  Helper function to compute a SHA-1 hash of a given path. If the same path is passed
  then the hash value will be the same.
  This way it can be avoided to create a different image file from a project file
  after each restart.

* getUniquePNG
  Computes the path of a PNG image file for a given project file. It's also possible
  to pass an arbitrary string as argument.

* useCachedPNG
  If the PNG image exists and if it's newer than the project file True is returned
  and False otherwise.

For a given project file it is checked if the thumbnail directory already contains
a cached image. If it's newer than the project file it will used, otherwise it will
be re-created.

Fix freecadCanOpen() abd DisplayedFilesModel::addFile() to also check for lower-case
file extensions.
2024-11-20 09:44:35 -05:00
wmayer
22782e53f3 Core: Add method ProjectFile::containsFile 2024-11-20 09:44:35 -05:00
Benjamin Bræstrup Sayoc
cdb92768fe [TechDraw] Return logic simplification (#16504)
* [TechDraw] AppTechDrawPy.cpp return logic simplification

* [TechDraw] CosmeticExtension.cpp return logic simplification

* [TechDraw] DrawBrokenView.cpp return logic simplification

* [TechDraw] HatchLine.cpp return logic simplification

* [TechDraw] LineGenerator.cpp return logic simplification

* [TechDraw] Preferences.cpp return logic simplification

* [TechDraw] ShapeExtractor.cpp return logic simplification

* [TechDraw] MDIViewPage.cpp return logic simplification

* [TechDraw] QGILeaderLine.cpp return logic simplification

* [TechDraw] QGIRichAnno.cpp return logic simplification

* [TechDraw] QGTracker.cpp return logic simplification
2024-11-18 16:14:47 -03:00
Jiří Pinkava
f9ba94c70b Sketcher: refactor, drop return in void returning functions 2024-11-18 12:21:25 -05:00
mosfet80
0fee326c54 [cmake] clean InitializeFreeCADBuildOptions.cmake
cmake version is always greater than 3.4.3
The verification is done in the cmakefile in the root folder
2024-11-18 12:14:39 -05:00
mosfet80
8f0e61bffd [Mod] clean FemMesh.cpp
Removed dead code
2024-11-18 18:01:59 +01:00
Kris Slyka
2f6329d6e7 [tools] fcinfo: fix syntax warnings and improve output for git diffs (#16312)
* Fix syntax warnings about invalid escape sequences

Backspaces in regular expressions were not escaped properly leading to warnings on every invocation of the program.

* Improve formatting of fcinfo output

* Printing of part BREP file properties (hash and size) has been made optional since these values often change without explicit user action making git diffs almost unreadable by hiding actual changes behind a flood of changed hashes because a base feature further up the history was changed. There is a new option (-p) to re-enable the printing of these file properties.

* Unformatted float outputs have been replaced with proper formatting using f-strings which round the values to a sensible number of places.

* Colors are printed in their native 0-255 range. Printing them as float brings no benefit here.

* Most string concatenation for output has been replaced with f-strings

* Fix printing of color properties
2024-11-18 17:52:16 +01:00
Jiří Mácha
71f0104bb2 Assembly: fixed defect in the migrationScript4 function
The old CAD model created by the development version of FreeCAD
(in which the Assembly workbench was used) contained joints that,
for some reason, had an empty Joint Connector 1 reference (Reference1).

This was causing an exception and a crash of the Python function
called migrationScript4. The FreeCAD Report view contained:

23:28:29  pyException: Traceback (most recent call last):
  File "/FreeCAD/Mod/Assembly/JointObject.py", line 175, in onDocumentRestored
    self.createProperties(joint)
  File "/FreeCAD/Mod/Assembly/JointObject.py", line 181, in createProperties
    self.migrationScript4(joint)
  File "/FreeCAD/Mod/Assembly/JointObject.py", line 514, in migrationScript4
    if hasattr(joint, "Reference1") and joint.Reference1[0] is not None:
                                        ~~~~~~~~~~~~~~~~^^^
<class 'TypeError'>: 'NoneType' object is not subscriptable

This patch attempts to avoid such exceptions by validating the type of
the property variable before accessing it.
2024-11-18 17:46:44 +01:00
PaddleStroke
a049641771 Assembly: Store DocumentObject instead of mbdPart for the dragged parts. Fixing the bug where doDragStep was 50% of time failing to find the correct DocumentObject due to bundling. 2024-11-18 17:43:53 +01:00
Benjamin Nauck
3875c306ac Spreadsheet: Double click separator to resize to content
Qt handles resize to content on double clicking the separator in the header, by default.
However this does not work in FreeCAD.

There are no comments on why this was done and is therefore treated as bug instead of feature.

Manual testing has been performed after the change and:

* Scaling by double clicking separator in header works
* Sizes are correctly stored in sheet when resizing to content
2024-11-18 09:12:22 -05:00
bgbsww
d8d35f133d Contribute helper files for CLion debugging 2024-11-18 08:55:56 -05:00
hasecilu
4c1f94f6c2 Addon Manager: Show repository URL if it exists on the metadata
Fix: #14777
2024-11-18 08:51:15 -05:00
hasecilu
8619b03bbc Addon Manager: Show involved branches' names on branch change operation
Fix #12969
2024-11-18 08:47:52 -05:00
Yorik van Havre
36cf031f0b BIM: Fixed image loading of the tutorial - fixes #17863 2024-11-18 14:22:44 +01:00
wmayer
6f8abe880c Core: Fix flaw in XMLReader class
Remove implementation details of the Document class from the XMLReader class.
Instead keep an array of failed files and check them in the calling instance.
2024-11-17 08:34:03 +01:00
Yorik van Havre
89d1d717eb BIM: Optimized leader UI (#17310)
* BIM: Optimized leader UI - fixes #17284

* Correct task panel icon for BIM Leader.
* Make BIM Leader task panel title translatable.
* Use a single mode parameter for the Line class.

---------

Co-authored-by: Roy-043 <info@b-k-g.nl>
2024-11-16 18:10:04 +01:00
Roy-043
1c19a7e85d Draft: fix tray construction mode button for Light and Dark themes (#17886)
Fixes #17869.
2024-11-16 18:04:26 +01:00
Gauthier Brière
f08cf60155 [Draft] add font path relative (#17819)
* Permit a font file path relative to the FreeCAD file

* Use obj.Document instead of App.ActiveDocument

* use filename = instead of directory =
2024-11-16 18:02:02 +01:00
Yorik van Havre
8f9718ebc6 Draft: minor fixes (#17793)
- more tolerance on faultly solids in shape2Dview
- fixed display of dimensions in arch override unit
2024-11-16 17:52:55 +01:00
Roy-043
f723f36d2a Draft: Fix extra_scale error in hatch.py (#17715)
Fixes #17712.
2024-11-16 17:49:35 +01:00
Yorik van Havre
ee2f384b2f Draft: Independence from BIM (#17444)
* Draft: Independence from BIM - follow-up of #17390

* Draft: More info in DXF importer if BIM not present
2024-11-16 17:48:28 +01:00
Chris Mayo
7183de92a4 Draft: Make startup and tests independent of BIM (#17390) 2024-11-16 17:43:46 +01:00
marioalexis
f638c38dfd Fem: Set mesher task panel log text to read-only 2024-11-16 14:31:48 +01:00
marioalexis
38bf51c768 Fem: Adapt FemPostObject transparency to changes made in #ffa3fa5b5a 2024-11-16 12:49:47 +01:00
Max Wilfinger
b3423694c0 Merge pull request #17637 from furgo16/patch-3
Reword rigid/flexible sub-assemblies tooltip.
2024-11-16 10:03:52 +01:00
Furgo
477ea046d0 Re-add the note about right click, with more context 2024-11-16 07:15:05 +01:00
luzpaz
ed40de3e23 Fix various typos
Found via codespell.
2024-11-15 20:18:46 +01:00
OfficialKris
b3a2268289 Modified text of all items on help menu
Used ToolTipText for StatusTip on all menu items
Modified some of the MenuTexts
Modified some of the Pixmaps
2024-11-15 18:57:39 +01:00
Furgo
a597015d05 Reword error log to be more verbose 2024-11-15 18:53:00 +01:00
OfficialKris
4e0f3185b1 Moved items in the Help menubar 2024-11-15 18:51:14 +01:00
Benjamin Bræstrup Sayoc
3578d1ff7f [Gui] Vertically center method icon in calltips 2024-11-15 18:47:53 +01:00
marioalexis
a41f38bd8a Fem: Minor change to Mesh task panels and renaming Gmsh mesh properties group 2024-11-15 18:46:58 +01:00
Yorik van Havre
bcd95cf32d New Arch Detail example 2024-11-15 18:45:37 +01:00
Max Wilfinger
616028efe5 Merge pull request #15957 from hasecilu/fix/capitalization
TechDraw: Fix capitalization of 2D and 3D
2024-11-15 18:37:47 +01:00
Max Wilfinger
0003591df9 Merge pull request #16535 from WandererFan/translationFixes317And335
[TD] Translation fixes (fix #317 fix #335)
2024-11-15 18:36:44 +01:00
luzpaz
e2b67c19fc STEP: Rename generic Import/Export dialog title
Closes #16415
2024-11-15 18:36:09 +01:00
wmayer
ffa3fa5b5a Core: Extend Color API
* Fix issues with alpha value <> transparency
* Use type traits to convert between different color classes (fixes #14515)
2024-11-15 12:25:25 -05:00
Syres916
224c25b770 [Base] Give user feedback on failing to read StringHasherTable 2024-11-15 12:19:25 -05:00