r25098 by jghali - #16801: Scripter's linkTextFrames() documentation vs GUI

scribus-commit scribus-commit at lists.scribus.net
Sun Jun 5 17:22:41 UTC 2022


Author: jghali
Date: Sun Jun  5 17:22:41 2022
New Revision: 25098

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=25098
Log:
#16801: Scripter's linkTextFrames() documentation vs GUI

Modified:
    trunk/Scribus/doc/de/scripterapi-textframes.html
    trunk/Scribus/doc/en/scripterapi-textframes.html
    trunk/Scribus/doc/fr/scripterapi-textframes.html
    trunk/Scribus/doc/it/scripterapi-textframes.html
    trunk/Scribus/doc/ru/scripterapi-textframes.html
    trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.h

Modified: trunk/Scribus/doc/de/scripterapi-textframes.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25098&path=/trunk/Scribus/doc/de/scripterapi-textframes.html
==============================================================================
--- trunk/Scribus/doc/de/scripterapi-textframes.html	(original)
+++ trunk/Scribus/doc/de/scripterapi-textframes.html	Sun Jun  5 17:22:41 2022
@@ -33,7 +33,7 @@
 <p>Gets the number of columns of the text frame "name". If "name" is not given the currently selected item is used.</p></dd>
 
 <dt><a name="-getFirstLineOffset"><strong>getFirstLineOffset</strong></a>(...)</dt>
-<dd><code>getFirstLineOffset(["name"]) -> string</code>
+<dd><code>getFirstLineOffset(["name"]) -> integer</code>
 <p>Gets the offset of the first line of text inside text frame "name". If "name" is not given the currently selected item is used.</p></dd>
 
 <dt><a name="-getFirstLinkedFrame"><strong>getFirstLinkedFrame</strong></a>(...)</dt>
@@ -134,7 +134,7 @@
 
 <dt><a name="-linkTextFrames"><strong>linkTextFrames</strong></a>(...)</dt>
 <dd><code>linkTextFrames("fromname", "toname")</code>
-<p>Link two text frames. The frame named "fromname" is linked to the frame named "toname". The target frame must be an empty text frame and must not link to or be linked from any other frames already.</p>
+<p>Link two text frames. The frame named "fromname" is linked to the frame named "toname". The source frame must not already link to another frame. The target frame must not be linked from another frame.</p>
 <p>May throw <a href="#ScribusException">ScribusException</a> if linking rules are violated.</p></dd>
 
 <dt><a name="-selectFrameText"><strong>selectFrameText</strong></a>(...)</dt>

Modified: trunk/Scribus/doc/en/scripterapi-textframes.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25098&path=/trunk/Scribus/doc/en/scripterapi-textframes.html
==============================================================================
--- trunk/Scribus/doc/en/scripterapi-textframes.html	(original)
+++ trunk/Scribus/doc/en/scripterapi-textframes.html	Sun Jun  5 17:22:41 2022
@@ -134,7 +134,7 @@
 
 <dt><a name="-linkTextFrames"><strong>linkTextFrames</strong></a>(...)</dt>
 <dd><code>linkTextFrames("fromname", "toname")</code>
-<p>Link two text frames. The frame named "fromname" is linked to the frame named "toname". The target frame must be an empty text frame and must not link to or be linked from any other frames already.</p>
+<p>Link two text frames. The frame named "fromname" is linked to the frame named "toname". The source frame must not already link to another frame. The target frame must not be linked from another frame.</p>
 <p>May throw <a href="#ScribusException">ScribusException</a> if linking rules are violated.</p></dd>
 
 <dt><a name="-selectFrameText"><strong>selectFrameText</strong></a>(...)</dt>

Modified: trunk/Scribus/doc/fr/scripterapi-textframes.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25098&path=/trunk/Scribus/doc/fr/scripterapi-textframes.html
==============================================================================
--- trunk/Scribus/doc/fr/scripterapi-textframes.html	(original)
+++ trunk/Scribus/doc/fr/scripterapi-textframes.html	Sun Jun  5 17:22:41 2022
@@ -111,7 +111,7 @@
 
 <dt><a name="-linkTextFrames"><strong>linkTextFrames</strong></a>(...)</dt>
 <dd><code>linkTextFrames("nomDepart", "nomArrivee")</code>
-<p>Établit un lien entre deux cadres de texte. Le cadre nommé "nomDepart" est lié au cadre "nomArrivee". Le cadre cible doit être un cadre de texte vide et ne doit pas pointer vers d'autres cadres ni porter un lien provenant d'autres cadres.</p>
+<p>Établit un lien entre deux cadres de texte. Le cadre nommé "nomDepart" est lié au cadre "nomArrivee". Le cadre source ne doit pas déja porter un lien vers un cadre de texte suivant. Le cadre cible ne doit pas porter de lien provenant d'autres cadres.</p>
 <p>Peut générer <a href="#ScribusException">ScribusException</a> en cas d'infraction des règles de liens.</p></dd>
 
 

Modified: trunk/Scribus/doc/it/scripterapi-textframes.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25098&path=/trunk/Scribus/doc/it/scripterapi-textframes.html
==============================================================================
--- trunk/Scribus/doc/it/scripterapi-textframes.html	(original)
+++ trunk/Scribus/doc/it/scripterapi-textframes.html	Sun Jun  5 17:22:41 2022
@@ -33,7 +33,7 @@
 <p>Gets the number of columns of the text frame "name". If "name" is not given the currently selected item is used.</p></dd>
 
 <dt><a name="-getFirstLineOffset"><strong>getFirstLineOffset</strong></a>(...)</dt>
-<dd><code>getFirstLineOffset(["name"]) -> string</code>
+<dd><code>getFirstLineOffset(["name"]) -> integer</code>
 <p>Gets the offset of the first line of text inside text frame "name". If "name" is not given the currently selected item is used.</p></dd>
 
 <dt><a name="-getFirstLinkedFrame"><strong>getFirstLinkedFrame</strong></a>(...)</dt>
@@ -134,7 +134,7 @@
 
 <dt><a name="-linkTextFrames"><strong>linkTextFrames</strong></a>(...)</dt>
 <dd><code>linkTextFrames("fromname", "toname")</code>
-<p>Link two text frames. The frame named "fromname" is linked to the frame named "toname". The target frame must be an empty text frame and must not link to or be linked from any other frames already.</p>
+<p>Link two text frames. The frame named "fromname" is linked to the frame named "toname". The source frame must not already link to another frame. The target frame must not be linked from another frame.</p>
 <p>May throw <a href="#ScribusException">ScribusException</a> if linking rules are violated.</p></dd>
 
 <dt><a name="-selectFrameText"><strong>selectFrameText</strong></a>(...)</dt>

Modified: trunk/Scribus/doc/ru/scripterapi-textframes.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25098&path=/trunk/Scribus/doc/ru/scripterapi-textframes.html
==============================================================================
--- trunk/Scribus/doc/ru/scripterapi-textframes.html	(original)
+++ trunk/Scribus/doc/ru/scripterapi-textframes.html	Sun Jun  5 17:22:41 2022
@@ -33,7 +33,7 @@
 <p>Gets the number of columns of the text frame "name". If "name" is not given the currently selected item is used.</p></dd>
 
 <dt><a name="-getFirstLineOffset"><strong>getFirstLineOffset</strong></a>(...)</dt>
-<dd><code>getFirstLineOffset(["name"]) -> string</code>
+<dd><code>getFirstLineOffset(["name"]) -> integer</code>
 <p>Gets the offset of the first line of text inside text frame "name". If "name" is not given the currently selected item is used.</p></dd>
 
 <dt><a name="-getFirstLinkedFrame"><strong>getFirstLinkedFrame</strong></a>(...)</dt>
@@ -134,7 +134,7 @@
 
 <dt><a name="-linkTextFrames"><strong>linkTextFrames</strong></a>(...)</dt>
 <dd><code>linkTextFrames("fromname", "toname")</code>
-<p>Link two text frames. The frame named "fromname" is linked to the frame named "toname". The target frame must be an empty text frame and must not link to or be linked from any other frames already.</p>
+<p>Link two text frames. The frame named "fromname" is linked to the frame named "toname". The source frame must not already link to another frame. The target frame must not be linked from another frame.</p>
 <p>May throw <a href="#ScribusException">ScribusException</a> if linking rules are violated.</p></dd>
 
 <dt><a name="-selectFrameText"><strong>selectFrameText</strong></a>(...)</dt>

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25098&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp	Sun Jun  5 17:22:41 2022
@@ -1294,27 +1294,22 @@
 		return nullptr;
 	if (!(fromitem->isTextFrame()) || !(toitem->isTextFrame()))
 	{
-		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can only link text frames.","python error").toLocal8Bit().constData());
-		return nullptr;
-	}
-/*	if (toitem->itemText.length() > 0)
-	{
-		PyErr_SetString(ScribusException, QObject::tr("Target frame must be empty.","python error").toLocal8Bit().constData());
-		return nullptr;
-	}*/
-	if (toitem->nextInChain() != nullptr)
-	{
-		PyErr_SetString(ScribusException, QObject::tr("Target frame links to another frame.","python error").toLocal8Bit().constData());
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can only link text frames.", "python error").toLocal8Bit().constData());
+		return nullptr;
+	}
+	if (fromitem->nextInChain() != nullptr)
+	{
+		PyErr_SetString(ScribusException, QObject::tr("Source frame is linked to another frame.", "python error").toLocal8Bit().constData());
 		return nullptr;
 	}
 	if (toitem->prevInChain() != nullptr)
 	{
-		PyErr_SetString(ScribusException, QObject::tr("Target frame is linked to by another frame.","python error").toLocal8Bit().constData());
+		PyErr_SetString(ScribusException, QObject::tr("Target frame is linked to by another frame.", "python error").toLocal8Bit().constData());
 		return nullptr;
 	}
 	if (toitem == fromitem)
 	{
-		PyErr_SetString(ScribusException, QObject::tr("Source and target are the same object.","python error").toLocal8Bit().constData());
+		PyErr_SetString(ScribusException, QObject::tr("Source and target are the same object.", "python error").toLocal8Bit().constData());
 		return nullptr;
 	}
 	// references to the others boxes

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25098&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.h	Sun Jun  5 17:22:41 2022
@@ -570,8 +570,8 @@
 QT_TR_NOOP("linkTextFrames(\"fromname\", \"toname\")\n\
 \n\
 Link two text frames. The frame named \"fromname\" is linked to the\n\
-frame named \"toname\". The target frame must be an empty text frame\n\
-and must not link to or be linked from any other frames already.\n\
+frame named \"toname\". The source frame must not already link to another\n\
+frame. The target frame must not be linked from another frame.\n\
 \n\
 May throw ScribusException if linking rules are violated.\n\
 "));




More information about the scribus-commit mailing list