Beispiel #1
0
void TabCheckDoc::restoreDefaults(CheckerPrefsList *prefsData, QString prefProfile)
{
	checkerProfile = *prefsData;
	curCheckProfile->clear();
	CheckerPrefsList::Iterator it;
	curCheckProfile->clear();
	for (it = checkerProfile.begin(); it != checkerProfile.end(); ++it)
		curCheckProfile->addItem(it.key());
	setCurrentComboItem(curCheckProfile, prefProfile);
	ignoreErrors->setChecked(checkerProfile[prefProfile].ignoreErrors);
	automaticCheck->setChecked(checkerProfile[prefProfile].autoCheck);
	missingGlyphs->setChecked(checkerProfile[prefProfile].checkGlyphs);
	checkOrphans->setChecked(checkerProfile[prefProfile].checkOrphans);
	textOverflow->setChecked(checkerProfile[prefProfile].checkOverflow);
	tranparentObjects->setChecked(checkerProfile[prefProfile].checkTransparency);
	missingPictures->setChecked(checkerProfile[prefProfile].checkPictures);
	pictResolution->setChecked(checkerProfile[prefProfile].checkResolution);
	useAnnotations->setChecked(checkerProfile[prefProfile].checkAnnotations);
	rasterPDF->setChecked(checkerProfile[prefProfile].checkRasterPDF);
	checkForGIF->setChecked(checkerProfile[prefProfile].checkForGIF);
	ignoreOffLayers->setChecked(checkerProfile[prefProfile].ignoreOffLayers);
	checkOffConflictLayers->setChecked(checkerProfile[prefProfile].checkOffConflictLayers);
	resolutionValue->setValue( qRound(checkerProfile[prefProfile].minResolution) );
	resolutionValueM->setValue( qRound(checkerProfile[prefProfile].maxResolution) );
	currentProfile = prefProfile;
	if (checkerProfile.count() == 1)
		removeProfile->setEnabled(false);
	addProfile->setEnabled(false);
	tempNewProfileName="";
}
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;
	currentProfileComboBox->clear();
	for (it = checkerProfile.begin(); it != checkerProfile.end(); ++it)
		currentProfileComboBox->addItem(it.key());
	QString prefProfile(prefsData->verifierPrefs.curCheckProfile);
	setCurrentComboItem(currentProfileComboBox, prefProfile);
	ignoreAllErrorsCheckBox->setChecked(checkerProfile[prefProfile].ignoreErrors);
	autoCheckBeforePrintExportCheckBox->setChecked(checkerProfile[prefProfile].autoCheck);
	checkMissingGlyphsCheckBox->setChecked(checkerProfile[prefProfile].checkGlyphs);
	checkItemsNotOnAPageCheckBox->setChecked(checkerProfile[prefProfile].checkOrphans);
	checkTextOverflowCheckBox->setChecked(checkerProfile[prefProfile].checkOverflow);
	checkTransparenciesCheckBox->setChecked(checkerProfile[prefProfile].checkTransparency);
	checkMissingImagesCheckBox->setChecked(checkerProfile[prefProfile].checkPictures);
	checkImageResolutionCheckBox->setChecked(checkerProfile[prefProfile].checkResolution);
	checkPDFAnnotFieldsCheckBox->setChecked(checkerProfile[prefProfile].checkAnnotations);
	checkPlacedPDFCheckBox->setChecked(checkerProfile[prefProfile].checkRasterPDF);
	checkGIFsCheckBox->setChecked(checkerProfile[prefProfile].checkForGIF);
	checkNonPrintableLayersCheckBox->setChecked(checkerProfile[prefProfile].ignoreOffLayers);
	checkVisiblePrintableLayersCheckBox->setChecked(checkerProfile[prefProfile].checkOffConflictLayers);
	minimumResolutionSpinBox->setValue( qRound(checkerProfile[prefProfile].minResolution) );
	maximumResolutionSpinBox->setValue( qRound(checkerProfile[prefProfile].maxResolution) );
	currentProfile = prefProfile;
	if (checkerProfile.count() == 1)
		removeProfilePushButton->setEnabled(false);
	addProfilePushButton->setEnabled(false);
	tempNewProfileName="";
}
Beispiel #3
0
void TabCheckDoc::addProf()
{
	struct checkerPrefs checkerSettings;
	checkerSettings.ignoreErrors = ignoreErrors->isChecked();
	checkerSettings.autoCheck = automaticCheck->isChecked();
	checkerSettings.checkGlyphs = missingGlyphs->isChecked();
	checkerSettings.checkOrphans = checkOrphans->isChecked();
	checkerSettings.checkOverflow = textOverflow->isChecked();
	checkerSettings.checkPictures = missingPictures->isChecked();
	checkerSettings.checkResolution = pictResolution->isChecked();
	checkerSettings.checkTransparency =  tranparentObjects->isChecked();
	checkerSettings.minResolution = resolutionValue->value();
	checkerSettings.maxResolution = resolutionValueM->value();
	checkerSettings.checkAnnotations = useAnnotations->isChecked();
	checkerSettings.checkRasterPDF = rasterPDF->isChecked();
	checkerSettings.checkForGIF = checkForGIF->isChecked();
	checkerSettings.ignoreOffLayers = ignoreOffLayers->isChecked();
	checkerSettings.checkOffConflictLayers = checkOffConflictLayers->isChecked();
	checkerProfile.insert(tempNewProfileName, checkerSettings);
	currentProfile = tempNewProfileName;
	if (checkerProfile.count() > 1)
		removeProfile->setEnabled(true);
	addProfile->setEnabled(false);
	curCheckProfile->clear();
	
	disconnect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&)));
	disconnect(curCheckProfile, SIGNAL(editTextChanged(const QString&)), this, SLOT(setProfile(const QString&)));	
	CheckerPrefsList::Iterator it;
	int j,i=0;
	for (it = checkerProfile.begin(), j=0; it != checkerProfile.end(); ++it, ++j)
	{
		curCheckProfile->addItem(it.key());
		if (it.key()==currentProfile)
			i=j;
	}
	curCheckProfile->setCurrentIndex(i);
	connect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&)));
	connect(curCheckProfile, SIGNAL(editTextChanged(const QString&)), this, SLOT(setProfile(const QString&)));
	tempNewProfileName="";
}
void Prefs_PreflightVerifier::addProf()
{
	struct CheckerPrefs checkerSettings;
	checkerSettings.ignoreErrors = ignoreAllErrorsCheckBox->isChecked();
	checkerSettings.autoCheck = autoCheckBeforePrintExportCheckBox->isChecked();
	checkerSettings.checkGlyphs = checkMissingGlyphsCheckBox->isChecked();
	checkerSettings.checkOrphans = checkItemsNotOnAPageCheckBox->isChecked();
	checkerSettings.checkOverflow = checkTextOverflowCheckBox->isChecked();
	checkerSettings.checkPictures = checkMissingImagesCheckBox->isChecked();
	checkerSettings.checkResolution = checkImageResolutionCheckBox->isChecked();
	checkerSettings.checkTransparency =  checkTransparenciesCheckBox->isChecked();
	checkerSettings.minResolution = minimumResolutionSpinBox->value();
	checkerSettings.maxResolution = maximumResolutionSpinBox->value();
	checkerSettings.checkAnnotations = checkPDFAnnotFieldsCheckBox->isChecked();
	checkerSettings.checkRasterPDF = checkPlacedPDFCheckBox->isChecked();
	checkerSettings.checkForGIF = checkGIFsCheckBox->isChecked();
	checkerSettings.ignoreOffLayers = checkNonPrintableLayersCheckBox->isChecked();
	checkerSettings.checkOffConflictLayers = checkVisiblePrintableLayersCheckBox->isChecked();
	checkerProfile.insert(tempNewProfileName, checkerSettings);
	currentProfile = tempNewProfileName;
	if (checkerProfile.count() > 1)
		removeProfilePushButton->setEnabled(true);
	addProfilePushButton->setEnabled(false);
	currentProfileComboBox->clear();

	disconnect(currentProfileComboBox, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&)));
	disconnect(currentProfileComboBox, SIGNAL(textChanged(const QString&)), this, SLOT(setProfile(const QString&)));
	CheckerPrefsList::Iterator it;
	int j,i=0;
	for (it = checkerProfile.begin(), j=0; it != checkerProfile.end(); ++it, ++j)
	{
		currentProfileComboBox->addItem(it.key());
		if (it.key()==currentProfile)
			i=j;
	}
	currentProfileComboBox->setCurrentIndex(i);
	connect(currentProfileComboBox, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&)));
	connect(currentProfileComboBox, SIGNAL(textChanged(const QString&)), this, SLOT(setProfile(const QString&)));
	tempNewProfileName="";
}
Beispiel #5
0
void TabCheckDoc::delProf()
{
	disconnect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&)));
	disconnect(curCheckProfile, SIGNAL(editTextChanged(const QString&)), this, SLOT(setProfile(const QString&)));
	checkerProfile.remove(currentProfile);
	updateProfile(checkerProfile.begin().key());
	curCheckProfile->clear();
	CheckerPrefsList::Iterator it;
	CheckerPrefsList::Iterator itend=checkerProfile.end();
	for (it = checkerProfile.begin(); it != itend; ++it)
		curCheckProfile->addItem(it.key());
	setCurrentComboItem(curCheckProfile, currentProfile);
	connect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&)));
	connect(curCheckProfile, SIGNAL(editTextChanged(const QString&)), this, SLOT(setProfile(const QString&)));
	if (checkerProfile.count() == 1)
		removeProfile->setEnabled(false);
}
void Prefs_PreflightVerifier::delProf()
{
	disconnect(currentProfileComboBox, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&)));
	disconnect(currentProfileComboBox, SIGNAL(textChanged(const QString&)), this, SLOT(setProfile(const QString&)));
	checkerProfile.remove(currentProfile);
	updateProfile(checkerProfile.begin().key());
	currentProfileComboBox->clear();
	CheckerPrefsList::Iterator it;
	CheckerPrefsList::Iterator itend=checkerProfile.end();
	for (it = checkerProfile.begin(); it != itend; ++it)
		currentProfileComboBox->addItem(it.key());
	setCurrentComboItem(currentProfileComboBox, currentProfile);
	connect(currentProfileComboBox, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&)));
	connect(currentProfileComboBox, SIGNAL(textChanged(const QString&)), this, SLOT(setProfile(const QString&)));
	if (checkerProfile.count() == 1)
		removeProfilePushButton->setEnabled(false);
}
void CheckDocument::buildErrorList(ScribusDoc *doc)
{
// 	bool resultError = false;
	m_Doc = doc;
	disconnect(curCheckProfile, SIGNAL(activated(const QString&)),
	           this, SLOT(newScan(const QString&)));
	curCheckProfile->clear();
	clearErrorList();

	if (m_Doc==0)
		return;

	minResDPI = qRound(doc->checkerProfiles[doc->curCheckProfile].minResolution);
	maxResDPI = qRound(doc->checkerProfiles[doc->curCheckProfile].maxResolution);
	
	CheckerPrefsList::Iterator it;
	CheckerPrefsList::Iterator itend=doc->checkerProfiles.end();
	for (it = doc->checkerProfiles.begin(); it != itend ; ++it)
		curCheckProfile->addItem(it.key());
	setCurrentComboItem(curCheckProfile, doc->curCheckProfile);

	if ((doc->docItemErrors.count() == 0)
		 && (doc->masterItemErrors.count() == 0)
		 && (doc->docLayerErrors.count() == 0))
	{
		QTreeWidgetItem * documentItem = new QTreeWidgetItem( reportDisplay );
		documentItem->setText(COLUMN_ITEM, tr( "Document" ) );
		documentItem->setIcon(COLUMN_ITEM, noErrors );
		documentItem->setText(COLUMN_PROBLEM, tr( "No Problems found" ) );
		ignoreErrors->setText( tr("OK"));
	}
	else
	{
// 		resultError = true;
		bool hasError = false;
// 		globalGraveError = false;
		bool layoutGraveError = false;
		itemError = false;
// 		QTreeWidgetItem * pagep = 0;
		// LAYERS **********************************************8
		QTreeWidgetItem * layerItem = new QTreeWidgetItem(reportDisplay);
		layerItem->setText(COLUMN_ITEM, tr("Layers"));

		if (doc->docLayerErrors.count() != 0)
		{
			QMap<int, errorCodes>::Iterator docLayerErrorsIt;
			errorCodes::Iterator layerErrorsIt;

			for (docLayerErrorsIt = doc->docLayerErrors.begin();
				 docLayerErrorsIt != doc->docLayerErrors.end();
				 ++docLayerErrorsIt)
			{
				QTreeWidgetItem * layer = new QTreeWidgetItem(layerItem);//, pagep );
				for (layerErrorsIt = docLayerErrorsIt.value().begin();
					 layerErrorsIt != docLayerErrorsIt.value().end(); ++layerErrorsIt)
				{
					QTreeWidgetItem * errorText = new QTreeWidgetItem( layer, 0 );
					switch (layerErrorsIt.key())
					{
						case Transparency:
							errorText->setText(COLUMN_ITEM, tr("Transparency used"));
							errorText->setIcon(COLUMN_ITEM, graveError );
							layoutGraveError = true;
							break;
						case BlendMode:
							errorText->setText(COLUMN_ITEM, tr("Blendmode used"));
							errorText->setIcon(COLUMN_ITEM, graveError );
							layoutGraveError = true;
							break;
						case OffConflictLayers:
							errorText->setText(COLUMN_ITEM, tr("Print/Visible Mismatch"));
							errorText->setIcon(COLUMN_ITEM, onlyWarning );
							layoutGraveError = true;
							break;
						default:
							break;
					}
				}
				layer->setText(COLUMN_ITEM,tr("Layer \"%1\"").arg(doc->layerName(docLayerErrorsIt.key())));
//				layer->setIcon(COLUMN_ITEM, graveError );
				if (layoutGraveError)
					layer->setIcon(COLUMN_ITEM, graveError );
				else
					layer->setIcon(COLUMN_ITEM, onlyWarning );
				layer->setText(COLUMN_PROBLEM, tr("Issue(s): %1").arg(doc->docLayerErrors[docLayerErrorsIt.key()].count()));
				layer->setExpanded(true);
// 				pagep = layer;
// 				globalGraveError = true;
			}
			layerItem->setExpanded(true);
		}
		// END of LAYERS

		// Master Pages *****************************************************
		QTreeWidgetItem * masterPageRootItem = new QTreeWidgetItem(reportDisplay);
		masterPageRootItem->setText(COLUMN_ITEM, tr("Master Pages"));
		int mpErrorCount = 0;

		for (int mPage = 0; mPage < doc->MasterPages.count(); ++mPage)
		{
			QString tmp;
			hasError = false;
			pageGraveError = false;
			QTreeWidgetItem * page = new QTreeWidgetItem( masterPageRootItem);//, pagep );
			masterPageMap.insert(page, doc->MasterPages.at(mPage));
// 			pagep = page;
			QMap<int, errorCodes>::Iterator masterItemErrorsIt;
			for (masterItemErrorsIt = doc->masterItemErrors.begin();
				 masterItemErrorsIt != doc->masterItemErrors.end();
				 ++masterItemErrorsIt)
			{
				if ((doc->MasterItems.at(masterItemErrorsIt.key())->OwnPage == mPage)
					|| (doc->MasterItems.at(masterItemErrorsIt.key())->OnMasterPage == doc->MasterPages.at(mPage)->pageName()))
				{
					hasError = true;
					QTreeWidgetItem * object = new QTreeWidgetItem( page);
					masterPageItemMap.insert(object, doc->MasterItems.at(masterItemErrorsIt.key()));
					object->setText(COLUMN_ITEM, doc->MasterItems.at(masterItemErrorsIt.key())->itemName());
					errorCodes::Iterator it3;
					if (masterItemErrorsIt.value().count() == 1)
					{
						it3 = masterItemErrorsIt.value().begin();
						buildItem(object, it3.key(), doc->MasterItems.at(masterItemErrorsIt.key()));
					}
					else
					{
						for (it3 = masterItemErrorsIt.value().begin(); it3 != masterItemErrorsIt.value().end(); ++it3)
						{
							QTreeWidgetItem * errorText = new QTreeWidgetItem( object, 0 );
							buildItem(errorText, it3.key(), doc->MasterItems.at(masterItemErrorsIt.key()));
						}
						object->setExpanded( true );
					}
					object->setIcon(COLUMN_ITEM, itemError ? graveError : onlyWarning);
				}
			}
			if (hasError)
			{
				++mpErrorCount;
				page->setIcon(COLUMN_ITEM, pageGraveError ? graveError : onlyWarning);
				page->setExpanded( true );
			}
			else
				page->setIcon(COLUMN_ITEM, noErrors );
			page->setText(COLUMN_ITEM, doc->MasterPages.at(mPage)->pageName());
		}
		masterPageRootItem->setExpanded(true);
		masterPageRootItem->setText(COLUMN_PROBLEM, tr("Issue(s): %1").arg(mpErrorCount));
		// END of MASTER PAGES

		// PAGES ********************************8
		for (int aPage = 0; aPage < doc->DocPages.count(); ++aPage)
		{
			QString tmp;
			hasError = false;
			pageGraveError = false;
			QTreeWidgetItem * page = new QTreeWidgetItem( reportDisplay);//, pagep );
			pageMap.insert(page, doc->DocPages.at(aPage));
// 			pagep = page;
			QMap<int, errorCodes>::Iterator docItemErrorsIt;
			for (docItemErrorsIt = doc->docItemErrors.begin();
				 docItemErrorsIt != doc->docItemErrors.end();
				 ++docItemErrorsIt)
			{
				if (doc->DocItems.at(docItemErrorsIt.key())->OwnPage == aPage)
				{
					hasError = true;
					itemError = false;
					QTreeWidgetItem * object = new QTreeWidgetItem(page);
					object->setText(COLUMN_ITEM, doc->DocItems.at(docItemErrorsIt.key())->itemName());
					itemMap.insert(object, doc->DocItems.at(docItemErrorsIt.key()));
					errorCodes::Iterator it3;
					if (docItemErrorsIt.value().count() == 1)
					{
						it3 = docItemErrorsIt.value().begin();
						buildItem(object, it3.key(), doc->DocItems.at(docItemErrorsIt.key()));
					}
					else
					{
						for (it3 = docItemErrorsIt.value().begin(); it3 != docItemErrorsIt.value().end(); ++it3)
						{
							QTreeWidgetItem * errorText = new QTreeWidgetItem( object);
							buildItem(errorText, it3.key(), doc->DocItems.at(docItemErrorsIt.key()));
						}
						object->setExpanded( true );
					}
					object->setIcon(COLUMN_ITEM, itemError ? graveError : onlyWarning);
				}
			}
			if (hasError)
			{
				page->setIcon(COLUMN_ITEM, itemError ? graveError : onlyWarning);
				page->setExpanded( true );
			}
			else
				page->setIcon( 0, noErrors );
			page->setText(COLUMN_ITEM, tr("Page ")+tmp.setNum(aPage+1));
		}
		// END of PAGES

		// FREE ITEMS **********************************************8888
		QMap<int, errorCodes>::Iterator freeItemsErrorsIt;
		bool hasfreeItems = false;
		for (freeItemsErrorsIt = doc->docItemErrors.begin();
			 freeItemsErrorsIt != doc->docItemErrors.end();
			 ++freeItemsErrorsIt)
		{
			if (doc->DocItems.at(freeItemsErrorsIt.key())->OwnPage == -1)
			{
				hasfreeItems = true;
				break;
			}
		}
		if (hasfreeItems)
		{
			bool hasError = false;
			bool pageGraveError = false;
			QTreeWidgetItem * freeItem = new QTreeWidgetItem( reportDisplay);//, pagep );
// 			pagep = page;
			for (freeItemsErrorsIt = doc->docItemErrors.begin();
				 freeItemsErrorsIt != doc->docItemErrors.end();
				 ++freeItemsErrorsIt)
			{
				if (doc->DocItems.at(freeItemsErrorsIt.key())->OwnPage == -1)
				{
					hasError = true;
					QTreeWidgetItem * object = new QTreeWidgetItem(freeItem);
					object->setText(0, doc->DocItems.at(freeItemsErrorsIt.key())->itemName());
					itemMap.insert(object, doc->DocItems.at(freeItemsErrorsIt.key()));
					errorCodes::Iterator it3;
					if (freeItemsErrorsIt.value().count() == 1)
					{
						it3 = freeItemsErrorsIt.value().begin();
						buildItem(object, it3.key(), doc->DocItems.at(freeItemsErrorsIt.key()));
					}
					else
					{
						for (it3 = freeItemsErrorsIt.value().begin(); it3 != freeItemsErrorsIt.value().end(); ++it3)
						{
							QTreeWidgetItem * errorText = new QTreeWidgetItem( object);
							buildItem(errorText, it3.key(), doc->DocItems.at(freeItemsErrorsIt.key()));
						}
						object->setExpanded( true );
					}
					object->setIcon(COLUMN_ITEM, pageGraveError ? graveError : onlyWarning);
				}
			}
			if (hasError)
			{
				freeItem->setIcon(COLUMN_ITEM, pageGraveError ? graveError : onlyWarning );
				freeItem->setExpanded( true );
			}
			else
				freeItem->setIcon(COLUMN_ITEM, noErrors );
			freeItem->setText(COLUMN_ITEM, tr("Free Objects"));
		}
		// END of FREE ITEMS

// 		if (globalGraveError)
// 			documentItem->setIcon(COLUMN_ITEM, graveError );
// 		else
// 			documentItem->setIcon(COLUMN_ITEM, onlyWarning );
// 		documentItem->setText(COLUMN_PROBLEM, tr( "Problems found" ) );
// 		documentItem->setExpanded( true );
		ignoreErrors->setText( tr("&Ignore Errors"));
	}

	reportDisplay->resizeColumnToContents(COLUMN_ITEM);
	reportDisplay->resizeColumnToContents(COLUMN_PROBLEM);
	reportDisplay->resizeColumnToContents(COLUMN_LAYER);
// 	reportDisplay->resizeColumnToContents(COLUMN_INFO);
	connect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(newScan(const QString&)));
	connect(reportDisplay, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(slotSelect(QTreeWidgetItem*)));
}