fix(gui): forward optional visibility arg in Workbench.appendToolbar()
All checks were successful
Build and Test / build (pull_request) Successful in 36m44s

The Python wrapper in FreeCADGuiInit.py only accepted (name, cmds) and
did not forward the optional visibility parameter to the underlying C++
PythonWorkbench::appendToolbar which accepts 'sO|s'. This caused a
'takes 3 positional arguments but 4 were given' error when workbenches
passed a visibility string like 'Unavailable'.
This commit is contained in:
2026-02-12 13:40:37 -06:00
parent 9a31a579b2
commit ab71902a4c

View File

@@ -113,8 +113,11 @@ class Workbench:
def ContextMenu(self, recipient):
pass
def appendToolbar(self, name, cmds):
self.__Workbench__.appendToolbar(name, cmds)
def appendToolbar(self, name, cmds, visibility=None):
if visibility is not None:
self.__Workbench__.appendToolbar(name, cmds, visibility)
else:
self.__Workbench__.appendToolbar(name, cmds)
def removeToolbar(self, name):
self.__Workbench__.removeToolbar(name)