HelloWorld.py -> Autoload_HelloWorld.py
Autoload
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Autoload
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Autoload
There is no need to create HelloWorld.py first. If you plan to add some code to be loaded on FreeCAD start you need to use the Autoload_ prefix in the first place. And as for your other concern. I don't feel it clutters the macro folder to have the module to be loaded there. As i do imagine regular user does want to have it listed in the macro dialog. And to be able to create, delete and edit it at any time from the macro dialog GUI and by using built in code editor. Any other option likely involves more complex workflow to achieve the same result and therefore makes less sense to me. Whoever wants to use more complex option likely won't use Autoload module in the first place and therefore likely isn't the target audience.
Re: Autoload
Thanks for the answers, you are probably right.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Autoload
Thank you, triplus, I use Autoload as a workaround to prevent custom toolbar being erased before loading related workbench.triplus wrote: ↑Fri Jun 16, 2017 4:07 pm Autoload.png
Autoload module for FreeCAD.
Provides ability to load more workbenches on FreeCAD start. Such ability can be useful for workbench customization purposes and in combination with modules such as PieMenu, ShortCuts, CommandPanel ...
Code repository:
https://github.com/triplus/Autoload
https://forum.freecadweb.org/viewtopic. ... 05#p364205
And it really worked well.
Based on Autoload 20190227 official release, I made a little revision for UI. I'm not a coder. This revision is for explanation of my suggestion.
1. change menu position under "Tools" (for my own practice)
2. resize dialog window smaller, from 800*450 to 400*400 (for low res monitor)
3. add StatusTip, "Load specified workbenches and macros on startup" (for new users)
Last edited by fc_tofu on Thu Jan 30, 2020 1:01 am, edited 4 times in total.
Re: Autoload
You're welcome and good to hear that.
It used to work like that, but there are issues involved on some platforms, like macOS, that don't make the Tools menu a viable option anymore. In addition it's not just Autoload module, there are a few more, available in the Addons manager, that utilize the Accessories menu. In the future some functionality will likely get upstreamed, then it should be possible again, to put the Accessories menu under the Tools menu.As for the UI, I would like the "Autoload" menu directly put under "&Tools" menu.
There is lot of room left in "&Tools" menu, compared with those giants such as Part/PartDesign/Draft/A2plus menu.
And I dont think the up level "Accessories" menu is a good idea, it only waste mouse click.
Any suggestion on what should such tooltip say? Something like "Manage automatic loading of workbenches and macros"?Last, how to add tooltip for Autoload, just like those native menu, ie, Tools>Addon Manager.
Re: Autoload
The part about modifying the location (Tools menu). That likely works on your local setup, but as said and if you will look at the mentioned issue report, it doesn't work cross-platform. You can continue to use that patch locally for sure. As for the tooltip, looks good to me. Any interest in creating a tooltip oriented PR on GitHub?
https://github.com/triplus/Autoload
https://github.com/triplus/Autoload
Re: Autoload
I'm very happy if you adopt any of my suggestions.triplus wrote: ↑Wed Jan 29, 2020 6:53 pm The part about modifying the location (Tools menu). That likely works on your local setup, but as said and if you will look at the mentioned issue report, it doesn't work cross-platform. You can continue to use that patch locally for sure. As for the tooltip, looks good to me. Any interest in creating a tooltip oriented PR on GitHub?
https://github.com/triplus/Autoload
But, I am not a coder, and dont have GitHub account. So, you should bother to add StatusTip yourself.
BTW, as an unruled common practice, menu text followed by 3 ellipsis dots means to open a dialog.
Here, menu text "Autoload..." would be better than "Autoload". IMHO.
Code: Select all
pref = QtGui.QAction(mw)
pref.setText("Autoload...")
pref.setObjectName("Autoload")
pref.setStatusTip ("Load specified workbenches and macros on startup")
Re: Autoload
Hello, @triplus, sorry to bother you again. Just a tiny issue about sort order.
In Autoload's list, some wb are sorted in different way than FreeCAD workbench menu.
Case 1
GearsWB always appeart on list bottom. Case 2
Part WB appear under Part Design WB It seems Autoload's sort order is based on class names of wb. But would it be better to sort in according to "MenuText" name?
And also, what is "<none>" workbench/module? Is it useful to be listed here?
TabBar addon's default list has same issue.
Autoload and TabBar are most used addon in my FC. Thank you very much.