[macros dialog] add guided walkthrough for putting macros on custom global toolbar

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

[macros dialog] add guided walkthrough for putting macros on custom global toolbar

Post by TheMarkster »

One of the issues I think many beginners (and many experienced users, too) struggle with is putting a macro on a custom global toolbar. I also thought it would be convenient for experienced users who already know how to do it to have a button in the macros dialog that would open up the relevant page in the customize dialog to add the macro to a toolbar.

I've added some code to the macros dialog. There is now a "Toolbar" button. Click it and it will open the Customize dialog with the macro selected for you in the combo box where the macros are listed. All you have to do is click the Add button, then Close the dialog. Then the code opens the Customize dialog with the Global workbench selected in the workbench combo box and the Macros item selected in the commands combo box. All you have to do is click the right arrow button to put the macro on the toolbar. If you don't already have a custom toolbar created, then you need to click the New button to create one first, then the right arrow.

FreeCAD must be restarted in order to apply changes to the toolbar menu. I offer the option to restart once the process is complete. This is done via the python console with:

Code: Select all

import addonmanager_utilities
addonmanager_utilities.restartFreeCAD()
But perhaps someone knows of a way to reload the toolbar without needing to restart?

I think with the guided walkthrough it will be fairly easy even for beginners, but I would like some feedback before submitting the pull request.

phpBB [video]
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: [macros dialog] add guided walkthrough for putting macros on custom global toolbar

Post by TheMarkster »

I made some revisions.

phpBB [video]


What do you think? Is this needed or is it already easy enough to add a macro to a custom toolbar?
mario52 wrote: ping
chrisb wrote: ping
mario52
Veteran
Posts: 4701
Joined: Wed May 16, 2012 2:13 pm

Re: [macros dialog] add guided walkthrough for putting macros on custom global toolbar

Post by mario52 »

hi

good idea +1

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
chrisb
Veteran
Posts: 54313
Joined: Tue Mar 17, 2015 9:14 am

Re: [macros dialog] add guided walkthrough for putting macros on custom global toolbar

Post by chrisb »

+1

Is it possible to rename the button to something like "Add to toolbar" or will it be too long?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
mario52
Veteran
Posts: 4701
Joined: Wed May 16, 2012 2:13 pm

Re: [macros dialog] add guided walkthrough for putting macros on custom global toolbar

Post by mario52 »

Hi

other, i work the wiki (not finished) for see the information and complete path for the Icon

|Version=01.00
|Date=2010-11-17
|FCVersion=All
|Download=[https://www.freecadweb.org/wiki/images/ ... egrees.png Macro_Rotate_View_view_90_Degrees]

(maybe adding the creator ?)

all visible in the window of AddonManager with your upgrade , is it possible download the icon and copy it in the macro location (i work on creation icon for all macro)

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: [macros dialog] add guided walkthrough for putting macros on custom global toolbar

Post by TheMarkster »

chrisb wrote: Tue Jul 09, 2019 9:46 am +1

Is it possible to rename the button to something like "Add to toolbar" or will it be too long?
I think it would be too long. It would force the other buttons to stretch.
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: [macros dialog] add guided walkthrough for putting macros on custom global toolbar

Post by TheMarkster »

mario52 wrote: Tue Jul 09, 2019 9:57 am Hi

other, i work the wiki (not finished) for see the information and complete path for the Icon

|Version=01.00
|Date=2010-11-17
|FCVersion=All
|Download=[https://www.freecadweb.org/wiki/images/ ... egrees.png Macro_Rotate_View_view_90_Degrees]

(maybe adding the creator ?)

all visible in the window of AddonManager with your upgrade , is it possible download the icon and copy it in the macro location (i work on creation icon for all macro)

mario
The icon is something that we need to figure out a better solution for. That can be done later as a different pull request.
mario52
Veteran
Posts: 4701
Joined: Wed May 16, 2012 2:13 pm

Re: [macros dialog] add guided walkthrough for putting macros on custom global toolbar

Post by mario52 »

hi

ok

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [macros dialog] add guided walkthrough for putting macros on custom global toolbar

Post by Kunda1 »

This is a good idea, @TheMarkster :)
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: [macros dialog] add guided walkthrough for putting macros on custom global toolbar

Post by TheMarkster »

I revised the code again. I removed the final messagebox informing user to switch workbenches to apply the changes. This information instead is now included in the first message box. This will reduce the number of clicks needed.
Post Reply