+ Make transient directory of the form ExeName_Doc_{UUID}_{HASH}_{PID}

+ Set some properties in Document read-only

+ Implement Document::saveAs

+ Fix PropertyUUID::setValue()

+ Add a field for UUID in document information panel
This commit is contained in:
wmayer
2013-05-04 03:16:34 +02:00
parent 9ad4bb5595
commit 2bbe465229
9 changed files with 216 additions and 112 deletions
+19
View File
@@ -69,6 +69,25 @@ PyObject* DocumentPy::save(PyObject * args)
Py_Return;
}
PyObject* DocumentPy::saveAs(PyObject * args)
{
char* fn;
if (!PyArg_ParseTuple(args, "s", &fn)) // convert args: Python->C
return NULL; // NULL triggers exception
if (!getDocumentPtr()->saveAs(fn)) {
PyErr_Format(PyExc_ValueError, "Object attribute 'FileName' is not set");
return NULL;
}
Base::FileInfo fi(fn);
if (!fi.isReadable()) {
PyErr_Format(PyExc_IOError, "No such file or directory: '%s'", fn);
return NULL;
}
Py_Return;
}
PyObject* DocumentPy::restore(PyObject * args)
{
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C