Skip to content

Commit

Permalink
Gui: Allow to clean modified state
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Mar 28, 2024
1 parent c3409fa commit 977c009
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Gui/DocumentPy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,15 @@ on its canAddToSceneGraph().
obj : Gui.ViewProvider</UserDocu>
</Documentation>
</Methode>
<Methode Name="resetModified">
<Documentation>
<UserDocu>resetModified() -> None

Resets the Modified status of this document. WARNING: This document
will be considered saved and no warning will be issued when closing
it.</UserDocu>
</Documentation>
</Methode>
<Attribute Name="ActiveObject" ReadOnly="false">
<Documentation>
<UserDocu>The active object of the document.</UserDocu>
Expand Down
9 changes: 9 additions & 0 deletions src/Gui/DocumentPyImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,3 +552,12 @@ int DocumentPy::setCustomAttributes(const char* attr, PyObject *)

return 0;
}

PyObject* DocumentPy::resetModified(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return nullptr;

getDocumentPtr()->setModified(false);
Py_Return;
}

0 comments on commit 977c009

Please sign in to comment.