r19250 by fschmid - Added a warning message box if parsing fails.

scribus-commit scribus-commit at lists.scribus.net
Wed Jun 18 08:43:42 UTC 2014


Author: fschmid
Date: Wed Jun 18 08:43:42 2014
New Revision: 19250

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19250
Log:
Added a warning message box if parsing fails.

Modified:
    trunk/Scribus/scribus/plugins/import/pub/importpub.cpp
    trunk/Scribus/scribus/plugins/import/vsd/importvsd.cpp

Modified: trunk/Scribus/scribus/plugins/import/pub/importpub.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19250&path=/trunk/Scribus/scribus/plugins/import/pub/importpub.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pub/importpub.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pub/importpub.cpp Wed Jun 18 08:43:42 2014
@@ -10,6 +10,7 @@
 #include <QDrag>
 #include <QFile>
 #include <QList>
+#include <QMessageBox>
 #include <QMimeData>
 #include <QRegExp>
 #include <QStack>
@@ -327,7 +328,6 @@
 
 bool PubPlug::convert(QString fn)
 {
-	QString tmp;
 	importedColors.clear();
 	importedPatterns.clear();
 	QFile file(fn);
@@ -350,6 +350,15 @@
 	if (!libmspub::MSPUBDocument::parse(&input, &painter))
 	{
 		qDebug() << "ERROR: Parsing failed!";
+		if (progressDialog)
+			progressDialog->close();
+		if (importerFlags & LoadSavePlugin::lfCreateDoc)
+		{
+			ScribusMainWindow* mw=(m_Doc==0) ? ScCore->primaryMainWindow() : m_Doc->scMW();
+			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+			QMessageBox::warning(mw, CommonStrings::trWarning, tr("Parsing failed!\n\nPlease submit your file (if possible) to the\nDocument Liberation Project http://www.documentliberation.org"), 1, 0, 0);
+			qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+		}
 		return false;
 	}
 	if (Elements.count() == 0)

Modified: trunk/Scribus/scribus/plugins/import/vsd/importvsd.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19250&path=/trunk/Scribus/scribus/plugins/import/vsd/importvsd.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/vsd/importvsd.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/vsd/importvsd.cpp Wed Jun 18 08:43:42 2014
@@ -10,6 +10,7 @@
 #include <QDrag>
 #include <QFile>
 #include <QList>
+#include <QMessageBox>
 #include <QMimeData>
 #include <QRegExp>
 #include <QStack>
@@ -327,7 +328,6 @@
 
 bool VsdPlug::convert(QString fn)
 {
-	QString tmp;
 	importedColors.clear();
 	importedPatterns.clear();
 	QFile file(fn);
@@ -336,8 +336,6 @@
 		qDebug() << "File " << QFile::encodeName(fn).data() << " does not exist" << endl;
 		return false;
 	}
-	QFileInfo fi = QFileInfo(fn);
-	QString ext = fi.suffix().toLower();
 #if HAVE_REVENGE
 	librevenge::RVNGFileStream input(QFile::encodeName(fn).data());
 #else
@@ -352,6 +350,15 @@
 	if (!libvisio::VisioDocument::parse(&input, &painter))
 	{
 		qDebug() << "ERROR: Parsing failed!";
+		if (progressDialog)
+			progressDialog->close();
+		if (importerFlags & LoadSavePlugin::lfCreateDoc)
+		{
+			ScribusMainWindow* mw=(m_Doc==0) ? ScCore->primaryMainWindow() : m_Doc->scMW();
+			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+			QMessageBox::warning(mw, CommonStrings::trWarning, tr("Parsing failed!\n\nPlease submit your file (if possible) to the\nDocument Liberation Project http://www.documentliberation.org"), 1, 0, 0);
+			qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+		}
 		return false;
 	}
 	if (Elements.count() == 0)




More information about the scribus-commit mailing list