yes, that-one would be really nice to have. PreferencePacks limited to a choice of colours are not very useful, but if they can handle the entire work environment, including additional Addons to be installed, that would open the door to many use-cases : Architecture, 3D-printing, FEM ...
Turning Zolko's theme in to a Preference Pack
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Turning Zolko's theme in to a Preference Pack
Re: Turning Zolko's theme in to a Preference Pack
@Zolko
How did you configure the status bar?
How did the draft snap and scale get added to the navigation and 3d view size?
How did you configure the status bar?
How did the draft snap and scale get added to the navigation and 3d view size?
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Re: Turning Zolko's theme in to a Preference Pack
I don't see those things on my system. I think it's your config that does it
Re: Turning Zolko's theme in to a Preference Pack
Yes, my bad. I had Draft WB selected.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
- adrianinsaval
- Veteran
- Posts: 5551
- Joined: Thu Apr 05, 2018 5:15 pm
Re: Turning Zolko's theme in to a Preference Pack
yes but that file already existed and was already placed there before FreeCAD adopted the XDG standard since Qt has been using it for a long time apparently. On windows these are stored in the registry, not sure on macOS.
The toolbars I'm not so sure, I think the global toolbars are controlled at the qt level but workbench toolbars positions are supposed to be remembered by FreeCAD too, in very old versions these where not saved and required an addon that was eventually integrated into FreeCAD I believe. There might be some sort of conflict or overlap between what qt stores and what FreeCAD stores though.Same remark for toolbars, they don't seem to be controlled by the PreferencePack, at least not their position.
Re: Turning Zolko's theme in to a Preference Pack
OK, but then, how do you save and restore them in a PreferencePack ?adrianinsaval wrote: ↑Wed Aug 17, 2022 7:09 pm that file already existed and was already placed there before FreeCAD adopted the XDG standard since Qt has been using it for a long time apparently. On windows these are stored in the registry, not sure on macOS.
Re: Turning Zolko's theme in to a Preference Pack
I don't know how the position of the toolbars is stored, so I'm not much help on that front.
Preference Packs can absolutely set preferences for external workbenches: literally anything that can be set in user.cfg can be set in a preference pack, and Addon developers can even include Preference Pack template files as part of their Addon. In fact, you could create an entire addon that was nothing but Preference Pack template files! In addition, when you apply a preference pack it runs an optional FCMacro file, so you can use that file to do things that can't be done via the config file (e.g. if it turns out you can't set the location of the toolbars in user.cfg, you can write a short Python script to do it instead.
Preference Packs can absolutely set preferences for external workbenches: literally anything that can be set in user.cfg can be set in a preference pack, and Addon developers can even include Preference Pack template files as part of their Addon. In fact, you could create an entire addon that was nothing but Preference Pack template files! In addition, when you apply a preference pack it runs an optional FCMacro file, so you can use that file to do things that can't be done via the config file (e.g. if it turns out you can't set the location of the toolbars in user.cfg, you can write a short Python script to do it instead.
Re: Turning Zolko's theme in to a Preference Pack
Hmm...to experiment with PP templates in my mind I seem to have a chicken or egg scenario.chennes wrote: ↑Wed Aug 17, 2022 9:57 pm I don't know how the position of the toolbars is stored, so I'm not much help on that front.
Preference Packs can absolutely set preferences for external workbenches: literally anything that can be set in user.cfg can be set in a preference pack, and Addon developers can even include Preference Pack template files as part of their Addon. In fact, you could create an entire addon that was nothing but Preference Pack template files! In addition, when you apply a preference pack it runs an optional FCMacro file, so you can use that file to do things that can't be done via the config file (e.g. if it turns out you can't set the location of the toolbars in user.cfg, you can write a short Python script to do it instead.
If I open FreeCAD and do a Save new, in ~/.local/share/FreeCAD/SavedPreferencePacks/ I get a package.xml and a directory with the saved .cfg. (This .cfg file is the current state of user.cfg, including only the set that was checked in the Save dialog?).
To add custom parameters, then create a ~/.local/share/FreeCAD/SavedPreferencePacks/PreferencePackTemplates and add <custom name>.cfg files in this directory.
If the parameters specified in these custom cfg files don't exist they are created (with the specified defaults) when the PP is applied? So, a custom cfg that addresses, say parameters for a specific workbench would need to have the parameter tree that know that workbench parameter tree? If the workbench hasn't been installed are these values going to be over written if it then installed? As for completely custom params, do they just get created? (I'm off to experiment...)
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Re: Turning Zolko's theme in to a Preference Pack
Most workbenches don't actively overwrite their known parameters on installation (actually I don't know of any that do, I don't know how it would work). So you can happily set whatever config parameters you want: if no code ever checks them that's fine. If later on a WB gets installed that uses them, then they are there. Does that answer that part of your question?
The template files exist because there is no way to know what parameters are available, and what their default files are: FreeCAD is completely freeform in this regard. A developer can add a new parameter by simply using it in their code. There is no central repository, etc., and FreeCAD doesn't even keep track of which parameters are asked for: if a param isn't in the config file, its default value is returned, but no record is kept of that transaction. So those template files were my way of making such a repository, at least for variables that I figured might be used most commonly in preference packs. I started with just color info (because that seemed obvious), and we've been adding things ever since.
The template files exist because there is no way to know what parameters are available, and what their default files are: FreeCAD is completely freeform in this regard. A developer can add a new parameter by simply using it in their code. There is no central repository, etc., and FreeCAD doesn't even keep track of which parameters are asked for: if a param isn't in the config file, its default value is returned, but no record is kept of that transaction. So those template files were my way of making such a repository, at least for variables that I figured might be used most commonly in preference packs. I started with just color info (because that seemed obvious), and we've been adding things ever since.
Re: Turning Zolko's theme in to a Preference Pack
Pursuant to my previous post.
I did a save new.
This created the following directory/file:
~/.local/share/FreeCAD/SavedPreferencePacks/TestCustomParams/
I then created a sub-directory:
~/.local/share/FreeCAD/SavedPreferencePacks/TestCustomParams/PreferencePackTemplates/
In it I placed a file: MacMods.cfg
With contents:
I then applied the pack, but MacMods is not created in the Param tree.
On another note (probably because of how I initially got got this particular cfg)
Every time I apply a pack I get the following warning:
I've not been able to figure out where this is (I know where shortcuts are defined, just not which category is trying to assign 3...)
I did a save new.
This created the following directory/file:
~/.local/share/FreeCAD/SavedPreferencePacks/TestCustomParams/
I then created a sub-directory:
~/.local/share/FreeCAD/SavedPreferencePacks/TestCustomParams/PreferencePackTemplates/
In it I placed a file: MacMods.cfg
With contents:
Code: Select all
<<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<FCParameters>
<FCParamGroup Name="Root">
<FCParamGroup Name="BaseApp">
<FCParamGroup Name="Preferences">
<FCParamGroup Name="MacMods">
<FCText Name="MacString">Test MacModString</FCText>
</FCParamGroup>
</FCParamGroup>
</FCParamGroup>
</FCParamGroup>
</FCParameters>
On another note (probably because of how I initially got got this particular cfg)
Every time I apply a pack I get the following warning:
Code: Select all
keyboard shortcut 3 disabled: because conflicting with Std_ViewRight
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."