fix(gui): forward optional visibility arg in Workbench.appendToolbar()
All checks were successful
Build and Test / build (pull_request) Successful in 36m44s
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:
@@ -113,8 +113,11 @@ class Workbench:
|
|||||||
def ContextMenu(self, recipient):
|
def ContextMenu(self, recipient):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def appendToolbar(self, name, cmds):
|
def appendToolbar(self, name, cmds, visibility=None):
|
||||||
self.__Workbench__.appendToolbar(name, cmds)
|
if visibility is not None:
|
||||||
|
self.__Workbench__.appendToolbar(name, cmds, visibility)
|
||||||
|
else:
|
||||||
|
self.__Workbench__.appendToolbar(name, cmds)
|
||||||
|
|
||||||
def removeToolbar(self, name):
|
def removeToolbar(self, name):
|
||||||
self.__Workbench__.removeToolbar(name)
|
self.__Workbench__.removeToolbar(name)
|
||||||
|
|||||||
Reference in New Issue
Block a user