Gui: expose Document::save()/saveAs() to Python
This commit is contained in:
@@ -97,6 +97,18 @@ Return a list of mdi views of a given type.\n
|
||||
type : str\n Type name.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="save">
|
||||
<Documentation>
|
||||
<UserDocu>save() -> bool\n
|
||||
Attempts to save the document</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="saveAs">
|
||||
<Documentation>
|
||||
<UserDocu>saveAs() -> bool\n
|
||||
Attempts to save the document under a new name</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="sendMsgToViews">
|
||||
<Documentation>
|
||||
<UserDocu>sendMsgToViews(msg) -> None\n
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user