FEM: Add Preferences option to hide materials from .FreeCAD/Materials directory
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
This commit is contained in:
parent
32a51db481
commit
1d5b4709fe
|
@ -173,6 +173,22 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="cb_use_mat_from_config_dir">
|
||||
<property name="text">
|
||||
<string>Use materials from .FreeCAD/Materials directory</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>UseMaterialsFromConfigDir</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
|
|
|
@ -47,6 +47,7 @@ void DlgSettingsFemImp::saveSettings()
|
|||
fc_ext_editor->onSave();
|
||||
fc_ccx_binary->onSave();
|
||||
cb_use_built_in_materials->onSave();
|
||||
cb_use_mat_from_config_dir->onSave();
|
||||
fc_custom_mat_dir->onSave();
|
||||
}
|
||||
|
||||
|
@ -56,6 +57,7 @@ void DlgSettingsFemImp::loadSettings()
|
|||
fc_ext_editor->onRestore();
|
||||
fc_ccx_binary->onRestore();
|
||||
cb_use_built_in_materials->onRestore();
|
||||
cb_use_mat_from_config_dir->onRestore();
|
||||
fc_custom_mat_dir->onRestore();
|
||||
}
|
||||
|
||||
|
|
|
@ -252,8 +252,10 @@ class _MechanicalMaterialTaskPanel:
|
|||
system_mat_dir = FreeCAD.getResourceDir() + "/Mod/Material/StandardMaterial"
|
||||
self.add_mat_dir(system_mat_dir, ":/icons/freecad.svg")
|
||||
|
||||
user_mat_dirname = FreeCAD.getUserAppDataDir() + "Materials"
|
||||
self.add_mat_dir(user_mat_dirname, ":/icons/preferences-general.svg")
|
||||
use_mat_from_config_dir = self.fem_preferences.GetBool("UseMaterialsFromConfigDir")
|
||||
if use_mat_from_config_dir:
|
||||
user_mat_dirname = FreeCAD.getUserAppDataDir() + "Materials"
|
||||
self.add_mat_dir(user_mat_dirname, ":/icons/preferences-general.svg")
|
||||
|
||||
self.fem_preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem")
|
||||
custom_mat_dir = self.fem_preferences.GetString("CustomMaterialsDir","")
|
||||
|
|
Loading…
Reference in New Issue
Block a user