Gui: add Gui.updateCommands() for manual command status update

This commit is contained in:
Zheng, Lei
2019-09-04 16:57:45 +08:00
committed by wmayer
parent 69d124a93c
commit c3fe336dc5
2 changed files with 12 additions and 0 deletions

View File

@@ -144,6 +144,9 @@ PyMethodDef Application::Methods[] = {
{"listCommands", (PyCFunction) Application::sListCommands, METH_VARARGS,
"listCommands() -> list of strings\n\n"
"Returns a list of all commands known to FreeCAD."},
{"updateCommands()", (PyCFunction) Application::sUpdateCommands, METH_VARARGS,
"updateCommands()\n\n"
"Update all command active status"},
{"SendMsgToActiveView", (PyCFunction) Application::sSendActiveView, METH_VARARGS,
"deprecated -- use class View"},
{"sendMsgToFocusView", (PyCFunction) Application::sSendFocusView, METH_VARARGS,
@@ -1246,6 +1249,14 @@ PyObject* Application::sIsCommandActive(PyObject * /*self*/, PyObject *args)
}PY_CATCH;
}
PyObject* Application::sUpdateCommands(PyObject * /*self*/, PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
getMainWindow()->updateActions();
Py_Return;
}
PyObject* Application::sListCommands(PyObject * /*self*/, PyObject *args)
{