Add a API to add/remove items to the "Tools" menu
Created by: ghost
Make possible add and remove items to the "Tools" menu. The API is based on my initial proposal but i changed some things during the implementation:
- I removed the
has_plugin_menu_item
(I don't added it since other functions don't have it'shas_*
counterpart). - All function were renamed to use
*_tool_*
instead of*_plugin_*
, IMO this way it's clear that the functions are related to the "Tools" menu. - The
int ID
parameter ofadd_tool_menu_item
was changed toVariant ud
, used for the callback function. - The callback format now is
callback(Variant ud)
, which made the code simpler and more flexible. - The name format for the items, were changed from
"my_category/my_item"
/"MyCategory/MyItem
" toANY string_Format/My Item Name
where the first slice is the item category, this way the name parameter is friendlier to translation(e.g."category/"+TTR("My Item Name")
orvformat("categoty/%s", TTR("My Item Name"))
).
Closes #1429 (closed).