Commit Graph

78 Commits

Author SHA1 Message Date
tritao
65466d580b Gui: Reorganize the selection files into a top Selection folder. 2025-02-03 17:56:57 +01:00
PaddleStroke
a61db12828 PartDesign NewSketch: Add a parameter to use attachment dialog instead of feature pick 2025-01-20 12:27:04 -05:00
wmayer
e698c73a3a Part: Fix crash due to infinite recursion 2024-12-15 16:20:30 +01:00
PaddleStroke
7620e0a958 TaskAttacher: Refactoring 2024-12-13 18:04:10 +01:00
PaddleStroke
e76b638298 Task attacher: Handle initial selection when no refs. 2024-12-13 18:04:10 +01:00
PaddleStroke
deb6ebd276 TaskAttacher: Fix the string maker such that it does not show TNP string. 2024-12-13 18:04:10 +01:00
PaddleStroke
a6efacdf24 TaskAttacher: Make sure hierarchy is respected when adding references. 2024-12-13 18:04:10 +01:00
PaddleStroke
0a9a97fc63 Run precommit on TaskAttacher.cpp 2024-12-13 18:04:10 +01:00
PaddleStroke
3e33cf61e5 Rename 'OriginFeature' to 'DatumElement' 2024-11-26 15:36:48 +01:00
PaddleStroke
3c1358da10 Core: Rename 'OriginFeature' file to 'Datums' 2024-11-26 15:36:48 +01:00
PaddleStroke
4528a05113 Fix datum not being cancelled 2024-10-21 17:56:48 +02:00
PaddleStroke
12c6fc2920 Core: Fix #7580 (#17013)
Fixes several undo/redo issues with the attachment dialog
2024-10-08 10:21:08 +02:00
wmayer
cfb14da52e Part: Prepare for clang-format 2024-08-26 17:56:58 +02:00
Chris Hennes
8a6bc53dd6 PD: Translate attachment task title
Eliminate default title, which is untranslatable.
2024-03-11 18:08:22 +01:00
Josh Coalson
a8ae56e06a Part: Rename AttachExtension::Support property to AttachmentSupport, to avoid name conflict with base features. Fixes #7052 2024-03-04 18:22:43 +01:00
André Caldas
560898907b Avoids using getNameInDocument() to test if DocumentObject is attached to a Document.
This patch substitutes by isAttachedToDocument() (almost) everywhere where
getNameInDocument() is used for this purpose.

The very few places not touched by this patch demand a (just a little) less trivial change.
When we change the returning type of getNameInDocument() to std::string,
those places will be easily found, because they shall generate a compiler error
(converting std::string to bool).

Rationale:
The fact that getNameInDocument() return nullptr to indicate
that the object is not attached to a document is responsible for lots of bugs
where the developer does not check for "nullptr".

The idea is to eliminate all those uses of getNameInDocument() and, in the near future,
make getNameInDocument() return always a valid std::string.
2023-12-11 17:37:58 +01:00
Florian Foinant-Willig
eb55f1fe52 Part: modernize type checking 2023-10-23 18:12:03 +02:00
wmayer
ad77d462df PD: avoid creation of tmp. std::string in TaskAttacher::onRefName 2023-10-19 15:49:04 +02:00
wmayer
a0d86224f3 Part: modernize C++: use equals default 2023-08-22 15:14:03 +02:00
wmayer
312975edba Part: modernize C++: use range-based for loop 2023-08-16 21:56:32 -05:00
wmayer
d150fa7164 modernize C++: avoid bind
In many cases std::bind() is kept because the code is much simpler
2023-08-08 21:10:16 +02:00
wmayer
68d22d864b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
Chris Hennes
bdcd28cf5c Part: Attempt to translate exceptions in dialogs
Relies on the exception text having been added to the translation database in a previous call to QT_TRANSLATE_NOOP, and put in the 'Exception' context.
2023-04-27 17:31:44 -05:00
wmayer
b57e5646f6 Part: move to new style connect() 2023-01-13 17:14:07 +01:00
luz paz
6e542b6fad Part: remove trailing whitespace 2022-11-15 14:19:30 -06:00
wmayer
82866db0ca Mod: replace QRegExp with QRegularExpression 2022-10-07 14:03:53 +02:00
Uwe
998056364d [Part] Task*: remove unused includes - part 1
- also some sorting
2022-09-26 03:05:23 +02:00
berniev
b796a0d376 Mod: use empty 2022-08-06 19:30:13 +02:00
berniev
2d4c5a4cfb Mod: use emplace_back 2022-08-05 10:36:16 +02:00
Uwe
5f8e0c46ee [Part] remove more superfluous nullptr checks 2022-07-18 01:36:27 +02:00
Uwe
e491ba8d12 [Part] remove superfluous nullptr checks 2022-07-17 18:06:21 +02:00
mosfet80
620c273c4e Boost version <=1.60 is never used in freecad 0.20 (#7038)
* Boost version 1.60 is never used in freecad 0.20
2022-06-24 02:20:26 +02:00
wmayer
d0f98bf45c Conda: ssize_t is a POSIX type and thus not necessarily defined on Windows. Currently this causes build failures with Conda + Py3.10.
The solution is to get rid off all occurrences of ssize_t in FreeCAD code
2022-05-17 11:43:40 +02:00
wmayer
9eac35cf5d Gui: clean-up Selection API
Replace the int of the 'resolve' argument of several functions with a proper enum class.
* This avoids the inconsistencies in client code where often true/false is passed when an int is expected
* This avoids the use of magic numbers like 0, 1, 2 or the undocumented 3
2022-04-09 17:03:43 +02:00
Chris Hennes
0a65575c2c Part: PR6497 move return statement to new line 2022-03-29 12:37:00 -05:00
Uwe
66e4c37a25 fix some occurrences where size() is misused as Boolean
- as suggested by @wwmayer: 4d51d1d0b1 (r69648152)
2022-03-27 21:38:15 +02:00
wmayer
068c0e5a98 Part: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
wmayer
edd346cc3d Part: Fix several coverity issues:
* CID 350581: Structurally dead code
* CID 350620: Structurally dead code
* CID 350563: Big parameter passed by value
* CID 350552: Uncaught exception
* CID 305193: Uncaught exception
* CID 350556: Uninitialized scalar field
* CID 350579: Uninitialized pointer read
2022-03-13 16:06:40 +01:00
wmayer
3924d41073 Part: do not open a second transaction when there is already a pending transaction 2021-10-22 18:49:49 +02:00
donovaly
9c5aec06bc [PD] fix bug that reference selection is always on
It is annoying because error-prone, that on opening e.g. primitives the reference selection mode is always on. You then e.g. click in the model and get a new attachment. But when opening existing primitives you don't always want to change the attachment (often only the parameters). And even if you want to change the attachment, you want to select which one and you like to know when you are in selection mode.
2021-04-12 03:20:18 +02:00
wmayer
99c686f061 Part: [skip ci] fix -Wreorder 2021-02-05 17:26:47 +01:00
donovaly
603cbdbfd5 [Part] make pointers to the UI std::unique_ptr
Same as PR #4293, just for Part

as noted in https://github.com/FreeCAD/FreeCAD/pull/4271#discussion_r554673632
the pointer to the UI should be a unique pointer.

This PR does this for all Part dialogs that don't already use a unique_ptr.
2021-02-05 17:16:20 +01:00
luz paz
5aff8cdd0b Part: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the Part Wb.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
2020-12-01 14:53:35 +01:00
wmayer
0de5a29011 Part: fix regression of visibility automation in Attachment dialog
If a body is in a Part container and a new primitive is created no preview is shown because the Part container is automatically made invisiible.
The user has to manually make the container visible but this is an error-prone procedure because the Attachment dialog reacts on user-selection and thus
unintended things can happen. So, this is a serious regression of usability.

The regression is caused by commit a06e0b7c2d but the commit log doesn't explain why the change was even needed.
So, this commit leaves the previous changes but re-adds the old check to filter out container objects.
2020-07-12 16:03:42 +02:00
Zheng, Lei
37caf53dfd Part: fix TaskAttacher::visibilityAutomation()
Rename Python variable 'tv' to avoid potential conflict with others
(PS. I can't reproduce error caused by this. But there is no harm doing
it either).

Handle editing attachment through an App::Link.
2020-07-12 16:03:42 +02:00
Thomas Gimpel
ffbcab5b49 Part: fix handling of attachment offset rotation changes in attachment editor 2020-07-04 07:50:58 +02:00
wmayer
f3b460e42e boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
4ec45b545e boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
wmayer
bd0f5ca5c5 Part: [skip ci] explicitly open transaction when opening the Attachment dialog 2020-03-23 17:14:42 +01:00
wmayer
1cfe6d2cc7 Part: [skip ci] support of expressions of Euler angles in attachment dialog 2020-03-21 14:27:53 +01:00