HelloWorld.py -> Autoload_HelloWorld.py
A forum for research and development of the user interface of FreeCAD
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.
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 pmAutoload.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 ...
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.
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.
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?
I'm very happy if you adopt any of my suggestions.triplus wrote: ↑Wed Jan 29, 2020 6:53 pmThe 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?
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")