Gui: add method to reload active workbench

This commit is contained in:
wmayer
2022-02-16 17:33:29 +01:00
parent 15f382c255
commit 35fd97a8ae
3 changed files with 22 additions and 0 deletions

View File

@@ -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;