diff --git a/src/Gui/FreeCADGuiInit.py b/src/Gui/FreeCADGuiInit.py
index bc3a6e12b7..332be657cc 100644
--- a/src/Gui/FreeCADGuiInit.py
+++ b/src/Gui/FreeCADGuiInit.py
@@ -73,6 +73,8 @@ class Workbench:
self.__Workbench__.appendContextMenu(name, cmds)
def removeContextMenu(self,name):
self.__Workbench__.removeContextMenu(name)
+ def reloadActive(self):
+ self.__Workbench__.reloadActive()
def name(self):
return self.__Workbench__.name()
def GetClassName(self):
diff --git a/src/Gui/PythonWorkbenchPy.xml b/src/Gui/PythonWorkbenchPy.xml
index 9232ff9e86..344e467344 100644
--- a/src/Gui/PythonWorkbenchPy.xml
+++ b/src/Gui/PythonWorkbenchPy.xml
@@ -53,6 +53,11 @@
Remove a command bar
+
+
+ Reload the active workbench after changing menus or toolbars
+
+
deprecated -- use appendMenu
diff --git a/src/Gui/PythonWorkbenchPyImp.cpp b/src/Gui/PythonWorkbenchPyImp.cpp
index 6a4b5d7a3f..db609a3895 100644
--- a/src/Gui/PythonWorkbenchPyImp.cpp
+++ b/src/Gui/PythonWorkbenchPyImp.cpp
@@ -24,6 +24,7 @@
#include "PreCompiled.h"
#include "Workbench.h"
+#include "WorkbenchManager.h"
// inclusion of the generated files (generated out of PythonWorkbenchPy.xml)
#include "PythonWorkbenchPy.h"
@@ -274,6 +275,20 @@ PyObject* PythonWorkbenchPy::removeCommandbar(PyObject *args)
} PY_CATCH;
}
+/** Reload the workbench */
+PyObject* PythonWorkbenchPy::reloadActive(PyObject *args)
+{
+ PY_TRY {
+ if (!PyArg_ParseTuple(args, ""))
+ return nullptr;
+
+ Workbench* active = Gui::WorkbenchManager::instance()->active();
+ if (active)
+ active->activate();
+ Py_Return;
+ } PY_CATCH;
+}
+
PyObject* PythonWorkbenchPy::getCustomAttributes(const char* ) const
{
return nullptr;