PR #6408 - Addon manager: Auto-add Macro toolbar button
Posted: Mon Feb 21, 2022 3:36 am
By popular request, this last major feature addition to the Addon Manager will hopefully (barring any unforeseen explosions) be incorporated into the 0.20 release. From the PR:
The main work of this commit is to add a workflow following the installation of a new macro that asks if you would like to add this macro to a toolbar. The exact behavior will depend on whether you already have custom toolbars or not: if you do, then you'll be prompted as to whether you want to install the button in one of them, or to create a new toolbar. If you don't have any custom toolbars this is skipped, and one is automatically created. If the macro provides an icon, that is used in the toolbar. If not, the current behavior is to display the name of the macro. I am evaluating whether auto-creation of an icon is feasible/desirable, and welcome your comments in this regard.
Several other minor changes to macro installation behavior are also implemented in support of this new feature: most notably, two additional methods for supplying the macros' icon are implemented. First, it was noted that several macros attempted to use an online URL for their icon, even though this was not supported. Now, if an http or https link is provided for the __icon__ field, that file is downloaded and used as the macro's icon both in the Addon Manager and when installed to a toolbar. Second, if either __icon__ or __xpm__ contain a triple-quoted string, that string is treated as XPM data and written into a *.xpm file. If the data results in a valid XPM-formatted icon, that icon is then used both in the Addon Manager and in toolbars as the icon for that macro. Note that this data must be triple-quoted, and triple quotes are explicitly disallowed for any other metadata fields.