r14849 by cbradney - #8794: Offer option to show/hide pages without errors in PreflightVerifier

scribus-commit scribus-commit at lists.scribus.net
Wed Mar 3 23:10:39 CET 2010


Revision: 14849
Author: cbradney
Date: 2010-03-03T22:07:21.710264Z
Commit message: #8794: Offer option to show/hide pages without errors in PreflightVerifier

Changeset: 
M  /trunk/Scribus/scribus/ui/checkDocument.cpp
M  /trunk/Scribus/scribus/prefsmanager.cpp
M  /trunk/Scribus/scribus/prefsstructs.h
M  /trunk/Scribus/scribus/ui/prefs.cpp
M  /trunk/Scribus/scribus/ui/prefs_preflightverifier.cpp
M  /trunk/Scribus/scribus/ui/checkDocument.h
M  /trunk/Scribus/scribus/scribusdoc.cpp
M  /trunk/Scribus/scribus/ui/prefs_preflightverifierbase.ui

Diffs:
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp	(revision 14848)
+++ scribus/scribusdoc.cpp	(revision 14849)
@@ -214,8 +214,8 @@
 	guidesSettings(prefsData.guidesPrefs),
 	itemToolPrefs(prefsData.itemToolPrefs),
 	opToolPrefs(prefsData.opToolPrefs),
-	checkerProfiles(prefsData.checkerPrefsList),
-	curCheckProfile(prefsData.curCheckProfile),
+	checkerProfiles(prefsData.verifierPrefs.checkerPrefsList),
+	curCheckProfile(prefsData.verifierPrefs.curCheckProfile),
 	LastAuto(0), FirstAuto(0),
 	DraggedElem(0),
 	ElemToLink(0),
@@ -329,8 +329,8 @@
 	guidesSettings(prefsData.guidesPrefs),
 	itemToolPrefs(prefsData.itemToolPrefs),
 	opToolPrefs(prefsData.opToolPrefs),
-	checkerProfiles(prefsData.checkerPrefsList),
-	curCheckProfile(prefsData.curCheckProfile),
+	checkerProfiles(prefsData.verifierPrefs.checkerPrefsList),
+	curCheckProfile(prefsData.verifierPrefs.curCheckProfile),
 	LastAuto(0), FirstAuto(0),
 	DraggedElem(0),
 	ElemToLink(0),
Index: scribus/prefsmanager.cpp
===================================================================
--- scribus/prefsmanager.cpp	(revision 14848)
+++ scribus/prefsmanager.cpp	(revision 14849)
@@ -431,8 +431,9 @@
 	appPrefs.uiPrefs.showSplashOnStartup = true;
 	appPrefs.uiPrefs.useSmallWidgets = false;
 	appPrefs.uiPrefs.useTabs = false;
-	initDefaultCheckerPrefs(&appPrefs.checkerPrefsList);
-	appPrefs.curCheckProfile = CommonStrings::PostScript;
+	initDefaultCheckerPrefs(&appPrefs.verifierPrefs.checkerPrefsList);
+	appPrefs.verifierPrefs.curCheckProfile = CommonStrings::PostScript;
+	appPrefs.verifierPrefs.showPagesWithoutErrors=false;
 	appPrefs.pdfPrefs.Thumbnails = false;
 	appPrefs.pdfPrefs.Articles = false;
 	appPrefs.pdfPrefs.useLayers = false;
@@ -916,10 +917,10 @@
 	//For 1.3.5, we dump prefs first time around.
 	if (!firstTimeIgnoreOldPrefs)
 		ReadPrefsXML();
-	if (appPrefs.checkerPrefsList.count() == 0)
+	if (appPrefs.verifierPrefs.checkerPrefsList.count() == 0)
 	{
-		initDefaultCheckerPrefs(&appPrefs.checkerPrefsList);
-		appPrefs.curCheckProfile = CommonStrings::PostScript;
+		initDefaultCheckerPrefs(&appPrefs.verifierPrefs.checkerPrefsList);
+		appPrefs.verifierPrefs.curCheckProfile = CommonStrings::PostScript;
 	}
 	if (!appPrefs.uiPrefs.mainWinState.isEmpty())
 	{
@@ -1482,11 +1483,12 @@
 	}
 	elem.appendChild(pageSetAttr);
 	QDomElement dc79ac=docu.createElement("Checker");
-	dc79ac.setAttribute("currentProfile", appPrefs.curCheckProfile);
+	dc79ac.setAttribute("currentProfile", appPrefs.verifierPrefs.curCheckProfile);
+	dc79ac.setAttribute("ShowPagesWithoutErrors", appPrefs.verifierPrefs.showPagesWithoutErrors);
 	elem.appendChild(dc79ac);
 	CheckerPrefsList::Iterator itcp;
-	CheckerPrefsList::Iterator itcpend=appPrefs.checkerPrefsList.end();
-	for (itcp = appPrefs.checkerPrefsList.begin(); itcp != itcpend; ++itcp)
+	CheckerPrefsList::Iterator itcpend=appPrefs.verifierPrefs.checkerPrefsList.end();
+	for (itcp = appPrefs.verifierPrefs.checkerPrefsList.begin(); itcp != itcpend; ++itcp)
 	{
 		QDomElement dc79a=docu.createElement("CheckProfile");
 		dc79a.setAttribute("Name",itcp.key());
@@ -1811,7 +1813,7 @@
 	ScColor lf = ScColor();
 	QDomNode DOC=elem.firstChild();
 	if (!DOC.namedItem("CheckProfile").isNull())
-		appPrefs.checkerPrefsList.clear();
+		appPrefs.verifierPrefs.checkerPrefsList.clear();
 	while(!DOC.isNull())
 	{
 		QDomElement dc=DOC.toElement();
@@ -2151,13 +2153,15 @@
 			appPrefs.uiPrefs.RecentDocs.append(dc.attribute("NAME"));
 		if (dc.tagName()=="Checker")
 		{
-			appPrefs.curCheckProfile = dc.attribute("currentProfile", CommonStrings::PostScript);
+			appPrefs.verifierPrefs.curCheckProfile = dc.attribute("currentProfile", CommonStrings::PostScript);
+			appPrefs.verifierPrefs.showPagesWithoutErrors = static_cast<bool>(dc.attribute("ShowPagesWithoutErrors", "0").toInt());
 			//#2516 work around old values until people wont have them anymore, not that these
 			//translated strings should be going into prefs anyway!
-			if ((appPrefs.curCheckProfile == tr("PostScript")) || ((appPrefs.curCheckProfile == tr("Postscript")) ||
-				(appPrefs.curCheckProfile == "Postscript")))
+			if ((appPrefs.verifierPrefs.curCheckProfile == tr("PostScript")) ||
+				((appPrefs.verifierPrefs.curCheckProfile == tr("Postscript")) ||
+				(appPrefs.verifierPrefs.curCheckProfile == "Postscript")))
 			{
-				appPrefs.curCheckProfile = CommonStrings::PostScript;
+				appPrefs.verifierPrefs.curCheckProfile = CommonStrings::PostScript;
 			}
 		}
 		if (dc.tagName()=="CheckProfile")
@@ -2185,7 +2189,7 @@
 			checkerSettings.checkDeviceColorsAndOutputIntend = static_cast<bool>(dc.attribute("checkDeviceColorsAndOutputIntend", "0").toInt());
 			checkerSettings.checkFontNotEmbedded = static_cast<bool>(dc.attribute("checkFontNotEmbedded", "0").toInt());
 			checkerSettings.checkFontIsOpenType = static_cast<bool>(dc.attribute("checkFontIsOpenType", "0").toInt());
-			appPrefs.checkerPrefsList[name] = checkerSettings;
+			appPrefs.verifierPrefs.checkerPrefsList[name] = checkerSettings;
 		}
 		if (dc.tagName()=="PRINTER")
 		{
Index: scribus/prefsstructs.h
===================================================================
--- scribus/prefsstructs.h	(revision 14848)
+++ scribus/prefsstructs.h	(revision 14849)
@@ -45,6 +45,13 @@
 
 typedef QMap<QString, CheckerPrefs> CheckerPrefsList;
 
+struct VerifierPrefs
+{
+	CheckerPrefsList checkerPrefsList;
+	bool showPagesWithoutErrors;
+	QString curCheckProfile;
+};
+
 struct TypoPrefs
 {
 	int valueSuperScript; //! Displacement of superscript
@@ -390,7 +397,7 @@
 	PluginPrefs pluginPrefs;
 	ShortWordPrefs shortwordPrefs;
 	ScripterPrefs scripterPrefs;
-	CheckerPrefsList checkerPrefsList;
+	VerifierPrefs verifierPrefs;
 	StoryEditorPrefs storyEditorPrefs;
 	PrintPreviewPrefs printPreviewPrefs;
 	ImageCachePrefs imageCachePrefs;
@@ -398,9 +405,9 @@
 	QList<ArrowDesc> arrowStyles;
 	QMap<QString, VGradient> defaultGradients;
 	QList<PageSet> pageSets;
-	QString curCheckProfile;
 
 
+
 	//TODO : Remove these no longer used items
 	//! System default QStyle name for current instance, seemingly unused
 	QString ui_SystemTheme;
Index: scribus/ui/checkDocument.cpp
===================================================================
--- scribus/ui/checkDocument.cpp	(revision 14848)
+++ scribus/ui/checkDocument.cpp	(revision 14849)
@@ -24,6 +24,7 @@
 #include "scribuscore.h"
 #include "scribusdoc.h"
 #include "page.h"
+#include "prefsmanager.h"
 #include "documentchecker.h"
 #include "util_icon.h"
 #include "util.h"
@@ -145,6 +146,8 @@
 	img.loadFromData( image2_data, sizeof( image2_data ), "PNG" );
 	noErrors = img;
 */
+	showPagesWithNoErrors=PrefsManager::instance()->appPrefs.verifierPrefs.showPagesWithoutErrors;
+
 	graveError = loadIcon("22/dialog-error.png");
 	onlyWarning = loadIcon("22/dialog-warning.png");
 	noErrors = loadIcon("ok.png");
@@ -223,6 +226,7 @@
 
 void CheckDocument::doReScan()
 {
+	showPagesWithNoErrors=PrefsManager::instance()->appPrefs.verifierPrefs.showPagesWithoutErrors;
 	newScan(curCheckProfile->currentText());
 }
 
@@ -452,8 +456,12 @@
 			QString tmp;
 			hasError = false;
 			pageGraveError = false;
-			QTreeWidgetItem * page = new QTreeWidgetItem( masterPageRootItem);//, pagep );
-			masterPageMap.insert(page, doc->MasterPages.at(mPage)->pageName());
+			QTreeWidgetItem * page=NULL;
+			if (showPagesWithNoErrors)
+			{
+				page = new QTreeWidgetItem( masterPageRootItem);
+				masterPageMap.insert(page, doc->MasterPages.at(mPage)->pageName());
+			}
 // 			pagep = page;
 			QMap<int, errorCodes>::Iterator masterItemErrorsIt;
 			for (masterItemErrorsIt = doc->masterItemErrors.begin();
@@ -463,6 +471,11 @@
 				if ((doc->MasterItems.at(masterItemErrorsIt.key())->OwnPage == mPage)
 					|| (doc->MasterItems.at(masterItemErrorsIt.key())->OnMasterPage == doc->MasterPages.at(mPage)->pageName()))
 				{
+					if (!showPagesWithNoErrors && page==NULL)
+					{
+						page = new QTreeWidgetItem( masterPageRootItem);
+						masterPageMap.insert(page, doc->MasterPages.at(mPage)->pageName());
+					}
 					hasError = true;
 					QTreeWidgetItem * object = new QTreeWidgetItem( page);
 					masterPageItemMap.insert(object, doc->MasterItems.at(masterItemErrorsIt.key())->ItemNr);
@@ -498,8 +511,12 @@
 				page->setExpanded( true );
 			}
 			else
-				page->setIcon(COLUMN_ITEM, noErrors );
-			page->setText(COLUMN_ITEM, doc->MasterPages.at(mPage)->pageName());
+			{
+				if (showPagesWithNoErrors && page!=NULL)
+					page->setIcon(COLUMN_ITEM, noErrors );
+			}
+			if (page!=NULL)
+				page->setText(COLUMN_ITEM, doc->MasterPages.at(mPage)->pageName());
 		}
 		masterPageRootItem->setExpanded(true);
 		masterPageRootItem->setText(COLUMN_PROBLEM, tr("Issue(s): %1").arg(mpErrorCount));
@@ -511,8 +528,12 @@
 			QString tmp;
 			hasError = false;
 			pageGraveError = false;
-			QTreeWidgetItem * page = new QTreeWidgetItem( reportDisplay);//, pagep );
-			pageMap.insert(page, aPage);
+			QTreeWidgetItem * page=NULL;
+			if (showPagesWithNoErrors)
+			{
+				page = new QTreeWidgetItem( reportDisplay);
+				pageMap.insert(page, aPage);
+			}
 // 			pagep = page;
 			QMap<int, errorCodes>::Iterator docItemErrorsIt;
 			for (docItemErrorsIt = doc->docItemErrors.begin();
@@ -521,6 +542,11 @@
 			{
 				if (doc->DocItems.at(docItemErrorsIt.key())->OwnPage == aPage)
 				{
+					if (!showPagesWithNoErrors && page==NULL)
+					{
+						page = new QTreeWidgetItem( reportDisplay);
+						pageMap.insert(page, aPage);
+					}
 					hasError = true;
 					itemError = false;
 					QTreeWidgetItem * object = new QTreeWidgetItem(page);
@@ -556,8 +582,12 @@
 				page->setExpanded( true );
 			}
 			else
-				page->setIcon( 0, noErrors );
-			page->setText(COLUMN_ITEM, tr("Page ")+tmp.setNum(aPage+1));
+			{
+				if (showPagesWithNoErrors && page!=NULL)
+					page->setIcon( 0, noErrors );
+			}
+			if (page!=NULL)
+				page->setText(COLUMN_ITEM, tr("Page ")+tmp.setNum(aPage+1));
 		}
 		// END of PAGES
 
Index: scribus/ui/prefs.cpp
===================================================================
--- scribus/ui/prefs.cpp	(revision 14848)
+++ scribus/ui/prefs.cpp	(revision 14849)
@@ -96,7 +96,7 @@
 	tabPrinter = new TabPrinter(prefsWidgets, "tabPrinter");
 	addItem( tr("Printer"), loadIcon("printer.png"), tabPrinter);
 
-	tabDocChecker = new TabCheckDoc(prefsWidgets, prefsData->checkerPrefsList, prefsData->curCheckProfile);
+	tabDocChecker = new TabCheckDoc(prefsWidgets, prefsData->verifierPrefs.checkerPrefsList, prefsData->verifierPrefs.curCheckProfile);
 	addItem( tr("Preflight Verifier"), loadIcon("checkdoc.png"), tabDocChecker);
 
 	if (ScCore->haveCMS())
@@ -212,7 +212,7 @@
 	// main performance issue in availFonts->GetFonts(HomeP)!
 	// no prefsData here
 	tabFonts->restoreDefaults();
-	tabDocChecker->restoreDefaults(&prefsData->checkerPrefsList, prefsData->curCheckProfile);
+	tabDocChecker->restoreDefaults(&prefsData->verifierPrefs.checkerPrefsList, prefsData->verifierPrefs.curCheckProfile);
 
 	QMap<QString, int> DocFonts;
 	DocFonts.clear();
@@ -458,8 +458,8 @@
 	prefsManager->appPrefs.guidesPrefs.marginColor = tabGuides->colorMargin;
 	prefsManager->appPrefs.guidesPrefs.guideColor = tabGuides->colorGuides;
 	prefsManager->appPrefs.guidesPrefs.baselineGridColor = tabGuides->colorBaselineGrid;
-	prefsManager->appPrefs.checkerPrefsList = tabDocChecker->checkerProfile;
-	prefsManager->appPrefs.curCheckProfile = tabDocChecker->curCheckProfile->currentText();
+	prefsManager->appPrefs.verifierPrefs.checkerPrefsList = tabDocChecker->checkerProfile;
+	prefsManager->appPrefs.verifierPrefs.curCheckProfile = tabDocChecker->curCheckProfile->currentText();
 	prefsManager->appPrefs.typoPrefs.valueSuperScript = tabTypo->superDisplacement->value();
 	prefsManager->appPrefs.typoPrefs.scalingSuperScript = tabTypo->superScaling->value();
 	prefsManager->appPrefs.typoPrefs.valueSubScript = tabTypo->subDisplacement->value();
Index: scribus/ui/prefs_preflightverifierbase.ui
===================================================================
--- scribus/ui/prefs_preflightverifierbase.ui	(revision 14848)
+++ scribus/ui/prefs_preflightverifierbase.ui	(revision 14849)
@@ -36,6 +36,42 @@
     </widget>
    </item>
    <item>
+    <widget class="QCheckBox" name="showPagesWithoutErrorsCheckBox">
+     <property name="text">
+      <string>Verifier window shows pages without errors</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <spacer name="verticalSpacer_3">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Minimum</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item>
+    <widget class="QLabel" name="label_6">
+     <property name="font">
+      <font>
+       <weight>75</weight>
+       <bold>true</bold>
+      </font>
+     </property>
+     <property name="text">
+      <string>Profile Setup</string>
+     </property>
+    </widget>
+   </item>
+   <item>
     <widget class="QScrollArea" name="scrollArea">
      <property name="widgetResizable">
       <bool>true</bool>
@@ -46,7 +82,7 @@
         <x>0</x>
         <y>0</y>
         <width>595</width>
-        <height>641</height>
+        <height>564</height>
        </rect>
       </property>
       <layout class="QVBoxLayout" name="verticalLayout_2">
Index: scribus/ui/prefs_preflightverifier.cpp
===================================================================
--- scribus/ui/prefs_preflightverifier.cpp	(revision 14848)
+++ scribus/ui/prefs_preflightverifier.cpp	(revision 14849)
@@ -47,13 +47,14 @@
 
 void Prefs_PreflightVerifier::restoreDefaults(struct ApplicationPrefs *prefsData)
 {
-	checkerProfile = prefsData->checkerPrefsList;
+	showPagesWithoutErrorsCheckBox->setChecked(prefsData->verifierPrefs.showPagesWithoutErrors);
+	checkerProfile = prefsData->verifierPrefs.checkerPrefsList;
 	currentProfileComboBox->clear();
 	CheckerPrefsList::Iterator it;
 	currentProfileComboBox->clear();
 	for (it = checkerProfile.begin(); it != checkerProfile.end(); ++it)
 		currentProfileComboBox->addItem(it.key());
-	QString prefProfile(prefsData->curCheckProfile);
+	QString prefProfile(prefsData->verifierPrefs.curCheckProfile);
 	setCurrentComboItem(currentProfileComboBox, prefProfile);
 	ignoreAllErrorsCheckBox->setChecked(checkerProfile[prefProfile].ignoreErrors);
 	autoCheckBeforePrintExportCheckBox->setChecked(checkerProfile[prefProfile].autoCheck);
@@ -79,8 +80,9 @@
 
 void Prefs_PreflightVerifier::saveGuiToPrefs(struct ApplicationPrefs *prefsData) const
 {
-	prefsData->checkerPrefsList = checkerProfile;
-	prefsData->curCheckProfile = currentProfileComboBox->currentText();
+	prefsData->verifierPrefs.showPagesWithoutErrors=showPagesWithoutErrorsCheckBox->isChecked();
+	prefsData->verifierPrefs.checkerPrefsList = checkerProfile;
+	prefsData->verifierPrefs.curCheckProfile = currentProfileComboBox->currentText();
 
 }
 
Index: scribus/ui/checkDocument.h
===================================================================
--- scribus/ui/checkDocument.h	(revision 14848)
+++ scribus/ui/checkDocument.h	(revision 14849)
@@ -89,15 +89,15 @@
 	//! \brief Signal emitted when user press the "ignore errors" button.
 	void ignoreAllErrors();
 
+
+
+protected slots:
+	virtual void languageChange();
+
 protected:
 	QVBoxLayout* checkDocumentLayout;
 	QHBoxLayout* layout1;
 	QHBoxLayout* layout2;
-
-protected slots:
-	virtual void languageChange();
-
-private:
 	//! \brief Mappping Page Item - item nr.
 	QMap<QTreeWidgetItem*, int> itemMap;
 	//! \brief Mappping Page - page nr.
@@ -142,6 +142,7 @@
 // 	bool globalGraveError;
 	bool pageGraveError;
 	bool itemError;
+	bool showPagesWithNoErrors;
 
 	int minResDPI;
 	int maxResDPI;




More information about the scribus-commit mailing list