r14749 by fschmid - Fixed Bug #8833: "ScriptRunning boolean flag out of sync after calling placeSVG, placeEPS etc. "

scribus-commit scribus-commit at lists.scribus.net
Wed Feb 17 14:11:32 CET 2010


Revision: 14749
Author: fschmid
Date: 2010-02-17T13:08:26.448582Z
Commit message: Fixed Bug #8833: "ScriptRunning boolean flag out of sync after calling placeSVG, placeEPS etc. "

Changeset: 
M  /trunk/Scribus/scribus/plugins/import/ai/importai.cpp
M  /trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
M  /trunk/Scribus/scribus/plugins/import/wmf/wmfimport.cpp
M  /trunk/Scribus/scribus/plugins/import/ps/importps.cpp
M  /trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
M  /trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
M  /trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
M  /trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
M  /trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp
M  /trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
M  /trunk/Scribus/scribus/plugins/import/cvg/importcvg.cpp
M  /trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp

Diffs:
Index: scribus/plugins/import/cvg/importcvg.cpp
===================================================================
--- scribus/plugins/import/cvg/importcvg.cpp	(revision 14748)
+++ scribus/plugins/import/cvg/importcvg.cpp	(revision 14749)
@@ -79,6 +79,7 @@
 	Elements.clear();
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	QString CurDirP = QDir::currentPath();
 	QDir::setCurrent(fi.path());
@@ -164,7 +165,7 @@
 			tmpImage.setText("XSize", QString("%1").arg(xs));
 			tmpImage.setText("YSize", QString("%1").arg(ys));
 		}
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		m_Doc->m_Selection->delaySignalsOff();
 		delete m_Doc;
@@ -174,7 +175,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		delete m_Doc;
 	}
 	return QImage();
@@ -276,6 +277,7 @@
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
 	m_Doc->view()->updatesOn(false);
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 	QString CurDirP = QDir::currentPath();
@@ -345,7 +347,7 @@
 			}
 		}
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 		if ((Elements.count() > 0) && (!ret) && (interactive))
@@ -405,7 +407,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->view()->updatesOn(true);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 	}
Index: scribus/plugins/import/svg/svgplugin.cpp
===================================================================
--- scribus/plugins/import/svg/svgplugin.cpp	(revision 14748)
+++ scribus/plugins/import/svg/svgplugin.cpp	(revision 14749)
@@ -258,6 +258,7 @@
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), 0);
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	gc->FontFamily = m_Doc->itemToolPrefs.textFont;
 	if (!m_Doc->PageColors.contains("Black"))
@@ -366,7 +367,7 @@
 		tmpImage.setText("YSize", QString("%1").arg(ys));
 		m_Doc->m_Selection->delaySignalsOff();
 	}
-	m_Doc->scMW()->ScriptRunning = false;
+	m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 	m_Doc->setLoading(false);
 	delete m_Doc;
 	QDir::setCurrent(CurDirP);
@@ -459,6 +460,7 @@
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
 	m_Doc->view()->updatesOn(false);
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 	gc->FontFamily = m_Doc->itemToolPrefs.textFont;
@@ -589,7 +591,7 @@
 		}
 	}
 	m_Doc->DoDrawing = true;
-	m_Doc->scMW()->ScriptRunning = false;
+	m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 	if (interactive)
 		m_Doc->setLoading(false);
 	qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
Index: scribus/plugins/import/ps/importps.cpp
===================================================================
--- scribus/plugins/import/ps/importps.cpp	(revision 14748)
+++ scribus/plugins/import/ps/importps.cpp	(revision 14749)
@@ -218,6 +218,7 @@
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
 	m_Doc->view()->updatesOn(false);
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 	QString CurDirP = QDir::currentPath();
@@ -289,7 +290,7 @@
 			}
 		}
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 		if ((Elements.count() > 0) && (!ret) && (interactive))
@@ -354,7 +355,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->view()->updatesOn(true);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 	}
Index: scribus/plugins/import/cgm/importcgm.cpp
===================================================================
--- scribus/plugins/import/cgm/importcgm.cpp	(revision 14748)
+++ scribus/plugins/import/cgm/importcgm.cpp	(revision 14749)
@@ -83,6 +83,7 @@
 	Elements.clear();
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	QString CurDirP = QDir::currentPath();
 	QDir::setCurrent(fi.path());
@@ -168,7 +169,7 @@
 			tmpImage.setText("XSize", QString("%1").arg(xs));
 			tmpImage.setText("YSize", QString("%1").arg(ys));
 		}
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		m_Doc->m_Selection->delaySignalsOff();
 		delete m_Doc;
@@ -178,7 +179,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		delete m_Doc;
 	}
 	return QImage();
@@ -277,6 +278,7 @@
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
 	m_Doc->view()->updatesOn(false);
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 	QString CurDirP = QDir::currentPath();
@@ -346,7 +348,7 @@
 			}
 		}
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 		if ((Elements.count() > 0) && (!ret) && (interactive))
@@ -406,7 +408,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->view()->updatesOn(true);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 	}
Index: scribus/plugins/import/pct/importpct.cpp
===================================================================
--- scribus/plugins/import/pct/importpct.cpp	(revision 14748)
+++ scribus/plugins/import/pct/importpct.cpp	(revision 14749)
@@ -82,6 +82,7 @@
 	Elements.clear();
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	QString CurDirP = QDir::currentPath();
 	QDir::setCurrent(fi.path());
@@ -167,7 +168,7 @@
 			tmpImage.setText("XSize", QString("%1").arg(xs));
 			tmpImage.setText("YSize", QString("%1").arg(ys));
 		}
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		m_Doc->m_Selection->delaySignalsOff();
 		delete m_Doc;
@@ -177,7 +178,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		delete m_Doc;
 	}
 	return QImage();
@@ -277,6 +278,7 @@
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
 	m_Doc->view()->updatesOn(false);
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 	QString CurDirP = QDir::currentPath();
@@ -346,7 +348,7 @@
 			}
 		}
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 		if ((Elements.count() > 0) && (!ret) && (interactive))
@@ -420,7 +422,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->view()->updatesOn(true);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 	}
Index: scribus/plugins/import/ai/importai.cpp
===================================================================
--- scribus/plugins/import/ai/importai.cpp	(revision 14748)
+++ scribus/plugins/import/ai/importai.cpp	(revision 14749)
@@ -161,6 +161,7 @@
 	Elements.clear();
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	QString CurDirP = QDir::currentPath();
 	QDir::setCurrent(fi.path());
@@ -246,7 +247,7 @@
 	}
 	else
 		tmpImage = QImage();
-	m_Doc->scMW()->ScriptRunning = false;
+	m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 	m_Doc->setLoading(false);
 	delete m_Doc;
 	QDir::setCurrent(CurDirP);
@@ -395,6 +396,7 @@
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
 	m_Doc->view()->updatesOn(false);
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 	QString CurDirP = QDir::currentPath();
@@ -487,7 +489,7 @@
 			}
 		}
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 		if ((Elements.count() > 0) && (!ret) && (interactive))
@@ -573,7 +575,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->view()->updatesOn(true);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 	}
Index: scribus/plugins/import/wmf/wmfimport.cpp
===================================================================
--- scribus/plugins/import/wmf/wmfimport.cpp	(revision 14748)
+++ scribus/plugins/import/wmf/wmfimport.cpp	(revision 14749)
@@ -349,6 +349,7 @@
 	m_Doc->setGUI(false, ScCore->primaryMainWindow(), 0);
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	m_Doc->PageColors.ensureBlackAndWhite();
 	QList<PageItem*> Elements = parseWmfCommands();
@@ -431,7 +432,7 @@
 		m_Doc->m_Selection->delaySignalsOff();
 		m_Doc->setLoading(false);
 	}
-	m_Doc->scMW()->ScriptRunning = false;
+	m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 	delete m_Doc;
 	QDir::setCurrent(CurDirP);
 	return tmpImage;
@@ -680,6 +681,7 @@
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
 	m_Doc->view()->updatesOn(false);
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
 	//gc->Family = m_Doc->toolSettings.textFont;
@@ -765,7 +767,7 @@
 		}
 	}
 	m_Doc->DoDrawing = true;
-	m_Doc->scMW()->ScriptRunning = false;
+	m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 	if (interactive)
 		m_Doc->setLoading(false);
 	qApp->setOverrideCursor(QCursor(Qt::ArrowCursor));
Index: scribus/plugins/import/xar/importxar.cpp
===================================================================
--- scribus/plugins/import/xar/importxar.cpp	(revision 14748)
+++ scribus/plugins/import/xar/importxar.cpp	(revision 14749)
@@ -235,6 +235,7 @@
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
 	m_Doc->view()->updatesOn(false);
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 	QString CurDirP = QDir::currentPath();
@@ -304,7 +305,7 @@
 			}
 		}
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 		if ((Elements.count() > 0) && (!ret) && (interactive))
@@ -380,7 +381,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->view()->updatesOn(true);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 	}
Index: scribus/plugins/import/oodraw/oodrawimp.cpp
===================================================================
--- scribus/plugins/import/oodraw/oodrawimp.cpp	(revision 14748)
+++ scribus/plugins/import/oodraw/oodrawimp.cpp	(revision 14749)
@@ -344,6 +344,7 @@
 	Elements.clear();
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	if (!m_Doc->PageColors.contains("Black"))
 		m_Doc->PageColors.insert("Black", ScColor(0, 0, 0, 255));
@@ -432,7 +433,7 @@
 		m_Doc->m_Selection->delaySignalsOff();
 		m_Doc->setLoading(false);
 	}
-	m_Doc->scMW()->ScriptRunning = false;
+	m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 	delete m_Doc;
 	QDir::setCurrent(CurDirP);
 	return tmpImage;
@@ -601,6 +602,7 @@
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
 	m_Doc->view()->updatesOn(false);
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 	if (!m_Doc->PageColors.contains("Black"))
@@ -696,7 +698,7 @@
 		}
 	}
 	m_Doc->DoDrawing = true;
-	m_Doc->scMW()->ScriptRunning = false;
+	m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 	if (interactive)
 		m_Doc->setLoading(false);
 	qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
Index: scribus/plugins/import/drw/importdrw.cpp
===================================================================
--- scribus/plugins/import/drw/importdrw.cpp	(revision 14748)
+++ scribus/plugins/import/drw/importdrw.cpp	(revision 14749)
@@ -84,6 +84,7 @@
 	Elements.clear();
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	QString CurDirP = QDir::currentPath();
 	QDir::setCurrent(fi.path());
@@ -181,7 +182,7 @@
 				tmpImage.setText("YSize", QString("%1").arg(ys));
 			}
 		}
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		m_Doc->m_Selection->delaySignalsOff();
 		delete m_Doc;
@@ -191,7 +192,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		delete m_Doc;
 	}
 	return QImage();
@@ -291,6 +292,7 @@
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
 	m_Doc->view()->updatesOn(false);
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 	QString CurDirP = QDir::currentPath();
@@ -360,7 +362,7 @@
 			}
 		}
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 		if ((Elements.count() > 0) && (!ret) && (interactive))
@@ -434,7 +436,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->view()->updatesOn(true);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 	}
Index: scribus/plugins/import/wpg/importwpg.cpp
===================================================================
--- scribus/plugins/import/wpg/importwpg.cpp	(revision 14748)
+++ scribus/plugins/import/wpg/importwpg.cpp	(revision 14749)
@@ -491,6 +491,7 @@
 	Elements.clear();
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	QString CurDirP = QDir::currentPath();
 	QDir::setCurrent(fi.path());
@@ -576,7 +577,7 @@
 			tmpImage.setText("XSize", QString("%1").arg(xs));
 			tmpImage.setText("YSize", QString("%1").arg(ys));
 		}
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		m_Doc->m_Selection->delaySignalsOff();
 		delete m_Doc;
@@ -586,7 +587,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		delete m_Doc;
 	}
 	return QImage();
@@ -685,6 +686,7 @@
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
 	m_Doc->view()->updatesOn(false);
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 	QString CurDirP = QDir::currentPath();
@@ -754,7 +756,7 @@
 			}
 		}
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 		if ((Elements.count() > 0) && (!ret) && (interactive))
@@ -814,7 +816,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->view()->updatesOn(true);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 	}
Index: scribus/plugins/import/xfig/importxfig.cpp
===================================================================
--- scribus/plugins/import/xfig/importxfig.cpp	(revision 14748)
+++ scribus/plugins/import/xfig/importxfig.cpp	(revision 14749)
@@ -146,6 +146,7 @@
 	CustColors.insert("Gold", ScColor(255, 215, 0));
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	QString CurDirP = QDir::currentPath();
 	QDir::setCurrent(fi.path());
@@ -231,7 +232,7 @@
 			tmpImage.setText("XSize", QString("%1").arg(xs));
 			tmpImage.setText("YSize", QString("%1").arg(ys));
 		}
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		m_Doc->m_Selection->delaySignalsOff();
 		delete m_Doc;
@@ -241,7 +242,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		delete m_Doc;
 	}
 	return QImage();
@@ -412,6 +413,7 @@
 	m_Doc->setLoading(true);
 	m_Doc->DoDrawing = false;
 	m_Doc->view()->updatesOn(false);
+	bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
 	m_Doc->scMW()->ScriptRunning = true;
 	qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 	QString CurDirP = QDir::currentPath();
@@ -481,7 +483,7 @@
 			}
 		}
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->setLoading(false);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 		if ((Elements.count() > 0) && (!ret) && (interactive))
@@ -546,7 +548,7 @@
 	{
 		QDir::setCurrent(CurDirP);
 		m_Doc->DoDrawing = true;
-		m_Doc->scMW()->ScriptRunning = false;
+		m_Doc->scMW()->ScriptRunning = wasScriptRunning;
 		m_Doc->view()->updatesOn(true);
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 	}




More information about the scribus-commit mailing list