r14850 by cbradney - #8794: Add in extra option to only show errors for items on layers that are set to print

scribus-commit scribus-commit at lists.scribus.net
Thu Mar 4 00:30:31 CET 2010


Revision: 14850
Author: cbradney
Date: 2010-03-03T23:26:24.720209Z
Commit message: #8794: Add in extra option to only show errors for items on layers that are set to print

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_preflightverifier.cpp
M  /trunk/Scribus/scribus/ui/checkDocument.h
M  /trunk/Scribus/scribus/ui/prefs_preflightverifierbase.ui

Diffs:
Index: scribus/prefsmanager.cpp
===================================================================
--- scribus/prefsmanager.cpp	(revision 14849)
+++ scribus/prefsmanager.cpp	(revision 14850)
@@ -434,6 +434,7 @@
 	initDefaultCheckerPrefs(&appPrefs.verifierPrefs.checkerPrefsList);
 	appPrefs.verifierPrefs.curCheckProfile = CommonStrings::PostScript;
 	appPrefs.verifierPrefs.showPagesWithoutErrors=false;
+	appPrefs.verifierPrefs.showNonPrintingLayerErrors=false;
 	appPrefs.pdfPrefs.Thumbnails = false;
 	appPrefs.pdfPrefs.Articles = false;
 	appPrefs.pdfPrefs.useLayers = false;
@@ -1485,6 +1486,7 @@
 	QDomElement dc79ac=docu.createElement("Checker");
 	dc79ac.setAttribute("currentProfile", appPrefs.verifierPrefs.curCheckProfile);
 	dc79ac.setAttribute("ShowPagesWithoutErrors", appPrefs.verifierPrefs.showPagesWithoutErrors);
+	dc79ac.setAttribute("ShowNonPrintingLayerErrors", appPrefs.verifierPrefs.showNonPrintingLayerErrors);
 	elem.appendChild(dc79ac);
 	CheckerPrefsList::Iterator itcp;
 	CheckerPrefsList::Iterator itcpend=appPrefs.verifierPrefs.checkerPrefsList.end();
@@ -2155,6 +2157,7 @@
 		{
 			appPrefs.verifierPrefs.curCheckProfile = dc.attribute("currentProfile", CommonStrings::PostScript);
 			appPrefs.verifierPrefs.showPagesWithoutErrors = static_cast<bool>(dc.attribute("ShowPagesWithoutErrors", "0").toInt());
+			appPrefs.verifierPrefs.showNonPrintingLayerErrors = static_cast<bool>(dc.attribute("ShowNonPrintingLayerErrors", "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.verifierPrefs.curCheckProfile == tr("PostScript")) ||
Index: scribus/prefsstructs.h
===================================================================
--- scribus/prefsstructs.h	(revision 14849)
+++ scribus/prefsstructs.h	(revision 14850)
@@ -49,6 +49,7 @@
 {
 	CheckerPrefsList checkerPrefsList;
 	bool showPagesWithoutErrors;
+	bool showNonPrintingLayerErrors;
 	QString curCheckProfile;
 };
 
Index: scribus/ui/checkDocument.cpp
===================================================================
--- scribus/ui/checkDocument.cpp	(revision 14849)
+++ scribus/ui/checkDocument.cpp	(revision 14850)
@@ -146,7 +146,8 @@
 	img.loadFromData( image2_data, sizeof( image2_data ), "PNG" );
 	noErrors = img;
 */
-	showPagesWithNoErrors=PrefsManager::instance()->appPrefs.verifierPrefs.showPagesWithoutErrors;
+	showPagesWithoutErrors=PrefsManager::instance()->appPrefs.verifierPrefs.showPagesWithoutErrors;
+	showNonPrintingLayerErrors=PrefsManager::instance()->appPrefs.verifierPrefs.showNonPrintingLayerErrors;
 
 	graveError = loadIcon("22/dialog-error.png");
 	onlyWarning = loadIcon("22/dialog-warning.png");
@@ -226,7 +227,8 @@
 
 void CheckDocument::doReScan()
 {
-	showPagesWithNoErrors=PrefsManager::instance()->appPrefs.verifierPrefs.showPagesWithoutErrors;
+	showPagesWithoutErrors=PrefsManager::instance()->appPrefs.verifierPrefs.showPagesWithoutErrors;
+	showNonPrintingLayerErrors=PrefsManager::instance()->appPrefs.verifierPrefs.showNonPrintingLayerErrors;
 	newScan(curCheckProfile->currentText());
 }
 
@@ -457,7 +459,7 @@
 			hasError = false;
 			pageGraveError = false;
 			QTreeWidgetItem * page=NULL;
-			if (showPagesWithNoErrors)
+			if (showPagesWithoutErrors)
 			{
 				page = new QTreeWidgetItem( masterPageRootItem);
 				masterPageMap.insert(page, doc->MasterPages.at(mPage)->pageName());
@@ -468,10 +470,14 @@
 				 masterItemErrorsIt != doc->masterItemErrors.end();
 				 ++masterItemErrorsIt)
 			{
-				if ((doc->MasterItems.at(masterItemErrorsIt.key())->OwnPage == mPage)
+				if (((doc->MasterItems.at(masterItemErrorsIt.key())->OwnPage == mPage)
 					|| (doc->MasterItems.at(masterItemErrorsIt.key())->OnMasterPage == doc->MasterPages.at(mPage)->pageName()))
+					&&
+					((showNonPrintingLayerErrors) ||
+					(!showNonPrintingLayerErrors && doc->layerPrintable(doc->MasterItems.at(masterItemErrorsIt.key())->LayerID)))
+					)
 				{
-					if (!showPagesWithNoErrors && page==NULL)
+					if (!showPagesWithoutErrors && page==NULL)
 					{
 						page = new QTreeWidgetItem( masterPageRootItem);
 						masterPageMap.insert(page, doc->MasterPages.at(mPage)->pageName());
@@ -512,7 +518,7 @@
 			}
 			else
 			{
-				if (showPagesWithNoErrors && page!=NULL)
+				if (showPagesWithoutErrors && page!=NULL)
 					page->setIcon(COLUMN_ITEM, noErrors );
 			}
 			if (page!=NULL)
@@ -529,7 +535,7 @@
 			hasError = false;
 			pageGraveError = false;
 			QTreeWidgetItem * page=NULL;
-			if (showPagesWithNoErrors)
+			if (showPagesWithoutErrors)
 			{
 				page = new QTreeWidgetItem( reportDisplay);
 				pageMap.insert(page, aPage);
@@ -540,9 +546,12 @@
 				 docItemErrorsIt != doc->docItemErrors.end();
 				 ++docItemErrorsIt)
 			{
-				if (doc->DocItems.at(docItemErrorsIt.key())->OwnPage == aPage)
+				if (doc->DocItems.at(docItemErrorsIt.key())->OwnPage == aPage &&
+					((showNonPrintingLayerErrors) ||
+					(!showNonPrintingLayerErrors && doc->layerPrintable(doc->DocItems.at(docItemErrorsIt.key())->LayerID)))
+					)
 				{
-					if (!showPagesWithNoErrors && page==NULL)
+					if (!showPagesWithoutErrors && page==NULL)
 					{
 						page = new QTreeWidgetItem( reportDisplay);
 						pageMap.insert(page, aPage);
@@ -583,7 +592,7 @@
 			}
 			else
 			{
-				if (showPagesWithNoErrors && page!=NULL)
+				if (showPagesWithoutErrors && page!=NULL)
 					page->setIcon( 0, noErrors );
 			}
 			if (page!=NULL)
Index: scribus/ui/prefs_preflightverifierbase.ui
===================================================================
--- scribus/ui/prefs_preflightverifierbase.ui	(revision 14849)
+++ scribus/ui/prefs_preflightverifierbase.ui	(revision 14850)
@@ -38,11 +38,18 @@
    <item>
     <widget class="QCheckBox" name="showPagesWithoutErrorsCheckBox">
      <property name="text">
-      <string>Verifier window shows pages without errors</string>
+      <string>Show pages without errors</string>
      </property>
     </widget>
    </item>
    <item>
+    <widget class="QCheckBox" name="showNonPrintingLayerErrorsCheckBox">
+     <property name="text">
+      <string>Show errors for items on layers that will not print</string>
+     </property>
+    </widget>
+   </item>
+   <item>
     <spacer name="verticalSpacer_3">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
@@ -82,7 +89,7 @@
         <x>0</x>
         <y>0</y>
         <width>595</width>
-        <height>564</height>
+        <height>543</height>
        </rect>
       </property>
       <layout class="QVBoxLayout" name="verticalLayout_2">
Index: scribus/ui/prefs_preflightverifier.cpp
===================================================================
--- scribus/ui/prefs_preflightverifier.cpp	(revision 14849)
+++ scribus/ui/prefs_preflightverifier.cpp	(revision 14850)
@@ -48,6 +48,7 @@
 void Prefs_PreflightVerifier::restoreDefaults(struct ApplicationPrefs *prefsData)
 {
 	showPagesWithoutErrorsCheckBox->setChecked(prefsData->verifierPrefs.showPagesWithoutErrors);
+	showNonPrintingLayerErrorsCheckBox->setChecked(prefsData->verifierPrefs.showNonPrintingLayerErrors);
 	checkerProfile = prefsData->verifierPrefs.checkerPrefsList;
 	currentProfileComboBox->clear();
 	CheckerPrefsList::Iterator it;
@@ -81,6 +82,7 @@
 void Prefs_PreflightVerifier::saveGuiToPrefs(struct ApplicationPrefs *prefsData) const
 {
 	prefsData->verifierPrefs.showPagesWithoutErrors=showPagesWithoutErrorsCheckBox->isChecked();
+	prefsData->verifierPrefs.showNonPrintingLayerErrors=showNonPrintingLayerErrorsCheckBox->isChecked();
 	prefsData->verifierPrefs.checkerPrefsList = checkerProfile;
 	prefsData->verifierPrefs.curCheckProfile = currentProfileComboBox->currentText();
 
Index: scribus/ui/checkDocument.h
===================================================================
--- scribus/ui/checkDocument.h	(revision 14849)
+++ scribus/ui/checkDocument.h	(revision 14850)
@@ -142,7 +142,8 @@
 // 	bool globalGraveError;
 	bool pageGraveError;
 	bool itemError;
-	bool showPagesWithNoErrors;
+	bool showPagesWithoutErrors;
+	bool showNonPrintingLayerErrors;
 
 	int minResDPI;
 	int maxResDPI;




More information about the scribus-commit mailing list