r23845 by jghali - Add output preview for PostScript language

scribus-commit scribus-commit at lists.scribus.net
Thu May 28 01:09:48 UTC 2020


Author: jghali
Date: Thu May 28 01:09:48 2020
New Revision: 23845

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23845
Log:
Add output preview for PostScript language

For Windows users, it was previously not always easy to get to PostScript output preview as Windows GDI is the most common printing method on this platform. The print preview hence most commonly uses Windows GDI based code, requiring user to pass by print dialog to access PostScript preview. Also coming changes related to printing code should in the end make use of PostScript language less frequent in print preview also on other platforms. A more direct way to access Postscript output preview is hence also needed on these other platforms.

Added:
    trunk/Scribus/scribus/ui/outputpreview_ps.cpp
    trunk/Scribus/scribus/ui/outputpreview_ps.h
    trunk/Scribus/scribus/ui/outputpreview_ps.ui
Modified:
    trunk/Scribus/Scribus.pro
    trunk/Scribus/scribus/actionmanager.cpp
    trunk/Scribus/scribus/appmodehelper.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/prefsstructs.h
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/scribusstructs.h
    trunk/Scribus/scribus/ui/checkDocument.cpp
    trunk/Scribus/scribus/ui/checkDocument.h
    trunk/Scribus/scribus/ui/printdialog.cpp
    trunk/Scribus/scribus/ui/printdialog.h
    trunk/Scribus/scribus/ui/printpreview.cpp
    trunk/Scribus/scribus/util_printer.cpp
    trunk/Scribus/scribus/util_printer.h
    trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj
    trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters
    trunk/Scribus/win32/msvc2017/scribus-main/Scribus.vcxproj
    trunk/Scribus/win32/msvc2017/scribus-main/Scribus.vcxproj.filters

Modified: trunk/Scribus/Scribus.pro
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/Scribus.pro
==============================================================================
--- trunk/Scribus/Scribus.pro	(original)
+++ trunk/Scribus/Scribus.pro	Thu May 28 01:09:48 2020
@@ -503,6 +503,7 @@
            scribus/ui/osgeditor.h \
            scribus/ui/outlinepalette.h \
            scribus/ui/outputpreview_pdf.h \
+           scribus/ui/outputpreview_ps.h \
            scribus/ui/outputpreviewbase.h \
            scribus/ui/pageitemattributes.h \
            scribus/ui/pageitempositionsetter.h \
@@ -1068,6 +1069,7 @@
          scribus/ui/notesstyleseditor.ui \
          scribus/ui/osgeditor.ui \
          scribus/ui/outputpreview_pdf.ui \
+         scribus/ui/outputpreview_ps.ui \
          scribus/ui/outputpreviewbase.ui \
          scribus/ui/pageitemattributes.ui \
          scribus/ui/pagepalette_masterpagesbase.ui \
@@ -1635,6 +1637,7 @@
            scribus/ui/osgeditor.cpp \
            scribus/ui/outlinepalette.cpp \
            scribus/ui/outputpreview_pdf.cpp \
+           scribus/ui/outputpreview_ps.cpp \
            scribus/ui/outputpreviewbase.cpp \
            scribus/ui/pageitemattributes.cpp \
            scribus/ui/pageitempositionsetter.cpp \

Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp	(original)
+++ trunk/Scribus/scribus/actionmanager.cpp	Thu May 28 01:09:48 2020
@@ -166,6 +166,8 @@
 	scrActions->insert(name, new ScrAction("16/document-print-preview.png", "22/document-print-preview.png", "", defaultKey(name), mainWindow));
 	name = "OutputPreviewPDF";
 	scrActions->insert(name, new ScrAction(QString(), defaultKey(name), mainWindow));
+	name = "OutputPreviewPS";
+	scrActions->insert(name, new ScrAction(QString(), defaultKey(name), mainWindow));
 	name = "fileQuit";
 	scrActions->insert(name, new ScrAction("exit.png", QString(), "", defaultKey(name), mainWindow));
 	(*scrActions)[name]->setMenuRole(QAction::QuitRole);
@@ -179,6 +181,7 @@
 	connect( (*scrActions)["filePrint"], SIGNAL(triggered()), mainWindow, SLOT(slotFilePrint()) );
 	connect( (*scrActions)["PrintPreview"], SIGNAL(triggered()), mainWindow, SLOT(printPreview()) );
 	connect( (*scrActions)["OutputPreviewPDF"], SIGNAL(triggered()), mainWindow, SLOT(outputPreviewPDF()) );
+	connect( (*scrActions)["OutputPreviewPS"], SIGNAL(triggered()), mainWindow, SLOT(outputPreviewPS()) );
 	connect( (*scrActions)["fileSave"], SIGNAL(triggered()), mainWindow, SLOT(slotFileSave()) );
 	connect( (*scrActions)["fileSaveAs"], SIGNAL(triggered()), mainWindow, SLOT(slotFileSaveAs()) );
 	connect( (*scrActions)["fileDocSetup150"], SIGNAL(triggered()), mainWindow, SLOT(slotDocSetup()) );
@@ -1508,6 +1511,7 @@
 	(*scrActions)["filePrint"]->setTexts( tr("&Print..."));
 	(*scrActions)["PrintPreview"]->setTexts( tr("Print Previe&w..."));
 	(*scrActions)["OutputPreviewPDF"]->setTexts( tr("PDF..."));
+	(*scrActions)["OutputPreviewPS"]->setTexts( tr("PostScript..."));
 	(*scrActions)["fileQuit"]->setTexts( tr("&Quit"));
 	//Edit Menu
 	(*scrActions)["editUndoAction"]->setTexts( tr("&Undo"));
@@ -2082,6 +2086,7 @@
 		<< "filePrint"
 		<< "PrintPreview"
 		<< "OutputPreviewPDF"
+		<< "OutputPreviewPS"
 		<< "fileQuit";
 	++itmenu;
 	//Edit

Modified: trunk/Scribus/scribus/appmodehelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/appmodehelper.cpp
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.cpp	(original)
+++ trunk/Scribus/scribus/appmodehelper.cpp	Thu May 28 01:09:48 2020
@@ -1170,7 +1170,10 @@
 	if (ScCore->haveGS() || ScCore->isWinGUI())
 		(*a_scrActions)["PrintPreview"]->setEnabled(b2);
 	if (ScCore->haveGS())
+	{
 		(*a_scrActions)["OutputPreviewPDF"]->setEnabled(b2);
+		(*a_scrActions)["OutputPreviewPS"]->setEnabled(b2);
+	}
 	(*a_scrActions)["toolsPDFPushButton"]->setEnabled(b2);
 	(*a_scrActions)["toolsPDFRadioButton"]->setEnabled(b2);
 	(*a_scrActions)["toolsPDFTextField"]->setEnabled(b2);
@@ -1204,7 +1207,10 @@
 		if (ScCore->haveGS() || ScCore->isWinGUI())
 			(*a_scrActions)["PrintPreview"]->setEnabled(true);
 		if (ScCore->haveGS())
+		{
 			(*a_scrActions)["OutputPreviewPDF"]->setEnabled(true);
+			(*a_scrActions)["OutputPreviewPS"]->setEnabled(true);
+		}
 		bool setter = doc->DocPages.count() > 1;
 		(*a_scrActions)["pageDelete"]->setEnabled(setter);
 		(*a_scrActions)["pageMove"]->setEnabled(setter);
@@ -1219,7 +1225,10 @@
 	if (ScCore->haveGS() || ScCore->isWinGUI())
 		(*a_scrActions)["PrintPreview"]->setEnabled(b2);
 	if (ScCore->haveGS())
+	{
 		(*a_scrActions)["OutputPreviewPDF"]->setEnabled(b2);
+		(*a_scrActions)["OutputPreviewPS"]->setEnabled(b2);
+	}
 	(*a_scrActions)["toolsPDFPushButton"]->setEnabled(b2);
 	(*a_scrActions)["toolsPDFRadioButton"]->setEnabled(b2);
 	(*a_scrActions)["toolsPDFTextField"]->setEnabled(b2);
@@ -1256,7 +1265,10 @@
 		if (ScCore->haveGS() || ScCore->isWinGUI())
 			(*a_scrActions)["PrintPreview"]->setEnabled(true);
 		if (ScCore->haveGS())
+		{
 			(*a_scrActions)["OutputPreviewPDF"]->setEnabled(true);
+			(*a_scrActions)["OutputPreviewPS"]->setEnabled(true);
+		}
 		bool setter = doc->DocPages.count() > 1;
 		(*a_scrActions)["pageDelete"]->setEnabled(setter);
 		(*a_scrActions)["pageMove"]->setEnabled(setter);
@@ -1268,7 +1280,10 @@
 	if (ScCore->haveGS() || ScCore->isWinGUI())
 		(*a_scrActions)["PrintPreview"]->setEnabled(b2);
 	if (ScCore->haveGS())
+	{
 		(*a_scrActions)["OutputPreviewPDF"]->setEnabled(b2);
+		(*a_scrActions)["OutputPreviewPS"]->setEnabled(b2);
+	}
 	(*a_scrActions)["toolsPDFPushButton"]->setEnabled(b2);
 	(*a_scrActions)["toolsPDFRadioButton"]->setEnabled(b2);
 	(*a_scrActions)["toolsPDFTextField"]->setEnabled(b2);
@@ -1391,7 +1406,10 @@
 	if (ScCore->haveGS() || ScCore->isWinGUI())
 		(*a_scrActions)["PrintPreview"]->setEnabled(true);
 	if (ScCore->haveGS())
+	{
 		(*a_scrActions)["OutputPreviewPDF"]->setEnabled(true);
+		(*a_scrActions)["OutputPreviewPS"]->setEnabled(true);
+	}
 
 	if ((*a_scrActions)["SaveAsDocumentTemplate"])
 		(*a_scrActions)["SaveAsDocumentTemplate"]->setEnabled(true);
@@ -1552,7 +1570,10 @@
 	if ( ScCore->haveGS() || ScCore->isWinGUI() )
 		(*a_scrActions)["PrintPreview"]->setEnabled(false);
 	if (ScCore->haveGS())
+	{
 		(*a_scrActions)["OutputPreviewPDF"]->setEnabled(false);
+		(*a_scrActions)["OutputPreviewPS"]->setEnabled(false);
+	}
 	if ((*a_scrActions)["SaveAsDocumentTemplate"])
 		(*a_scrActions)["SaveAsDocumentTemplate"]->setEnabled(false);
 	(*a_scrActions)["editClearContents"]->setEnabled(false);
@@ -1736,6 +1757,7 @@
 	(*a_scrActions)["fileClose"]->setEnabled(false);
 	(*a_scrActions)["PrintPreview"]->setEnabled(false);
 	(*a_scrActions)["OutputPreviewPDF"]->setEnabled(false);
+	(*a_scrActions)["OutputPreviewPS"]->setEnabled(false);
 	if ((*a_scrActions)["SaveAsDocumentTemplate"])
 		(*a_scrActions)["SaveAsDocumentTemplate"]->setEnabled(false);
 	(*a_scrActions)["fileExportAsPDF"]->setEnabled(false);

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp	Thu May 28 01:09:48 2020
@@ -8,6 +8,15 @@
 #include "scribus134formatimpl.h"
 
 #include <algorithm>
+
+#include <QApplication>
+#include <QByteArray>
+#include <QCursor>
+// #include <QDebug>
+#include <QFileInfo>
+#include <QIODevice>
+#include <QList>
+#include <QScopedPointer>
 
 #include "../../formatidlist.h"
 #include "commonstrings.h"
@@ -25,24 +34,15 @@
 #include "scpattern.h"
 #include "scribuscore.h"
 #include "scribusdoc.h"
-
 #include "sctextstream.h"
 #include "scxmlstreamreader.h"
 #include "undomanager.h"
 #include "units.h"
 #include "util.h"
-#include "util_math.h"
 #include "util_color.h"
 #include "util_layer.h"
-
-#include <QApplication>
-#include <QByteArray>
-#include <QCursor>
-// #include <QDebug>
-#include <QFileInfo>
-#include <QIODevice>
-#include <QList>
-#include <QScopedPointer>
+#include "util_math.h"
+#include "util_printer.h"
 
 // See scplugin.h and pluginmanager.{cpp,h} for detail on what these methods
 // do. That documentatation is not duplicated here.
@@ -1691,6 +1691,15 @@
 {
 	ScXmlStreamAttributes attrs = reader.scAttributes();
 	doc->Print_Options.firstUse = attrs.valueAsBool("firstUse");
+	if (doc->Print_Options.firstUse)
+	{
+		// Formerly we were writing uninitialized structure values in documents
+		// so set these uninitialized values to something more meaningful
+		PrinterUtil::getDefaultPrintOptions(doc->Print_Options, doc->bleedsVal());
+		reader.readToElementEnd();
+		return !reader.hasError();
+	}
+
 	doc->Print_Options.toFile   = attrs.valueAsBool("toFile");
 	doc->Print_Options.useAltPrintCommand = attrs.valueAsBool("useAltPrintCommand");
 	doc->Print_Options.outputSeparations  = attrs.valueAsBool("outputSeparations");

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp	Thu May 28 01:09:48 2020
@@ -326,7 +326,7 @@
 			m_Doc->cmsSettings().DefaultSolidColorCMYKProfile = dc.attribute("DPPr","");
 		m_Doc->cmsSettings().DefaultIntentColors = (eRenderIntent) dc.attribute("DISc", "1").toInt();
 		m_Doc->cmsSettings().DefaultIntentImages = (eRenderIntent) dc.attribute("DIIm", "0").toInt();
-		layerToSetActive=dc.attribute("ALAYER", "0").toInt();
+		layerToSetActive = dc.attribute("ALAYER", "0").toInt();
 		//m_Doc->setHyphLanguage(dc.attribute("LANGUAGE", ""));
 		static const QString LANGUAGE("LANGUAGE");
 		QString l(dc.attribute(LANGUAGE, "en"));

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	Thu May 28 01:09:48 2020
@@ -9,15 +9,30 @@
 
 #include <algorithm>
 
+#include <QApplication>
+#include <QByteArray>
+#include <QCursor>
+// #include <QDebug>
+#include <QFileInfo>
+#include <QList>
+#include <QScopedPointer>
+
 #include "../../formatidlist.h"
 #include "commonstrings.h"
-#include "ui/missing.h"
 #include "hyphenator.h"
 #include "langmgr.h"
 #include "notesstyles.h"
+#include "pageitem_arc.h"
 #include "pageitem_latexframe.h"
+#include "pageitem_noteframe.h"
+#ifdef HAVE_OSG
+	#include "pageitem_osgframe.h"
+#endif
+#include "pageitem_regularpolygon.h"
+#include "pageitem_spiral.h"
+#include "pageitem_table.h"
+#include "pagestructs.h"
 #include "pageitem_line.h"
-#include "pageitem_noteframe.h"
 #include "pagesize.h"
 #include "prefsmanager.h"
 #include "qtiocompressor.h"
@@ -27,31 +42,16 @@
 #include "scpattern.h"
 #include "scribuscore.h"
 #include "scribusdoc.h"
-
 #include "sctextstream.h"
 #include "scxmlstreamreader.h"
 #include "undomanager.h"
+#include "ui/missing.h"
 #include "units.h"
 #include "util.h"
+#include "util_color.h"
 #include "util_math.h"
-#include "util_color.h"
+#include "util_printer.h"
 #include "util_text.h"
-#ifdef HAVE_OSG
-	#include "pageitem_osgframe.h"
-#endif
-#include "pageitem_table.h"
-#include "pageitem_regularpolygon.h"
-#include "pageitem_arc.h"
-#include "pageitem_spiral.h"
-#include "pagestructs.h"
-
-#include <QApplication>
-#include <QByteArray>
-#include <QCursor>
-// #include <QDebug>
-#include <QFileInfo>
-#include <QList>
-#include <QScopedPointer>
 
 // See scplugin.h and pluginmanager.{cpp,h} for detail on what these methods
 // do. That documentatation is not duplicated here.
@@ -3397,6 +3397,15 @@
 {
 	ScXmlStreamAttributes attrs = reader.scAttributes();
 	doc->Print_Options.firstUse = attrs.valueAsBool("firstUse");
+	if (doc->Print_Options.firstUse)
+	{
+		// Formerly we were writing uninitialized structure values in documents
+		// so set these uninitialized values to something more meaningful
+		PrinterUtil::getDefaultPrintOptions(doc->Print_Options, doc->bleedsVal());
+		reader.readToElementEnd();
+		return !reader.hasError();
+	}
+
 	doc->Print_Options.toFile   = attrs.valueAsBool("toFile");
 	doc->Print_Options.useAltPrintCommand = attrs.valueAsBool("useAltPrintCommand");
 	doc->Print_Options.outputSeparations  = attrs.valueAsBool("outputSeparations");

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp	(original)
+++ trunk/Scribus/scribus/prefsmanager.cpp	Thu May 28 01:09:48 2020
@@ -365,6 +365,17 @@
 	appPrefs.pdfOutputPreviewPrefs.isBlackVisible = true;
 	appPrefs.pdfOutputPreviewPrefs.displayInkCoverage = false;
 	appPrefs.pdfOutputPreviewPrefs.inkCoverageThreshold = 250;
+
+	appPrefs.psOutputPreviewPrefs.psLevel = 3;
+	appPrefs.psOutputPreviewPrefs.enableAntiAliasing = true;
+	appPrefs.psOutputPreviewPrefs.showTransparency = false;
+	appPrefs.psOutputPreviewPrefs.cmykPreviewMode = false ;
+	appPrefs.psOutputPreviewPrefs.isCyanVisible = true;
+	appPrefs.psOutputPreviewPrefs.isMagentaVisible = true;
+	appPrefs.psOutputPreviewPrefs.isYellowVisible = true;
+	appPrefs.psOutputPreviewPrefs.isBlackVisible = true;
+	appPrefs.psOutputPreviewPrefs.displayInkCoverage = false;
+	appPrefs.psOutputPreviewPrefs.inkCoverageThreshold = 250;
 
 	appPrefs.extToolPrefs.imageEditorExecutable = ScPaths::defaultImageEditorApp();
 	appPrefs.extToolPrefs.extBrowserExecutable = "";
@@ -1745,6 +1756,19 @@
 	dcPdfOutputPrev.setAttribute("InkThreshold", appPrefs.pdfOutputPreviewPrefs.inkCoverageThreshold);
 	elem.appendChild(dcPdfOutputPrev);
 
+	QDomElement dcPSOutputPrev = docu.createElement("PSOutputPreview");
+	dcPSOutputPrev.setAttribute("PSLevel", static_cast<int>(appPrefs.psOutputPreviewPrefs.psLevel));
+	dcPSOutputPrev.setAttribute("AntiAliasing", static_cast<int>(appPrefs.psOutputPreviewPrefs.enableAntiAliasing));
+	dcPSOutputPrev.setAttribute("Transparency", static_cast<int>(appPrefs.psOutputPreviewPrefs.showTransparency));
+	dcPSOutputPrev.setAttribute("CMYKMode", static_cast<int>(appPrefs.psOutputPreviewPrefs.cmykPreviewMode));
+	dcPSOutputPrev.setAttribute("Cyan", static_cast<int>(appPrefs.psOutputPreviewPrefs.isCyanVisible));
+	dcPSOutputPrev.setAttribute("Magenta", static_cast<int>(appPrefs.psOutputPreviewPrefs.isMagentaVisible));
+	dcPSOutputPrev.setAttribute("Yellow", static_cast<int>(appPrefs.psOutputPreviewPrefs.isYellowVisible));
+	dcPSOutputPrev.setAttribute("Black", static_cast<int>(appPrefs.psOutputPreviewPrefs.isBlackVisible));
+	dcPSOutputPrev.setAttribute("InkCoverage", static_cast<int>(appPrefs.psOutputPreviewPrefs.displayInkCoverage));
+	dcPSOutputPrev.setAttribute("InkThreshold", appPrefs.psOutputPreviewPrefs.inkCoverageThreshold);
+	elem.appendChild(dcPSOutputPrev);
+
 	QDomElement dcExternalTools = docu.createElement("ExternalTools");
 	dcExternalTools.setAttribute("ImageEditor", imageEditorExecutable());
 	dcExternalTools.setAttribute("Ghostscript", ghostscriptExecutable());
@@ -2461,6 +2485,19 @@
 			appPrefs.pdfOutputPreviewPrefs.displayInkCoverage = static_cast<bool>(dc.attribute("InkCoverage", "0").toInt());
 			appPrefs.pdfOutputPreviewPrefs.inkCoverageThreshold = dc.attribute("InkThreshold", "250").toInt();
 		}
+		if (dc.tagName() == "PSOutputPreview")
+		{
+			appPrefs.psOutputPreviewPrefs.psLevel = qMax(1, qMin(dc.attribute("PSLevel", "3").toInt(), 3));
+			appPrefs.psOutputPreviewPrefs.enableAntiAliasing = static_cast<bool>(dc.attribute("AntiAliasing", "1").toInt());
+			appPrefs.psOutputPreviewPrefs.showTransparency = static_cast<bool>(dc.attribute("Transparency", "0").toInt());
+			appPrefs.psOutputPreviewPrefs.cmykPreviewMode = static_cast<bool>(dc.attribute("CMYKMode", "0").toInt());
+			appPrefs.psOutputPreviewPrefs.isCyanVisible = static_cast<bool>(dc.attribute("Cyan", "1").toInt());
+			appPrefs.psOutputPreviewPrefs.isMagentaVisible = static_cast<bool>(dc.attribute("Magenta", "1").toInt());
+			appPrefs.psOutputPreviewPrefs.isYellowVisible = static_cast<bool>(dc.attribute("Yellow", "1").toInt());
+			appPrefs.psOutputPreviewPrefs.isBlackVisible = static_cast<bool>(dc.attribute("Black", "1").toInt());
+			appPrefs.psOutputPreviewPrefs.displayInkCoverage = static_cast<bool>(dc.attribute("InkCoverage", "0").toInt());
+			appPrefs.psOutputPreviewPrefs.inkCoverageThreshold = dc.attribute("InkThreshold", "250").toInt();
+		}
 		if (dc.tagName()=="ExternalTools")
 		{
 			bool gsa1 = testGSAvailability(dc.attribute("Ghostscript", "gs"));

Modified: trunk/Scribus/scribus/prefsstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/prefsstructs.h
==============================================================================
--- trunk/Scribus/scribus/prefsstructs.h	(original)
+++ trunk/Scribus/scribus/prefsstructs.h	Thu May 28 01:09:48 2020
@@ -430,6 +430,20 @@
 	int  inkCoverageThreshold { 250 };
 };
 
+struct PSOutputPreviewPrefs
+{
+	int  psLevel { 3 };
+	bool enableAntiAliasing { true };
+	bool showTransparency { false };
+	bool cmykPreviewMode { false };
+	bool isCyanVisible { true };
+	bool isMagentaVisible { true };
+	bool isYellowVisible { true };
+	bool isBlackVisible { true };
+	bool displayInkCoverage { false };
+	int  inkCoverageThreshold { 250 };
+};
+
 struct PluginPrefs
 {
 };
@@ -472,6 +486,7 @@
 	PrinterPrefs printerPrefs;
 	PrintPreviewPrefs printPreviewPrefs;
 	PDFOutputPreviewPrefs pdfOutputPreviewPrefs;
+	PSOutputPreviewPrefs  psOutputPreviewPrefs;
 	ScrapbookPrefs scrapbookPrefs;
 	ScripterPrefs scripterPrefs;
 	ShortWordPrefs shortwordPrefs;

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Thu May 28 01:09:48 2020
@@ -213,6 +213,7 @@
 #include "ui/notesstyleseditor.h"
 #include "ui/outlinepalette.h"
 #include "ui/outputpreview_pdf.h"
+#include "ui/outputpreview_ps.h"
 #include "ui/pageitemattributes.h"
 #include "ui/pagelayout.h"
 #include "ui/pagepalette.h"
@@ -910,6 +911,7 @@
 		scrMenuMgr->addMenuItemString("FileOutputPreview", "File");
 		scrMenuMgr->createMenu("FileOutputPreview", tr("&Output Preview"), "File");
 		scrMenuMgr->addMenuItemString("OutputPreviewPDF", "FileOutputPreview");
+		scrMenuMgr->addMenuItemString("OutputPreviewPS", "FileOutputPreview");
 		scrMenuMgr->addMenuItemString("SEPARATOR", "File");
 	}
 	scrMenuMgr->addMenuItemString("fileQuit", "File");
@@ -4526,10 +4528,8 @@
 		}
 	}
 	doc->Print_Options.copies = 1;
-	ColorList usedSpots;
-	doc->getUsedColors(usedSpots, true);
-	QStringList spots = usedSpots.keys();
-	PrintDialog *printer = new PrintDialog(this, doc, doc->Print_Options, m_prefsManager.appPrefs.printerPrefs.GCRMode, spots);
+
+	PrintDialog *printer = new PrintDialog(this, doc, doc->Print_Options);
 	printer->setMinMax(1, doc->Pages->count(), doc->currentPage()->pageNr()+1);
 	printDinUse = true;
 	connect(printer, SIGNAL(doPreview()), this, SLOT(doPrintPreview()));
@@ -7111,6 +7111,79 @@
 	delete dia;
 }
 
+void ScribusMainWindow::outputPreviewPS()
+{
+	const CheckerPrefs& checkerProfile = doc->checkerProfiles()[doc->curCheckProfile()];
+	if (checkerProfile.autoCheck)
+	{
+		if (scanDocument())
+		{
+			if (checkerProfile.ignoreErrors)
+			{
+				int i = ScMessageBox::warning(this, CommonStrings::trWarning,
+											"<qt>"+ tr("Scribus has detected some errors. Consider using the Preflight Verifier to correct them")+"</qt>",
+											QMessageBox::Abort | QMessageBox::Ignore,
+											QMessageBox::NoButton,	// GUI default
+											QMessageBox::Ignore);	// batch default
+				if (i == QMessageBox::Abort)
+					return;
+			}
+			else
+			{
+				connect(docCheckerPalette, SIGNAL(ignoreAllErrors()), this, SLOT(doOutputPreviewPS()));
+				docCheckerPalette->setIgnoreEnabled(true);
+				docCheckerPalette->checkMode = CheckDocument::checkOutputPreviewPS;
+				docCheckerPalette->buildErrorList(doc);
+				docCheckerPalette->show();
+				scrActions["toolsPreflightVerifier"]->setChecked(true);
+				return;
+			}
+		}
+	}
+	doOutputPreviewPS();
+}
+
+void ScribusMainWindow::doOutputPreviewPS()
+{
+	if (!HaveDoc)
+		return;
+	if (!ScCore->haveGS())
+		return;
+
+	if (docCheckerPalette->isIgnoreEnabled())
+	{
+		docCheckerPalette->hide();
+		docCheckerPalette->checkMode = CheckDocument::checkNULL;
+		docCheckerPalette->setIgnoreEnabled(false);
+		scrActions["toolsPreflightVerifier"]->setChecked(false);
+		disconnect(docCheckerPalette, SIGNAL(ignoreAllErrors()), this, SLOT(doOutputPreviewPS()));
+	}
+
+	OutputPreview_PS *dia = new OutputPreview_PS(this, doc);
+	previewDinUse = true;
+	connect(dia, SIGNAL(doExport()), this, SLOT(slotReallyPrint()));
+	dia->exec();
+	disconnect(dia, SIGNAL(doExport()), this, SLOT(slotReallyPrint()));
+	previewDinUse = false;
+
+	PrefsManager& prefsManager = PrefsManager::instance();
+	prefsManager.appPrefs.psOutputPreviewPrefs.psLevel = dia->postscriptLevel();
+	prefsManager.appPrefs.psOutputPreviewPrefs.cmykPreviewMode = dia->isCMYKPreviewEnabled();
+	prefsManager.appPrefs.psOutputPreviewPrefs.enableAntiAliasing = dia->isAntialiasingEnabled();
+	prefsManager.appPrefs.psOutputPreviewPrefs.showTransparency = dia->isTransparencyEnabled();
+	if (ScCore->haveTIFFSep())
+	{
+		prefsManager.appPrefs.psOutputPreviewPrefs.isCyanVisible = dia->isInkChannelVisible("Cyan");
+		prefsManager.appPrefs.psOutputPreviewPrefs.isMagentaVisible = dia->isInkChannelVisible("Magenta");
+		prefsManager.appPrefs.psOutputPreviewPrefs.isYellowVisible = dia->isInkChannelVisible("Yellow");
+		prefsManager.appPrefs.psOutputPreviewPrefs.isBlackVisible = dia->isInkChannelVisible("Black");
+		prefsManager.appPrefs.psOutputPreviewPrefs.displayInkCoverage = dia->isInkCoverageEnabled();
+		prefsManager.appPrefs.psOutputPreviewPrefs.inkCoverageThreshold = dia->inkCoverageThreshold();
+	}
+
+	delete dia;
+}
+
 bool ScribusMainWindow::DoSaveAsEps(const QString& fn, QString& error)
 {
 	QStringList spots;
@@ -8495,6 +8568,8 @@
 			disconnect(docCheckerPalette, SIGNAL(ignoreAllErrors()), this, SLOT(doPrintPreview()));
 		if (docCheckerPalette->checkMode == CheckDocument::checkOutputPreviewPDF)
 			disconnect(docCheckerPalette, SIGNAL(ignoreAllErrors()), this, SLOT(doOutputPreviewPDF()));
+		if (docCheckerPalette->checkMode == CheckDocument::checkOutputPreviewPS)
+			disconnect(docCheckerPalette, SIGNAL(ignoreAllErrors()), this, SLOT(doOutputPreviewPS()));
 		docCheckerPalette->setIgnoreEnabled(false);
 		docCheckerPalette->checkMode = CheckDocument::checkNULL;
 	}

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h	(original)
+++ trunk/Scribus/scribus/scribus.h	Thu May 28 01:09:48 2020
@@ -498,6 +498,8 @@
 	void printPreview();
 	void doOutputPreviewPDF();
 	void outputPreviewPDF();
+	void doOutputPreviewPS();
+	void outputPreviewPS();
 	void SaveAsEps();
 	void reallySaveAsEps();
 	void SaveAsPDF();

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Thu May 28 01:09:48 2020
@@ -117,6 +117,7 @@
 #include "units.h"
 #include "util.h"
 #include "util_math.h"
+#include "util_printer.h"
 
 
 // static const bool FRAMESELECTION_EDITS_DEFAULTSTYLE = false;
@@ -221,15 +222,12 @@
 	m_itemCreationTransaction(nullptr),
 	m_alignTransaction(nullptr)
 {
-	m_docUnitRatio=unitGetRatioFromIndex(m_docPrefsData.docSetupPrefs.docUnitIndex);
-	m_docPrefsData.docSetupPrefs.pageHeight=0;
-	m_docPrefsData.docSetupPrefs.pageWidth=0;
-	m_docPrefsData.docSetupPrefs.pagePositioning=0;
-	maxCanvasCoordinate=(FPoint(m_docPrefsData.displayPrefs.scratch.left() + m_docPrefsData.displayPrefs.scratch.right(), m_docPrefsData.displayPrefs.scratch.top() + m_docPrefsData.displayPrefs.scratch.bottom())),
+	m_docUnitRatio = unitGetRatioFromIndex(m_docPrefsData.docSetupPrefs.docUnitIndex);
+	m_docPrefsData.docSetupPrefs.pageHeight = 0;
+	m_docPrefsData.docSetupPrefs.pageWidth = 0;
+	m_docPrefsData.docSetupPrefs.pagePositioning = 0;
+	maxCanvasCoordinate = FPoint(m_docPrefsData.displayPrefs.scratch.left() + m_docPrefsData.displayPrefs.scratch.right(), m_docPrefsData.displayPrefs.scratch.top() + m_docPrefsData.displayPrefs.scratch.bottom());
 	init();
-	m_docPrefsData.pdfPrefs.bleeds = m_docPrefsData.docSetupPrefs.bleeds;
-	m_docPrefsData.pdfPrefs.useDocBleeds = true;
-	Print_Options.firstUse = true;
 	//create default numeration
 	auto* numS = new NumStruct;
 	numS->m_name = "default";
@@ -260,19 +258,16 @@
 	m_itemCreationTransaction(nullptr),
 	m_alignTransaction(nullptr)
 {
-	m_docPrefsData.docSetupPrefs.docUnitIndex=unitindex;
-	m_docPrefsData.docSetupPrefs.pageHeight=pagesize.height();
-	m_docPrefsData.docSetupPrefs.pageWidth=pagesize.width();
-	m_docPrefsData.docSetupPrefs.pageSize=pagesize.name();
-	m_docPrefsData.docSetupPrefs.margins=margins;
-	maxCanvasCoordinate=(FPoint(m_docPrefsData.displayPrefs.scratch.left() + m_docPrefsData.displayPrefs.scratch.right(), m_docPrefsData.displayPrefs.scratch.top() + m_docPrefsData.displayPrefs.scratch.bottom())),
+	m_docPrefsData.docSetupPrefs.docUnitIndex = unitindex;
+	m_docPrefsData.docSetupPrefs.pageHeight = pagesize.height();
+	m_docPrefsData.docSetupPrefs.pageWidth = pagesize.width();
+	m_docPrefsData.docSetupPrefs.pageSize = pagesize.name();
+	m_docPrefsData.docSetupPrefs.margins = margins;
+	maxCanvasCoordinate = FPoint(m_docPrefsData.displayPrefs.scratch.left() + m_docPrefsData.displayPrefs.scratch.right(), m_docPrefsData.displayPrefs.scratch.top() + m_docPrefsData.displayPrefs.scratch.bottom());
 	setPageSetFirstPage(pagesSetup.pageArrangement, pagesSetup.firstPageLocation);
 	init();
-	m_docPrefsData.pdfPrefs.bleeds = m_docPrefsData.docSetupPrefs.bleeds;
-	m_docPrefsData.pdfPrefs.useDocBleeds = true;
-	m_docPrefsData.docSetupPrefs.pageOrientation=pagesSetup.orientation;
-	m_docPrefsData.docSetupPrefs.pagePositioning=pagesSetup.pageArrangement;
-	Print_Options.firstUse = true;
+	m_docPrefsData.docSetupPrefs.pageOrientation = pagesSetup.orientation;
+	m_docPrefsData.docSetupPrefs.pagePositioning = pagesSetup.pageArrangement;
 }
 
 
@@ -300,11 +295,21 @@
 
 	PrefsManager& prefsManager = PrefsManager::instance();
 	m_docPrefsData.colorPrefs.DCMSset = prefsManager.appPrefs.colorPrefs.DCMSset;
+
+	Print_Options.firstUse = true;
+	PrinterUtil::getDefaultPrintOptions(Print_Options, m_docPrefsData.docSetupPrefs.bleeds);
+	Print_Options.bleeds = m_docPrefsData.docSetupPrefs.bleeds;
+	Print_Options.useDocBleeds = true;
+
+	m_docPrefsData.pdfPrefs.firstUse = true;
+	m_docPrefsData.pdfPrefs.Version = m_appPrefsData.pdfPrefs.Version;
 	m_docPrefsData.pdfPrefs.SolidProf = m_docPrefsData.colorPrefs.DCMSset.DefaultSolidColorRGBProfile;
 	m_docPrefsData.pdfPrefs.ImageProf = m_docPrefsData.colorPrefs.DCMSset.DefaultImageRGBProfile;
 	m_docPrefsData.pdfPrefs.PrintProf = m_docPrefsData.colorPrefs.DCMSset.DefaultPrinterProfile;
 	m_docPrefsData.pdfPrefs.Intent  = m_docPrefsData.colorPrefs.DCMSset.DefaultIntentColors;
 	m_docPrefsData.pdfPrefs.Intent2 = m_docPrefsData.colorPrefs.DCMSset.DefaultIntentImages;
+	m_docPrefsData.pdfPrefs.useDocBleeds = true;
+	m_docPrefsData.pdfPrefs.bleeds = m_docPrefsData.docSetupPrefs.bleeds;
 
 	AddFont(m_appPrefsData.itemToolPrefs.textFont);//, prefsData.AvailFonts[prefsData.itemToolPrefs.textFont]->Font);
 	//FIXME: aren't we doing this now anyway with prefs struct copy?
@@ -346,7 +351,6 @@
 		PageColors.insert(m_appPrefsData.itemToolPrefs.calligraphicPenFillColor, m_appPrefsData.colorPrefs.DColors[m_appPrefsData.itemToolPrefs.calligraphicPenFillColor]);
 	if (m_appPrefsData.itemToolPrefs.calligraphicPenLineColor != CommonStrings::None)
 		PageColors.insert(m_appPrefsData.itemToolPrefs.calligraphicPenLineColor, m_appPrefsData.colorPrefs.DColors[m_appPrefsData.itemToolPrefs.calligraphicPenLineColor]);
-
 	
 	ParagraphStyle pstyle;
 	pstyle.setDefaultStyle(true);
@@ -444,16 +448,13 @@
 	Layers.addLayer( tr("Background") );
 	// FIXME: Check PDF version input
 	//TODO: Check if this is needed now we ue appPrefsData --> docPrefsData
-	pdfOptions().Version = m_appPrefsData.pdfPrefs.Version;
-
-	pdfOptions().firstUse = true;
 	docPatterns.clear();
 	docGradients.clear();
 
 	if (autoSave() && ScCore->usingGUI())
 		autoSaveTimer->start(autoSaveTime());
 	//Do this after all the collections have been created and cleared!
-	m_masterPageMode=true; // quick hack to force the change of pointers in setMasterPageMode();
+	m_masterPageMode = true; // quick hack to force the change of pointers in setMasterPageMode();
 	setMasterPageMode(false);
 	addSymbols();
 	//for loading old documents where default notes style is not saved

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h	(original)
+++ trunk/Scribus/scribus/scribusdoc.h	Thu May 28 01:09:48 2020
@@ -96,6 +96,7 @@
 	ScribusDoc();
 	ScribusDoc(const QString& docName, int unitIndex, const PageSize& pagesize, const MarginStruct& margins, const DocPagesSetup& pagesSetup);
 	~ScribusDoc();
+
 	void init();
 	bool inAnEditMode() const;
 	bool inASpecialEditMode() const;
@@ -130,7 +131,6 @@
 	void invalidateAll();
 	void invalidateLayer(int layerID);
 	void invalidateRegion(QRectF region);
-
 
 	MarginStruct* scratch() { return &m_docPrefsData.displayPrefs.scratch; }
 	MarginStruct* bleeds() { return &m_docPrefsData.docSetupPrefs.bleeds; }

Modified: trunk/Scribus/scribus/scribusstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/scribusstructs.h
==============================================================================
--- trunk/Scribus/scribus/scribusstructs.h	(original)
+++ trunk/Scribus/scribus/scribusstructs.h	Thu May 28 01:09:48 2020
@@ -191,33 +191,33 @@
 
 struct PrintOptions
 {
-	bool firstUse;
-	bool toFile;
-	bool useAltPrintCommand;
-	bool outputSeparations;
-	bool useSpotColors;
-	bool useColor;
-	bool mirrorH;
-	bool mirrorV;
-	bool doGCR;
-	bool doClip;
-	bool setDevParam;
-	bool useDocBleeds;
-	bool cropMarks;
-	bool bleedMarks;
-	bool registrationMarks;
-	bool colorMarks;
-	bool includePDFMarks;
-	int  copies;
-	PrintEngine prnEngine;
-	double markLength;
-	double markOffset;
+	bool firstUse { true };
+	bool toFile { false };
+	bool useAltPrintCommand { false };
+	bool outputSeparations { false };
+	bool useSpotColors { true };
+	bool useColor { true };
+	bool mirrorH { false };
+	bool mirrorV { false };
+	bool doGCR { false };
+	bool doClip { false };
+	bool setDevParam { false };
+	bool useDocBleeds { true };
+	bool cropMarks { false };
+	bool bleedMarks { false };
+	bool registrationMarks { false };
+	bool colorMarks { false };
+	bool includePDFMarks { true };
+	int  copies { 1 };
+	PrintEngine prnEngine { PostScript3 };
+	double markLength { 20.0 };
+	double markOffset { 0.0 };
 	MarginStruct bleeds;
 	std::vector<int> pageNumbers;
 	QString printerOptions;
 	QString printer;
 	QString filename;
-	QString separationName;
+	QString separationName { "All" };
 	QStringList allSeparations;
 	QString printerCommand;
 	QByteArray devMode; // printer specific options on Windows

Modified: trunk/Scribus/scribus/ui/checkDocument.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/ui/checkDocument.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/checkDocument.cpp	(original)
+++ trunk/Scribus/scribus/ui/checkDocument.cpp	Thu May 28 01:09:48 2020
@@ -160,7 +160,7 @@
 {
 	QString bestProfile = defaultProfile;
 
-	if (mode == CheckDocument::checkPDF)
+	if (mode == CheckDocument::checkPDF || mode == CheckDocument::checkOutputPreviewPDF)
 	{
 		PDFVersion pdfVersion = m_Doc->pdfOptions().Version;
 		if (pdfVersion == PDFVersion::PDF_13)
@@ -178,7 +178,7 @@
 		else if (pdfVersion == PDFVersion::PDF_X4)
 			bestProfile = CommonStrings::PDF_X4;
 	}
-	else if (mode == CheckDocument::checkEPS)
+	else if (mode == CheckDocument::checkEPS || mode == CheckDocument::checkOutputPreviewPS)
 		bestProfile = CommonStrings::PostScript;
 
 	const auto& checkerProfiles = m_Doc->checkerProfiles();

Modified: trunk/Scribus/scribus/ui/checkDocument.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/ui/checkDocument.h
==============================================================================
--- trunk/Scribus/scribus/ui/checkDocument.h	(original)
+++ trunk/Scribus/scribus/ui/checkDocument.h	Thu May 28 01:09:48 2020
@@ -46,7 +46,7 @@
 	void setDoc(ScribusDoc *doc);
 
 	/*! \brief State of the P.V. */
-	enum CheckMode { checkNULL, checkPDF, checkEPS, checkPrint, checkPrintPreview, checkOutputPreviewPDF };
+	enum CheckMode { checkNULL, checkPDF, checkEPS, checkPrint, checkPrintPreview, checkOutputPreviewPDF, checkOutputPreviewPS };
 
 	/*! \brief Clean the list view tree and reset the P.V. attributes. */
 	void clearErrorList();

Modified: trunk/Scribus/scribus/ui/printdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/ui/printdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/printdialog.cpp	(original)
+++ trunk/Scribus/scribus/ui/printdialog.cpp	Thu May 28 01:09:48 2020
@@ -26,11 +26,12 @@
 #elif defined(HAVE_CUPS) // Haiku doesn't have it
 	#include <cups/cups.h>
 #endif
-#include "ui/createrange.h"
+#include "sccolor.h"
 #include "scpaths.h"
 #include "scribuscore.h"
 #include "scribusdoc.h"
 #include "scrspinbox.h"
+#include "ui/createrange.h"
 #include "units.h"
 #include "usertaskstructs.h"
 #include "util.h"
@@ -38,7 +39,7 @@
 
 extern bool previewDinUse;
 
-PrintDialog::PrintDialog( QWidget* parent, ScribusDoc* doc, const PrintOptions& printOptions, bool gcr, const QStringList& spots)
+PrintDialog::PrintDialog( QWidget* parent, ScribusDoc* doc, const PrintOptions& printOptions)
 		: QDialog( parent )
 {
 	setupUi(this);
@@ -103,15 +104,19 @@
 	}
 
 	// Fill Separation list
-	QString sep[] =
-	    {
-	        tr("All"), tr("Cyan"), tr("Magenta"), tr("Yellow"),
-	        tr("Black")
-	    };
-	size_t sepArray = sizeof(sep) / sizeof(*sep);
-	for (uint prop = 0; prop < sepArray; ++prop)
-		separationsCombo->addItem(sep[prop]);
-	separationsCombo->addItems(spots);
+	ColorList usedSpots;
+	doc->getUsedColors(usedSpots, true);
+	m_spotColors = usedSpots.keys();
+
+	separationsCombo->addItem( tr("All"), "All" );
+	separationsCombo->addItem( tr("Cyan"), "Cyan" );
+	separationsCombo->addItem( tr("Magenta"), "Magenta" );
+	separationsCombo->addItem( tr("Yellow"), "Yellow" );
+	for (int i = 0; i < m_spotColors.count(); ++i)
+	{
+		const QString& spotName = m_spotColors.at(i);
+		separationsCombo->addItem(spotName, spotName);
+	}
 
 	if (m_doc->pagePositioning() != 0)
 	{
@@ -151,7 +156,7 @@
 	connect( docBleeds, SIGNAL(clicked()), this, SLOT(doDocBleeds()));
 	connect( optionsButton, SIGNAL( clicked() ), this, SLOT( selectOptions() ) );
 
-	setStoredValues(printOptions.filename, gcr);
+	setStoredValues(printOptions.filename);
 #if defined(_WIN32)
 	if (!outputToFile())
 	{
@@ -473,42 +478,10 @@
 	emit doPreview();
 }
 
-void PrintDialog::getDefaultPrintOptions(PrintOptions& options, bool gcr)
-{
-	QStringList spots;
-	options.firstUse = true;
-	options.printer  = prefs->get("CurrentPrn", "");
-	options.useAltPrintCommand = prefs->getBool("OtherCom", false);
-	options.printerCommand = prefs->get("Command", "");
-	options.outputSeparations = prefs->getInt("Separations", 0);
-	options.useColor = (prefs->getInt("PrintColor", 0) == 0);
-	spots << tr("All") << tr("Cyan") << tr("Magenta") << tr("Yellow") << tr("Black");
-	int selectedSep  = prefs->getInt("SepArt", 0);
-	if ((selectedSep < 0) || (selectedSep > 4))
-		selectedSep = 0;
-	options.separationName = spots.at(selectedSep);
-	options.prnEngine = (PrintEngine) prefs->getInt("PSLevel", PostScript3);
-	options.mirrorH = prefs->getBool("MirrorH", false);
-	options.mirrorV = prefs->getBool("MirrorV", false);
-	options.setDevParam = prefs->getBool("doDev", false);
-	options.doGCR   = prefs->getBool("DoGCR", gcr);
-	options.doClip  = prefs->getBool("Clip", false);
-	options.useSpotColors = prefs->getBool("doSpot", true);
-	options.useDocBleeds  = true;
-	options.bleeds = *m_doc->bleeds();
-	options.markLength = prefs->getDouble("markLength", 20.0);
-	options.markOffset = prefs->getDouble("markOffset", 0.0);
-	options.cropMarks  = prefs->getBool("cropMarks", false);
-	options.bleedMarks = prefs->getBool("bleedMarks", false);
-	options.registrationMarks = prefs->getBool("registrationMarks", false);
-	options.colorMarks = prefs->getBool("colorMarks", false);
-	options.includePDFMarks = prefs->getBool("includePDFMarks", true);
-}
-
-void PrintDialog::setStoredValues(const QString& fileName, bool gcr)
+void PrintDialog::setStoredValues(const QString& fileName)
 {
 	if (m_doc->Print_Options.firstUse)
-		getDefaultPrintOptions(m_doc->Print_Options, gcr);
+		PrinterUtil::getDefaultPrintOptions(m_doc->Print_Options, m_doc->bleedsVal());
 	
 	int selectedDest = PrintDest->findText(m_doc->Print_Options.printer);
 	if ((selectedDest > -1) && (selectedDest < PrintDest->count()))
@@ -534,17 +507,8 @@
 	Copies->setValue(1);
 	printSepCombo->setCurrentIndex(m_doc->Print_Options.outputSeparations);
 	colorType->setCurrentIndex(m_doc->Print_Options.useColor ? 0 : 1);
-	ColorList usedSpots;
-	m_doc->getUsedColors(usedSpots, true);
-	QStringList spots = usedSpots.keys();
-	spots.prepend( tr("Black"));
-	spots.prepend( tr("Yellow"));
-	spots.prepend( tr("Magenta"));
-	spots.prepend( tr("Cyan"));
-	spots.prepend( tr("All"));
-	int selectedSep = spots.indexOf(m_doc->Print_Options.separationName);
-	if ((selectedSep > -1) && (selectedSep < separationsCombo->count()))
-		separationsCombo->setCurrentIndex(selectedSep);
+	int selectedSep = separationsCombo->findData(m_doc->Print_Options.separationName);
+	separationsCombo->setCurrentIndex((selectedSep >= 0) ? selectedSep : 0);
 	if (printSepCombo->currentIndex() == 1)
 		separationsCombo->setEnabled(true);
 	setPrintEngine(m_doc->Print_Options.prnEngine);

Modified: trunk/Scribus/scribus/ui/printdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/ui/printdialog.h
==============================================================================
--- trunk/Scribus/scribus/ui/printdialog.h	(original)
+++ trunk/Scribus/scribus/ui/printdialog.h	Thu May 28 01:09:48 2020
@@ -11,6 +11,7 @@
 #include "scribusstructs.h"
 
 #include <QDialog>
+#include <QStringList>
 #include "ui_printdialogbase.h"
 
 class PrefsContext;
@@ -24,7 +25,7 @@
 	Q_OBJECT
 
 public:
-	PrintDialog( QWidget* parent, ScribusDoc* doc, const PrintOptions& printOptions, bool gcr, const QStringList& spots);
+	PrintDialog( QWidget* parent, ScribusDoc* doc, const PrintOptions& printOptions);
 	~PrintDialog();
 
 	QString printerName();
@@ -72,15 +73,15 @@
 	CupsOptions*   m_cupsOptions { nullptr };
 	int            m_unit { 0 };
 	double         m_unitRatio { 1 };
+	QStringList    m_spotColors;
 	
 	QByteArray m_devMode; // Buffer for storing storing printer options on Windows
 
 	QString getOptions();
-	void getDefaultPrintOptions(PrintOptions& options, bool gcr);
 	void storeValues();
 	void refreshPrintEngineBox();
 	void setPrintEngine(PrintEngine engine);
-	void setStoredValues(const QString& fileName, bool gcr);
+	void setStoredValues(const QString& fileName);
 };
 
 #endif // PRINTDIALOG_H

Modified: trunk/Scribus/scribus/ui/printpreview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/ui/printpreview.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/printpreview.cpp	(original)
+++ trunk/Scribus/scribus/ui/printpreview.cpp	Thu May 28 01:09:48 2020
@@ -487,7 +487,6 @@
 		page = doc->Pages->at(pageIndex);
 		options.copies = 1;
 		options.doGCR = false;
-		//options.mirrorH = options.mirrorV = false;
 		options.mirrorH = mirrorHor->isChecked();
 		options.mirrorV = mirrorVert->isChecked();
 		options.outputSeparations = false;

Modified: trunk/Scribus/scribus/util_printer.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/util_printer.cpp
==============================================================================
--- trunk/Scribus/scribus/util_printer.cpp	(original)
+++ trunk/Scribus/scribus/util_printer.cpp	Thu May 28 01:09:48 2020
@@ -18,10 +18,47 @@
 #include <QStringList>
 #include <QDataStream>
 #include <QByteArray>
+
 #include "util.h"
 #include "commonstrings.h"
-
+#include "prefscontext.h"
+#include "prefsfile.h"
+#include "prefsmanager.h"
 #include "scribuscore.h"
+
+void PrinterUtil::getDefaultPrintOptions(PrintOptions& options, const MarginStruct& docBleeds)
+{
+	PrefsManager& prefsManager = PrefsManager::instance();
+	PrefsContext *prnPrefs = prefsManager.prefsFile->getContext("print_options");
+
+	options.firstUse = true;
+	options.printer  = prnPrefs->get("CurrentPrn", QString());
+	options.useAltPrintCommand = prnPrefs->getBool("OtherCom", false);
+	options.printerCommand = prnPrefs->get("Command", QString());
+	options.outputSeparations = prnPrefs->getInt("Separations", 0);
+	options.useColor = (prnPrefs->getInt("PrintColor", 0) == 0);
+	QStringList spots { "All" , "Cyan", "Magenta", "Yellow", "Black" };
+	int selectedSep  = prnPrefs->getInt("SepArt", 0);
+	if ((selectedSep < 0) || (selectedSep > 4))
+		selectedSep = 0;
+	options.separationName = spots.at(selectedSep);
+	options.prnEngine = (PrintEngine) prnPrefs->getInt("PSLevel", PostScript3);
+	options.mirrorH = prnPrefs->getBool("MirrorH", false);
+	options.mirrorV = prnPrefs->getBool("MirrorV", false);
+	options.setDevParam = prnPrefs->getBool("doDev", false);
+	options.doGCR   = prnPrefs->getBool("DoGCR", prefsManager.appPrefs.printerPrefs.GCRMode);
+	options.doClip  = prnPrefs->getBool("Clip", false);
+	options.useSpotColors = prnPrefs->getBool("doSpot", true);
+	options.useDocBleeds  = true;
+	options.bleeds = docBleeds;
+	options.markLength = prnPrefs->getDouble("markLength", 20.0);
+	options.markOffset = prnPrefs->getDouble("markOffset", 0.0);
+	options.cropMarks  = prnPrefs->getBool("cropMarks", false);
+	options.bleedMarks = prnPrefs->getBool("bleedMarks", false);
+	options.registrationMarks = prnPrefs->getBool("registrationMarks", false);
+	options.colorMarks = prnPrefs->getBool("colorMarks", false);
+	options.includePDFMarks = prnPrefs->getBool("includePDFMarks", true);
+}
 
 QString PrinterUtil::getDefaultPrinterName()
 {

Modified: trunk/Scribus/scribus/util_printer.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/scribus/util_printer.h
==============================================================================
--- trunk/Scribus/scribus/util_printer.h	(original)
+++ trunk/Scribus/scribus/util_printer.h	Thu May 28 01:09:48 2020
@@ -24,6 +24,8 @@
 		PrinterUtil() = default;
 		~PrinterUtil() = default;
 
+		static void getDefaultPrintOptions(PrintOptions& options, const MarginStruct& docBleeds);
+
 		QString static getDefaultPrinterName();
 		QStringList static getPrinterNames();
 
@@ -39,7 +41,7 @@
 		 * @param devModeA an array which will store the DEVMODE structure with printer settings
 		 * @return true if default settings were successfully retrieved.
 		 */
-		static bool getDefaultSettings( QString printerName, QByteArray& devModeA );
+		static bool getDefaultSettings(QString printerName, QByteArray& devModeA);
 		/**
 		 * @brief Initialize print options dialog box settings (Windows only) 
 		 *
@@ -51,7 +53,7 @@
 		 * @param devModeA an array storing the DEVMODE structure for the specified printer
 		 * @return true if default settings were successfully retrieved.
 		 */
-		static bool initDeviceSettings( QString printerName, QByteArray& devModeA );
+		static bool initDeviceSettings(QString printerName, QByteArray& devModeA);
 #endif
 		/**
 		 * @brief Get the 4 minimum page margins for a certain paper size on the given printer

Modified: trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj
==============================================================================
--- trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj	(original)
+++ trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj	Thu May 28 01:09:48 2020
@@ -609,6 +609,7 @@
     <moc Include="..\..\..\scribus\ui\contentpalette_default.h" />
     <moc Include="..\..\..\scribus\ui\outputpreviewbase.h" />
     <moc Include="..\..\..\scribus\ui\outputpreview_pdf.h" />
+    <moc Include="..\..\..\scribus\ui\outputpreview_ps.h" />
     <ClInclude Include="..\..\..\scribus\ui\propertywidgetbase.h" />
     <moc Include="..\..\..\scribus\pslib.h" />
     <moc Include="..\..\..\scribus\ui\query.h" />
@@ -1199,6 +1200,7 @@
     <ClCompile Include="..\..\..\scribus\pageitem_textframe.cpp" />
     <ClCompile Include="..\..\..\scribus\ui\outputpreviewbase.cpp" />
     <ClCompile Include="..\..\..\scribus\ui\outputpreview_pdf.cpp" />
+    <ClCompile Include="..\..\..\scribus\ui\outputpreview_ps.cpp" />
     <ClCompile Include="..\..\..\scribus\ui\pageitemattributes.cpp" />
     <ClCompile Include="..\..\..\scribus\pageitempointer.cpp" />
     <ClCompile Include="..\..\..\scribus\ui\pagelayout.cpp" />
@@ -1582,6 +1584,7 @@
     <uic Include="..\..\..\scribus\ui\osgeditor.ui" />
     <uic Include="..\..\..\scribus\ui\outputpreviewbase.ui" />
     <uic Include="..\..\..\scribus\ui\outputpreview_pdf.ui" />
+    <uic Include="..\..\..\scribus\ui\outputpreview_ps.ui" />
     <uic Include="..\..\..\scribus\ui\pageitemattributes.ui" />
     <uic Include="..\..\..\scribus\ui\pagepalette_masterpagesbase.ui" />
     <uic Include="..\..\..\scribus\ui\pagepalette_pagesbase.ui" />

Modified: trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters
==============================================================================
--- trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters	(original)
+++ trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters	Thu May 28 01:09:48 2020
@@ -812,6 +812,9 @@
     <ClInclude Include="..\..\..\scribus\ui\outputpreview_pdf.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\scribus\ui\outputpreview_ps.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\scribus\desaxe\digester.cpp">
@@ -2516,6 +2519,9 @@
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\scribus\ui\outputpreview_pdf.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\scribus\ui\outputpreview_ps.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
@@ -2911,6 +2917,9 @@
     <uic Include="..\..\..\scribus\ui\outputpreview_pdf.ui">
       <Filter>Form Files</Filter>
     </uic>
+    <uic Include="..\..\..\scribus\ui\outputpreview_ps.ui">
+      <Filter>Form Files</Filter>
+    </uic>
   </ItemGroup>
   <ItemGroup>
     <lrelease Include="..\..\..\resources\translations\scribus.af.ts">

Modified: trunk/Scribus/win32/msvc2017/scribus-main/Scribus.vcxproj
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/win32/msvc2017/scribus-main/Scribus.vcxproj
==============================================================================
--- trunk/Scribus/win32/msvc2017/scribus-main/Scribus.vcxproj	(original)
+++ trunk/Scribus/win32/msvc2017/scribus-main/Scribus.vcxproj	Thu May 28 01:09:48 2020
@@ -609,6 +609,7 @@
     <moc Include="..\..\..\scribus\ui\contentpalette_default.h" />
     <moc Include="..\..\..\scribus\ui\outputpreviewbase.h" />
     <moc Include="..\..\..\scribus\ui\outputpreview_pdf.h" />
+    <moc Include="..\..\..\scribus\ui\outputpreview_ps.h" />
     <ClInclude Include="..\..\..\scribus\ui\propertywidgetbase.h" />
     <moc Include="..\..\..\scribus\pslib.h" />
     <moc Include="..\..\..\scribus\ui\query.h" />
@@ -1199,6 +1200,7 @@
     <ClCompile Include="..\..\..\scribus\pageitem_textframe.cpp" />
     <ClCompile Include="..\..\..\scribus\ui\outputpreviewbase.cpp" />
     <ClCompile Include="..\..\..\scribus\ui\outputpreview_pdf.cpp" />
+    <ClCompile Include="..\..\..\scribus\ui\outputpreview_ps.cpp" />
     <ClCompile Include="..\..\..\scribus\ui\pageitemattributes.cpp" />
     <ClCompile Include="..\..\..\scribus\pageitempointer.cpp" />
     <ClCompile Include="..\..\..\scribus\ui\pagelayout.cpp" />
@@ -1582,6 +1584,7 @@
     <uic Include="..\..\..\scribus\ui\osgeditor.ui" />
     <uic Include="..\..\..\scribus\ui\outputpreviewbase.ui" />
     <uic Include="..\..\..\scribus\ui\outputpreview_pdf.ui" />
+    <uic Include="..\..\..\scribus\ui\outputpreview_ps.ui" />
     <uic Include="..\..\..\scribus\ui\pageitemattributes.ui" />
     <uic Include="..\..\..\scribus\ui\pagepalette_masterpagesbase.ui" />
     <uic Include="..\..\..\scribus\ui\pagepalette_pagesbase.ui" />

Modified: trunk/Scribus/win32/msvc2017/scribus-main/Scribus.vcxproj.filters
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23845&path=/trunk/Scribus/win32/msvc2017/scribus-main/Scribus.vcxproj.filters
==============================================================================
--- trunk/Scribus/win32/msvc2017/scribus-main/Scribus.vcxproj.filters	(original)
+++ trunk/Scribus/win32/msvc2017/scribus-main/Scribus.vcxproj.filters	Thu May 28 01:09:48 2020
@@ -812,6 +812,9 @@
     <ClInclude Include="..\..\..\scribus\ui\outputpreview_pdf.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\scribus\ui\outputpreview_ps.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\scribus\desaxe\digester.cpp">
@@ -2516,6 +2519,9 @@
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\scribus\ui\outputpreview_pdf.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\scribus\ui\outputpreview_ps.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
@@ -2911,6 +2917,9 @@
     <uic Include="..\..\..\scribus\ui\outputpreview_pdf.ui">
       <Filter>Form Files</Filter>
     </uic>
+    <uic Include="..\..\..\scribus\ui\outputpreview_ps.ui">
+      <Filter>Form Files</Filter>
+    </uic>
   </ItemGroup>
   <ItemGroup>
     <lrelease Include="..\..\..\resources\translations\scribus.af.ts">




More information about the scribus-commit mailing list