What Gui::Command::openCommand do and for what it argument is translated?

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
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

What Gui::Command::openCommand do and for what it argument is translated?

Post by Evgeniy »

Link:

https://github.com/FreeCAD/FreeCAD/blob ... d.cpp#L290

It seems to me that this method should print a translated comment to the console describing what the command will do. But this method does not do this.
Last edited by Evgeniy on Sat Sep 25, 2021 2:12 pm, edited 1 time in total.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: What Gui::Command::openCommand do?

Post by openBrain »

IIRC, openCommand creates a new transaction (eventually closing the active one) in the undo/redo stack, and it uses the string as a name for the transaction.
Why do you think it should print something?
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

Re: What Gui::Command::openCommand do?

Post by Evgeniy »

openBrain wrote: Sat Sep 25, 2021 11:40 am Why do you think it should print something?
Because this line is followed by lines that print the text of the python script into python console.

Then I don't understand why it should be translated that,if it is not used anywhere?
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Left-align cell"));
Last edited by Evgeniy on Sat Sep 25, 2021 4:03 pm, edited 1 time in total.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: What Gui::Command::openCommand do?

Post by openBrain »

Evgeniy wrote: Sat Sep 25, 2021 1:44 pm Otherwise, I don't understand why QT_TRANSLATE_NOOP is there and why these lines are presented in Crowdin.
Crowdin offers to translate these strings, but for what? Just for nothing.
Better ask than guess. ;) The strings are visible in the undo stack that you can expand close to the Undo button.
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

Re: What Gui::Command::openCommand do?

Post by Evgeniy »

openBrain wrote: Sat Sep 25, 2021 2:21 pm Better ask than guess.
And I asked... https://forum.freecadweb.org/viewtopic. ... 06#p535806
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: What Gui::Command::openCommand do?

Post by openBrain »

Evgeniy wrote: Sat Sep 25, 2021 4:07 pm And I asked... https://forum.freecadweb.org/viewtopic. ... 06#p535806
But you guessed it was there for nothing. ;)
Anyway, you're welcome (I guess next step is that I have to apologize for helping :mrgreen:)
Post Reply