r14947 by jghali - #8966, scripter : add fileQuit() api to close scribus

scribus-commit scribus-commit at lists.scribus.net
Mon Mar 29 23:01:07 CEST 2010


Revision: 14947
Author: jghali
Date: 2010-03-29T20:56:58.672774Z
Commit message: #8966, scripter : add fileQuit() api to close scribus

Changeset: 
M  /trunk/Scribus/scribus/plugins/scriptplugin/cmdmisc.h
M  /trunk/Scribus/doc/fr/scripterapi-dialogs.html
M  /trunk/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp
M  /trunk/Scribus/doc/en/scripterapi-dialogs.html
M  /trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp

Diffs:
Index: doc/en/scripterapi-dialogs.html
===================================================================
--- doc/en/scripterapi-dialogs.html	(revision 14946)
+++ doc/en/scripterapi-dialogs.html	(revision 14947)
@@ -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() -&gt; string</code>
 <p>Returns a string with the -lang value.</p></dd>
Index: doc/fr/scripterapi-dialogs.html
===================================================================
--- doc/fr/scripterapi-dialogs.html	(revision 14946)
+++ doc/fr/scripterapi-dialogs.html	(revision 14947)
@@ -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>() -&gt; cha&icirc;ne</code>
Index: scribus/plugins/scriptplugin/cmdmisc.h
===================================================================
--- scribus/plugins/scriptplugin/cmdmisc.h	(revision 14946)
+++ scribus/plugins/scriptplugin/cmdmisc.h	(revision 14947)
@@ -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 14946)
+++ scribus/plugins/scriptplugin/cmdmisc.cpp	(revision 14947)
@@ -746,6 +746,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());
@@ -771,5 +777,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 14946)
+++ scribus/plugins/scriptplugin/scriptplugin.cpp	(revision 14947)
@@ -328,6 +328,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