Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 17620 → Rev 17621

/trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp
382,6 → 382,22
Py_RETURN_NONE;
}
 
PyObject *scribus_setnewname(PyObject* /* self */, PyObject* args)
{
char *Name = const_cast<char*>("");
char *newName = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "es|es", "utf-8", &newName, "utf-8", &Name))
return NULL;
if(!checkHaveDocument())
return NULL;
PageItem *currItem = GetUniqueItem(QString::fromUtf8(Name));
if (currItem == NULL)
return NULL;
currItem->setItemName(newName);
Py_RETURN_NONE;
}
 
 
/*! HACK: this removes "warning: 'blah' defined but not used" compiler warnings
with header files structure untouched (docstrings are kept near declarations)
PV */
395,5 → 411,6
<< scribus_setlinewidth__doc__ << scribus_setlineshade__doc__
<< scribus_setlinejoin__doc__ << scribus_setlinecap__doc__
<< scribus_setlinestyle__doc__ << scribus_setfillshade__doc__
<< scribus_setcornerrad__doc__ << scribus_setmultiline__doc__;
<< scribus_setcornerrad__doc__ << scribus_setmultiline__doc__
<< scribus_setnewname__doc__;
}
/trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
513,6 → 513,7
{const_cast<char*>("setMargins"), scribus_setmargins, METH_VARARGS, tr(scribus_setmargins__doc__)},
{const_cast<char*>("setBaseLine"), scribus_setbaseline, METH_VARARGS, tr(scribus_setbaseline__doc__)},
{const_cast<char*>("setMultiLine"), scribus_setmultiline, METH_VARARGS, tr(scribus_setmultiline__doc__)},
{const_cast<char*>("setNewName"), scribus_setnewname, METH_VARARGS, tr(scribus_setnewname__doc__)},
// duplicity? {"setMultiLine", scribus_setmultiline, METH_VARARGS, "TODO: docstring"},
{const_cast<char*>("setRedraw"), scribus_setredraw, METH_VARARGS, tr(scribus_setredraw__doc__)},
// missing? {"setSelectedObject", scribus_setselobjnam, METH_VARARGS, "Returns the Name of the selecteted Object. \"nr\" if given indicates the Number of the selected Object, e.g. 0 means the first selected Object, 1 means the second selected Object and so on."},
/trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.h
193,5 → 193,16
/*! Set multiline */
PyObject *scribus_setmultiline(PyObject * /*self*/, PyObject* args);
 
/*! docstring */
PyDoc_STRVAR(scribus_setnewname__doc__,
QT_TR_NOOP("setNewName(newname, [\"name\"])\n\
\n\
Sets the new name of the object \"name\" to the newname.\n\
If \"name\" is not given the currently selected item is used.\n\
\n\
May raise NotFoundError if the line style doesn't exist.\n\
"));
/*! Set newname */
PyObject *scribus_setnewname(PyObject * /*self*/, PyObject* args);
#endif