Gui: add method to reload active workbench
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -53,6 +53,11 @@
|
||||
<UserDocu>Remove a command bar</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="reloadActive" Static="true">
|
||||
<Documentation>
|
||||
<UserDocu>Reload the active workbench after changing menus or toolbars</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="AppendMenu">
|
||||
<Documentation>
|
||||
<UserDocu>deprecated -- use appendMenu</UserDocu>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user