There is something really weird going on with TechDraw preferences. Or maybe it is with language switching within the preferences.
I was trying to troubleshoot why views created in TechDraw would refuse to show hidden lines, even when I set the "Hard Hidden" and "Smooth Hidden" properties of TD views to true.
Starting from a fresh .FreeCAD folder, I load TechDraw then I go to Edit --> Preferences --> TechDraw. What I see is this:
So Hidden Line type is set to "Solide" (Solid) by default. Which seems odd to me.
But, before changing this setting, I go to General then switches the language to English; then I go back to TechDraw. And now, here's what it shows:
Uh. It's now set to "NeverShow", and I never touched it.
So I change it to "Dash", click Apply, then switch back to General, change language back to French, Apply, go back to TechDraw prefs, and now the setting is... "ToujoursCacher", which is NeverShow!
Hidden Line pref disregarded if language is French
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- wandererfan
- Veteran
- Posts: 6307
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Hidden Line pref disregarded if language is French
It happens here too, if Preferences>General and Preferences>TechDraw are both in the sidebar. If TechDraw isn't in the sidebar then it doesn't happen.
If I change language from French to English, the TD hidden line parameter in user.cfg changes from solide(1) to neverDraw(0).
Code: Select all
<FCParamGroup Name="General">
<FCInt Name="HiddenLine" Value="1"/>
<FCInt Name="ProjectionAngle" Value="0"/>
...
Code: Select all
<FCParamGroup Name="General">
<FCInt Name="HiddenLine" Value="0"/>
<FCInt Name="ProjectionAngle" Value="0"/>
...
Can't make it change the other way from ToujoursCache to Solide by changing language.
The only common thing I can find is that both parameters are in a subgroup called "General".
Re: Hidden Line pref disregarded if language is French
The point is that when changing the language a preference page receives an event and to call a function translateUi. This function is generated by Qt's uic compiler and always clears combo boxes. So, developers must take special care about this behaviour and explicitly save & restore the current index.
- wandererfan
- Veteran
- Posts: 6307
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Hidden Line pref disregarded if language is French
Is this what you mean? Does it only apply to comboBox derived widgets?
Code: Select all
void DlgPrefsTechDrawImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
saveAllTheComboBoxIndices();
retranslateUi(this);
restoreAllTheComboBoxIndices();
}
else {
Re: Hidden Line pref disregarded if language is French
Yes, I think so. But e.g. the font combo box is not affected which is more or less obvious as there is nothing to translate.Does it only apply to comboBox derived widgets?
- wandererfan
- Veteran
- Posts: 6307
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Hidden Line pref disregarded if language is French
This should be fixed by git commit 9d26fe05.
- wandererfan
- Veteran
- Posts: 6307
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact: