[Solved] 0.19pre PartWB, Attachment >Apply, donnot work

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: 0.19pre PartWB, Attachment >Apply, donnot work

Post by DeepSOIC »

As for apply button - yes, it's my screwup, restarting transaction from there makes sense. Removing the apply button altogether is also an option.
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: 0.19pre PartWB, Attachment >Apply, donnot work

Post by wmayer »

User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: 0.19pre PartWB, Attachment >Apply, donnot work

Post by DeepSOIC »

wmayer wrote: Mon Mar 23, 2020 12:08 pm git commit c32c9d565
thanks :D
fc_tofu
Posts: 653
Joined: Sun Jan 05, 2020 4:56 pm

Re: 0.19pre PartWB, Attachment >Apply, donnot work

Post by fc_tofu »

wmayer wrote: Mon Mar 23, 2020 12:08 pm git commit c32c9d565
Thank you. I tried above fix, but cannont find difference between "OK" and fixed "Apply".
As my understanding, "Apply" change source object position, but leave "map mode/attachment mode" untouched (or reset). Or say, "Apply" could work as non-parametric alignment.
Please correct me, if I am wrong here.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: 0.19pre PartWB, Attachment >Apply, donnot work

Post by DeepSOIC »

fc_tofu wrote: Mon Mar 23, 2020 12:44 pm Thank you. I tried above fix, but cannont find difference between "OK" and fixed "Apply".
Apply was made to record the state of attachment to the object. Then you can change something, and click Cancel, and the changes will be reverted to those written when you clicked "Apply".


fc_tofu wrote: Mon Mar 23, 2020 12:44 pm As my understanding, "Apply" change source object position, but leave "map mode/attachment mode" untouched (or reset). Or say, "Apply" could work as non-parametric alignment.
This is something that deserves a special button maybe. "Apply" doesn't imply that, in my opinion.
fc_tofu
Posts: 653
Joined: Sun Jan 05, 2020 4:56 pm

Re: 0.19pre PartWB, Attachment >Apply, donnot work

Post by fc_tofu »

DeepSOIC wrote: Mon Mar 23, 2020 1:51 pm ...
This is something that deserves a special button maybe. "Apply" doesn't imply that, in my opinion.
Thank you, got it.

"Cancel" button misfunction in "Native" Attachment editor still need another fix, what's your opinion?
Last edited by fc_tofu on Mon Mar 23, 2020 3:57 pm, edited 1 time in total.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: 0.19pre PartWB, Attachment >Apply, donnot work

Post by openBrain »

fc_tofu wrote: Mon Mar 23, 2020 10:51 am
openBrain wrote: Mon Mar 23, 2020 9:59 am ...
In the native Attachment editor code, there is no Undo transaction opening. I thought it was done elsewhere, but actually it seems it isn't done at all :
...
Here, you just remind me up.

When opening Attachment editor from data property, the "Cancel" button doesnot work as it means. It works same as "OK".

BTW. When opening Attachment editor from menu/toolbar, the "Cancel" button works as desired.
Yep, that's what it induces. Because no Undo transaction is opened, neither Cancel, nor Undo after OK works correctly. I'm preparing a PR as @wmayer jumped over this. ;)
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: 0.19pre PartWB, Attachment >Apply, donnot work

Post by vocx »

openBrain wrote: Mon Mar 23, 2020 9:59 am ...
'openTransaction()' automatically commits the current one, so you don't need to commit then open. ;)
...
Are you sure about that?

In any case, Werner did what I suggested, commit and open again, git commit c32c9d565.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: 0.19pre PartWB, Attachment >Apply, donnot work

Post by openBrain »

vocx wrote: Mon Mar 23, 2020 3:56 pm Are you sure about that?
I'm sure. The problem I'm talking about lies in https://github.com/FreeCAD/FreeCAD/blob ... tacher.cpp
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: 0.19pre PartWB, Attachment >Apply, donnot work

Post by wmayer »

openBrain wrote: Mon Mar 23, 2020 10:18 am @wmayer, would you please be able to add the missing Undo transaction opening in TaskAttacher.cpp ? I think it's not worth a PR. ;) Thx
git commit bd0f5ca5c

Obviously there is a regression compared to v0.18 because there it opened a transaction. It looks like the auto-transaction mechanism is not technically mature.

In order to get the undo/redo working as expected I had to remove the check whether the AttachmentOffset is touched and the property MapPathParameter must be explicitly set too.

Now it works to reject the dialog or when accepting it then undo & redo works. However, I still encounter a weird problem: undo & redo works exactly 5 times and after doing undo the 6th time the placement of the object is not set correctly any more.

I have reported this in https://tracker.freecadweb.org/view.php?id=4265#c14271
Post Reply