Gui: expose Document::save()/saveAs() to Python

This commit is contained in:
wmayer
2022-12-31 13:01:20 +01:00
parent 178eb1dd84
commit 5e408445be
2 changed files with 36 additions and 0 deletions

View File

@@ -276,6 +276,30 @@ PyObject* DocumentPy::mdiViewsOfType(PyObject *args)
PY_CATCH;
}
PyObject* DocumentPy::save(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return nullptr;
PY_TRY {
bool ok = getDocumentPtr()->save();
return Py::new_reference_to(Py::Boolean(ok));
}
PY_CATCH;
}
PyObject* DocumentPy::saveAs(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return nullptr;
PY_TRY {
bool ok = getDocumentPtr()->saveAs();
return Py::new_reference_to(Py::Boolean(ok));
}
PY_CATCH;
}
PyObject* DocumentPy::sendMsgToViews(PyObject *args)
{
char* msg;