r14946 by jghali - #8966, scripter : add fileQuit() api to close scribus
scribus-commit
scribus-commit at lists.scribus.net
Mon Mar 29 23:00:36 CEST 2010
Revision: 14946
Author: jghali
Date: 2010-03-29T20:55:45.097410Z
Commit message: #8966, scripter : add fileQuit() api to close scribus
Changeset:
M /branches/Version135/Scribus/scribus/plugins/scriptplugin/cmdmisc.h
M /branches/Version135/Scribus/scribus/doc/en/scripterapi-dialogs.html
M /branches/Version135/Scribus/scribus/doc/fr/scripterapi-dialogs.html
M /branches/Version135/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp
M /branches/Version135/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
Diffs:
Index: scribus/doc/en/scripterapi-dialogs.html
===================================================================
--- scribus/doc/en/scripterapi-dialogs.html (revision 14945)
+++ scribus/doc/en/scripterapi-dialogs.html (revision 14946)
@@ -16,6 +16,10 @@
<p>Example: <a href="#-fileDialog">fileDialog</a>('Open input', 'CSV files (*.csv)')<br>
Example: <a href="#-fileDialog">fileDialog</a>('Save report', defaultname='report.txt', issave=True)</p></dd>
+<dt><a name="-fileQuit"><strong>fileQuit</strong></a>(...)</dt>
+<dd><code>fileQuit()</code>
+<p>Quit Scribus.</p></dd>
+
<dt><a name="-getGuiLanguage"><strong>getGuiLanguage</strong></a>(...)</dt>
<dd><code>getGuiLanguage() -> string</code>
<p>Returns a string with the -lang value.</p></dd>
Index: scribus/doc/fr/scripterapi-dialogs.html
===================================================================
--- scribus/doc/fr/scripterapi-dialogs.html (revision 14945)
+++ scribus/doc/fr/scripterapi-dialogs.html (revision 14946)
@@ -19,6 +19,10 @@
Exemple : <a href="#-fileDialog">fileDialog</a>('Enregistrer le
rapport',
nomDefaut='report.txt', estEnregistre=True)</p></dd>
+
+<dt><a name="-fileQuit"><strong>fileQuit</strong></a>(...)</dt>
+<dd><code><a href="#-fileQuit">fileQuit</a>()</code>
+<p>Quitte l'application Scribus.</p></dd>
<dt><a name="-getGuiLanguage"><strong>getGuiLanguage</strong></a>(...)</dt>
<dd><code><a href="#-getGuiLanguage">getGuiLanguage</a>() -> chaîne</code>
Index: scribus/plugins/scriptplugin/cmdmisc.h
===================================================================
--- scribus/plugins/scriptplugin/cmdmisc.h (revision 14945)
+++ scribus/plugins/scriptplugin/cmdmisc.h (revision 14946)
@@ -313,6 +313,15 @@
PyObject *scribus_createlayer(PyObject * /*self*/, PyObject* args);
/*! docstring */
+PyDoc_STRVAR(scribus_filequit__doc__,
+QT_TR_NOOP("fileQuit()\n\
+\n\
+Quit Scribus.\n\
+"));
+/*! Quit Scribus */
+PyObject *scribus_filequit(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
PyDoc_STRVAR(scribus_getlanguage__doc__,
QT_TR_NOOP("getGuiLanguage() -> string\n\
\n\
@@ -341,3 +350,4 @@
#endif
+
Index: scribus/plugins/scriptplugin/cmdmisc.cpp
===================================================================
--- scribus/plugins/scriptplugin/cmdmisc.cpp (revision 14945)
+++ scribus/plugins/scriptplugin/cmdmisc.cpp (revision 14946)
@@ -745,6 +745,12 @@
Py_RETURN_NONE;
}
+PyObject *scribus_filequit(PyObject* /* self */, PyObject* args)
+{
+ QMetaObject::invokeMethod(ScCore->primaryMainWindow(), "slotFileQuit", Qt::QueuedConnection);
+ Py_RETURN_NONE;
+}
+
PyObject *scribus_getlanguage(PyObject* /* self */)
{
return PyString_FromString(ScCore->getGuiLanguage().toUtf8());
@@ -770,5 +776,18 @@
void cmdmiscdocwarnings()
{
QStringList s;
- s << scribus_setredraw__doc__ <<scribus_fontnames__doc__ << scribus_xfontnames__doc__ <<scribus_renderfont__doc__ << scribus_getlayers__doc__ << scribus_setactlayer__doc__ << scribus_getactlayer__doc__ << scribus_senttolayer__doc__ <<scribus_layervisible__doc__ <<scribus_layerprint__doc__ <<scribus_layerlock__doc__ <<scribus_layeroutline__doc__ <<scribus_layerflow__doc__ <<scribus_layerblend__doc__ <<scribus_layertrans__doc__ <<scribus_glayervisib__doc__ <<scribus_glayerprint__doc__ <<scribus_glayerlock__doc__ <<scribus_glayeroutline__doc__ <<scribus_glayerflow__doc__ <<scribus_glayerblend__doc__ <<scribus_glayertrans__doc__ <<scribus_removelayer__doc__ <<scribus_createlayer__doc__ <<scribus_getlanguage__doc__ <<scribus_moveselectiontofront__doc__<< scribus_moveselectiontoback__doc__;
+ s << scribus_setredraw__doc__ <<scribus_fontnames__doc__
+ << scribus_xfontnames__doc__ <<scribus_renderfont__doc__
+ << scribus_getlayers__doc__ << scribus_setactlayer__doc__
+ << scribus_getactlayer__doc__ << scribus_senttolayer__doc__
+ << scribus_layervisible__doc__ << scribus_layerprint__doc__
+ << scribus_layerlock__doc__ << scribus_layeroutline__doc__
+ << scribus_layerflow__doc__ << scribus_layerblend__doc__
+ << scribus_layertrans__doc__ << scribus_glayervisib__doc__
+ << scribus_glayerprint__doc__ << scribus_glayerlock__doc__
+ << scribus_glayeroutline__doc__ << scribus_glayerflow__doc__
+ << scribus_glayerblend__doc__ << scribus_glayertrans__doc__
+ << scribus_removelayer__doc__ << scribus_createlayer__doc__
+ << scribus_getlanguage__doc__ << scribus_moveselectiontofront__doc__
+ << scribus_moveselectiontoback__doc__<< scribus_filequit__doc__;
}
Index: scribus/plugins/scriptplugin/scriptplugin.cpp
===================================================================
--- scribus/plugins/scriptplugin/scriptplugin.cpp (revision 14945)
+++ scribus/plugins/scriptplugin/scriptplugin.cpp (revision 14946)
@@ -308,6 +308,7 @@
{const_cast<char*>("docChanged"), scribus_docchanged, METH_VARARGS, tr(scribus_docchanged__doc__)},
{const_cast<char*>("editMasterPage"), scribus_editmasterpage, METH_VARARGS, tr(scribus_editmasterpage__doc__)},
{const_cast<char*>("fileDialog"), (PyCFunction)scribus_filedia, METH_VARARGS|METH_KEYWORDS, tr(scribus_filedia__doc__)},
+ {const_cast<char*>("fileQuit"), scribus_filequit, METH_VARARGS, tr(scribus_filequit__doc__)},
{const_cast<char*>("getActiveLayer"), (PyCFunction)scribus_getactlayer, METH_NOARGS, tr(scribus_getactlayer__doc__)},
{const_cast<char*>("getAllObjects"), scribus_getallobj, METH_VARARGS, tr(scribus_getallobj__doc__)},
{const_cast<char*>("getAllStyles"), (PyCFunction)scribus_getstylenames, METH_NOARGS, tr(scribus_getstylenames__doc__)},
More information about the scribus-commit
mailing list