View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0016003 | Scribus | Scripter | public | 2019-12-10 09:44 | 2020-04-05 19:37 |
Reporter | ale | Assigned To | ale | ||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Product Version | 1.5.6.svn | ||||
Fixed in Version | 1.5.6.svn | ||||
Summary | 0016003: Scripter: rename traceText() to outlineText() | ||||
Description | ... and deprecate traceText()... (i like traceText(), but matching the UI will help with the discoverability...) | ||||
Tags | No tags attached. | ||||
Patch | Yes | ||||
|
scripter-text-to-outlines.diff (3,574 bytes)
diff --git a/scribus/plugins/scriptplugin/cmdtext.cpp b/scribus/plugins/scriptplugin/cmdtext.cpp index b988726a2..f3f2b6c02 100644 --- a/scribus/plugins/scriptplugin/cmdtext.cpp +++ b/scribus/plugins/scriptplugin/cmdtext.cpp @@ -1225,7 +1225,7 @@ PyObject *scribus_unlinktextframes(PyObject* /* self */, PyObject* args) * 2004-09-07 (Craig Ringer) * 2004-09-14 pv frame type, optional frame name param */ -PyObject *scribus_tracetext(PyObject* /* self */, PyObject* args) +PyObject *scribus_texttooutlines(PyObject* /* self */, PyObject* args) { char *name = const_cast<char*>(""); if (!PyArg_ParseTuple(args, "|es", "utf-8", &name)) @@ -1412,6 +1412,7 @@ void cmdtextdocwarnings() << scribus_deletetext__doc__ << scribus_settextfill__doc__ << scribus_settextstroke__doc__ << scribus_settextshade__doc__ << scribus_linktextframes__doc__ << scribus_unlinktextframes__doc__ + << scribus_texttooutlines__doc__ << scribus_tracetext__doc__ << scribus_istextoverflowing__doc__ << scribus_setpdfbookmark__doc__ << scribus_ispdfbookmark__doc__ << scribus_hyphenatetext__doc__ << scribus_dehyphenatetext__doc__ diff --git a/scribus/plugins/scriptplugin/cmdtext.h b/scribus/plugins/scriptplugin/cmdtext.h index 6d989457a..16c08af51 100644 --- a/scribus/plugins/scriptplugin/cmdtext.h +++ b/scribus/plugins/scriptplugin/cmdtext.h @@ -481,16 +481,21 @@ May throw ScribusException if linking rules are violated.\n\ PyObject *scribus_unlinktextframes(PyObject * self, PyObject* args); /*! docstring */ -PyDoc_STRVAR(scribus_tracetext__doc__, -QT_TR_NOOP("traceText([\"name\"])\n\ +PyDoc_STRVAR(scribus_texttooutlines__doc__, +QT_TR_NOOP("textToOutlines([\"name\"])\n\ \n\ Convert the text frame \"name\" to outlines. If \"name\" is not given the\n\ currently selected item is used.")); +PyDoc_STRVAR(scribus_tracetext__doc__, +QT_TR_NOOP("traceText([\"name\"])\n\ +\n\ +Deprecated, use textToOutlines() instead.")); + /** Trace text frames via Scripter. 2004-09-07 (Craig Ringer) */ -PyObject *scribus_tracetext(PyObject * self, PyObject* args); +PyObject *scribus_texttooutlines(PyObject * self, PyObject* args); PyDoc_STRVAR(scribus_istextoverflowing__doc__, QT_TR_NOOP("textOverflows([\"name\", nolinks]) -> integer\n\ diff --git a/scribus/plugins/scriptplugin/scriptplugin.cpp b/scribus/plugins/scriptplugin/scriptplugin.cpp index 49d87150e..eeea771e7 100644 --- a/scribus/plugins/scriptplugin/scriptplugin.cpp +++ b/scribus/plugins/scriptplugin/scriptplugin.cpp @@ -563,7 +564,8 @@ PyMethodDef scribus_methods[] = { {const_cast<char*>("statusMessage"), scribus_messagebartext, METH_VARARGS, tr(scribus_messagebartext__doc__)}, {const_cast<char*>("textFlowMode"), scribus_textflow, METH_VARARGS, tr(scribus_textflow__doc__)}, {const_cast<char*>("textOverflows"), (PyCFunction)scribus_istextoverflowing, METH_VARARGS|METH_KEYWORDS, tr(scribus_istextoverflowing__doc__) }, - {const_cast<char*>("traceText"), scribus_tracetext, METH_VARARGS, tr(scribus_tracetext__doc__)}, + {const_cast<char*>("textToOutlines"), scribus_texttooutlines, METH_VARARGS, tr(scribus_texttooutlines__doc__)}, + {const_cast<char*>("traceText"), scribus_texttooutlines, METH_VARARGS, tr(scribus_tracetext__doc__)}, {const_cast<char*>("unGroupObject"), scribus_ungroupobj, METH_VARARGS, tr(scribus_ungroupobj__doc__)}, {const_cast<char*>("unlinkTextFrames"), scribus_unlinktextframes, METH_VARARGS, tr(scribus_unlinktextframes__doc__)}, {const_cast<char*>("valueDialog"), scribus_valdialog, METH_VARARGS, tr(scribus_valdialog__doc__)}, |
|
What do we need to do to keep backwards compatibiility? or don't we care? Add this? {const_cast<char*>("traceText"), scribus_texttooutlines, METH_VARARGS, tr(scribus_texttooutlines__doc__)}, ? |
|
if i did not do an error while preparing the patch, the diff above should maintain the backward compatibility. but adds a path for deprecating the "old" command. in this case, i don't think that backwards compatibility is important. this is not a common command and i don't think that there is any script that is published to the public that uses this feature. for "private" scripts, it should be easy to make the change. |
|
I'd prefer that we keep naming scripter functions with verb + action, so something like convertToOutlines or outlineText. Make your choice! |
|
i don't care about the name, as long as it's easy to find the command if you look for what is in the corresponding menu. as long as we don't have an "object oriented" scripter, outlineText() might be slightly better... |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-12-10 09:44 | ale | New Issue | |
2019-12-10 14:07 | ale | Summary | Scripter: rename traceText() to convertToOutlines() => [PATCH] Scripter: rename traceText() to textToOutlines() |
2019-12-10 14:07 | ale | Patch | No => Yes |
2019-12-10 14:08 | ale | File Added: scripter-text-to-outlines.diff | |
2019-12-10 22:18 | cbradney | Note Added: 0047242 | |
2019-12-11 09:09 | ale | Note Added: 0047245 | |
2019-12-26 03:27 | jghali | Note Added: 0047305 | |
2019-12-27 11:58 | ale | Note Added: 0047307 | |
2019-12-28 21:33 | jghali | Summary | [PATCH] Scripter: rename traceText() to textToOutlines() => Scripter: rename traceText() to outlineText() |
2019-12-28 21:35 | jghali | Assigned To | => ale |
2019-12-28 21:35 | jghali | Status | new => resolved |
2019-12-28 21:35 | jghali | Resolution | open => fixed |
2019-12-28 21:35 | jghali | Fixed in Version | => 1.5.6.svn |
2020-04-05 19:37 | cbradney | Status | resolved => closed |