Gui: move reloadActive() to WorkbenchPy base class

This commit is contained in:
wmayer
2022-02-18 07:51:47 +01:00
parent fdc4196384
commit fe2719014b
4 changed files with 20 additions and 21 deletions

View File

@@ -11,7 +11,7 @@
FatherNamespace="Gui">
<Documentation>
<Author Licence="LGPL" Name="Werner Mayer" EMail="wmayer@users.sourceforge.net" />
<UserDocu>This class handles document objects in group</UserDocu>
<UserDocu>This is the class for Python workbenches</UserDocu>
</Documentation>
<Methode Name="appendMenu">
<Documentation>
@@ -53,11 +53,6 @@
<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>

View File

@@ -24,7 +24,6 @@
#include "PreCompiled.h"
#include "Workbench.h"
#include "WorkbenchManager.h"
// inclusion of the generated files (generated out of PythonWorkbenchPy.xml)
#include "PythonWorkbenchPy.h"
@@ -275,20 +274,6 @@ 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;

View File

@@ -43,6 +43,11 @@
<UserDocu>Show a list of all menus</UserDocu>
</Documentation>
</Methode>
<Methode Name="reloadActive" Static="true">
<Documentation>
<UserDocu>Reload the active workbench after changing menus or toolbars</UserDocu>
</Documentation>
</Methode>
<CustomAttributes />
</PythonExport>
</GenerateModel>

View File

@@ -145,6 +145,20 @@ PyObject* WorkbenchPy::listCommandbars(PyObject *args)
} PY_CATCH;
}
/** Reload the workbench */
PyObject* WorkbenchPy::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* WorkbenchPy::getCustomAttributes(const char*) const
{
return nullptr;