[fixed] Why is the PD Helix dialog always in selection mode?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

[fixed] Why is the PD Helix dialog always in selection mode?

Post by uwestoehr »

When working with helices there is the annoying behavior that its dialog is always in selection mode:

- open the Helix dialog by double-clicking on an existing Helix in the tree
- do nothing in the dialog but click on an element of your choice in the tree

result: the tree object is taken as new axis for the Helix, despite this will often break the feature
So in fact the Helix task dialog is always in selection mode while it should only be on explicitly clicking on "Select..." in the axis combo.

I had a look at the code but cannot find what causes this. Even adding explicit

Code: Select all

exitSelectionMode();
to the code does not prevent the unwanted selection.

@wmayer, you recently refactored the Helix code, do you maybe have an idea?
wmayer wrote: .
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Why is the PD Helix dialog always in selection mode?

Post by uwestoehr »

wmayer wrote: Tue Dec 07, 2021 12:07 pm git commit ce88fa2052
Thanks!

I find

Code: Select all

bool SelectionObserver::blockConnection(bool block)
in Selection.cpp misleading. The bool should get the name "blockSelection" because it does not block any connection but the selection of objects.
OK to rename it?
wmayer
Founder
Posts: 20202
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Why is the PD Helix dialog always in selection mode?

Post by wmayer »

uwestoehr wrote: Tue Dec 07, 2021 1:39 pm I find

Code: Select all

bool SelectionObserver::blockConnection(bool block)
in Selection.cpp misleading. The bool should get the name "blockSelection" because it does not block any connection but the selection of objects.
OK to rename it?
LOL. I had exactly the same thought and already renamed this and a few other methods of the SelectionObserver class.
git commit ca5c799ce207d5a04
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Why is the PD Helix dialog always in selection mode?

Post by uwestoehr »

wmayer wrote: Tue Dec 07, 2021 2:14 pm LOL. I had exactly the same thought and already renamed this and a few other methods of the SelectionObserver class.
git commit ca5c799ce207d5a04
:lol: Perfect. Thanks.

Now that this "mystery is fixed, from my side, the last 2 mysteries are
- why does the "What's This?" tool work for the Part, Draft, Arch, Partdesign WBs but not for the Start, Web, Sketcher, FEM WBs
- how the undo mechanisms works
;)
Post Reply