Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 5238 → Rev 5239

/branches/Version13x/Scribus/scribus/documentchecker.cpp
42,6 → 42,7
checkerSettings.checkResolution = currDoc->checkerProfiles[currDoc->curCheckProfile].checkResolution;
checkerSettings.checkTransparency = currDoc->checkerProfiles[currDoc->curCheckProfile].checkTransparency;
checkerSettings.minResolution = currDoc->checkerProfiles[currDoc->curCheckProfile].minResolution;
checkerSettings.maxResolution = currDoc->checkerProfiles[currDoc->curCheckProfile].maxResolution;
checkerSettings.checkAnnotations = currDoc->checkerProfiles[currDoc->curCheckProfile].checkAnnotations;
checkerSettings.checkRasterPDF = currDoc->checkerProfiles[currDoc->curCheckProfile].checkRasterPDF;
currDoc->docItemErrors.clear();
80,6 → 81,9
if (((qRound(72.0 / currItem->imageXScale()) < checkerSettings.minResolution) || (qRound(72.0 / currItem->imageYScale()) < checkerSettings.minResolution))
&& (currItem->isRaster) && (checkerSettings.checkResolution))
itemError.insert(ImageDPITooLow, 0);
if (((qRound(72.0 / currItem->imageXScale()) > checkerSettings.maxResolution) || (qRound(72.0 / currItem->imageYScale()) > checkerSettings.maxResolution))
&& (currItem->isRaster) && (checkerSettings.checkResolution))
itemError.insert(ImageDPITooHigh, 0);
QFileInfo fi = QFileInfo(currItem->Pfile);
QString ext = fi.extension(false).lower();
if ((ext == "pdf") && (checkerSettings.checkRasterPDF))
185,6 → 189,9
if (((qRound(72.0 / currItem->imageYScale()) < checkerSettings.minResolution) || (qRound(72.0 / currItem->imageYScale()) < checkerSettings.minResolution))
&& (currItem->isRaster) && (checkerSettings.checkResolution))
itemError.insert(ImageDPITooLow, 0);
if (((qRound(72.0 / currItem->imageXScale()) > checkerSettings.maxResolution) || (qRound(72.0 / currItem->imageYScale()) > checkerSettings.maxResolution))
&& (currItem->isRaster) && (checkerSettings.checkResolution))
itemError.insert(ImageDPITooHigh, 0);
QFileInfo fi = QFileInfo(currItem->Pfile);
QString ext = fi.extension(false).lower();
if ((ext == "pdf") && (checkerSettings.checkRasterPDF))
/branches/Version13x/Scribus/scribus/fileloader.cpp
1196,6 → 1196,7
checkerSettings.checkResolution = static_cast<bool>(pg.attribute("checkResolution", "1").toInt());
checkerSettings.checkTransparency = static_cast<bool>(pg.attribute("checkTransparency", "1").toInt());
checkerSettings.minResolution = pg.attribute("minResolution", "72").toDouble();
checkerSettings.maxResolution = pg.attribute("maxResolution", "4800").toDouble();
checkerSettings.checkAnnotations = static_cast<bool>(pg.attribute("checkAnnotations", "0").toInt());
checkerSettings.checkRasterPDF = static_cast<bool>(pg.attribute("checkRasterPDF", "1").toInt());
doc->checkerProfiles[pg.attribute("Name")] = checkerSettings;
/branches/Version13x/Scribus/scribus/checkDocument.cpp
255,10 → 255,12
QString notOnPage = tr("Object is not on a Page");
QString missingImg = tr("Missing Image");
QString lowDPI = tr("Image resolution below %1 DPI, currently %2 x %3 DPI");
QString highDPI = tr("Image resolution above %1 DPI, currently %2 x %3 DPI");
QString transpar = tr("Object has transparency");
QString annot = tr("Object is a PDF Annotation or Field");
QString rasterPDF = tr("Object is a placed PDF");
int minRes = qRound(doc->checkerProfiles[doc->curCheckProfile].minResolution);
int maxRes = qRound(doc->checkerProfiles[doc->curCheckProfile].maxResolution);
int xres, yres;
QListViewItem * item = new QListViewItem( reportDisplay, 0 );
item->setText( 0, tr( "Document" ) );
320,6 → 322,11
yres = qRound(72.0 / doc->MasterItems.at(it2.key())->imageYScale());
object->setText(1, lowDPI.arg(minRes).arg(xres).arg(yres));
break;
case ImageDPITooHigh:
xres = qRound(72.0 / doc->MasterItems.at(it2.key())->imageXScale());
yres = qRound(72.0 / doc->MasterItems.at(it2.key())->imageYScale());
object->setText(1, highDPI.arg(maxRes).arg(xres).arg(yres));
break;
case Transparency:
object->setText(1, transpar);
hasGraveError = true;
369,6 → 376,12
errorText->setText(1, lowDPI.arg(minRes).arg(xres).arg(yres));
errorText->setPixmap( 0, onlyWarning );
break;
case ImageDPITooHigh:
xres = qRound(72.0 / doc->MasterItems.at(it2.key())->imageXScale());
yres = qRound(72.0 / doc->MasterItems.at(it2.key())->imageYScale());
errorText->setText(1, highDPI.arg(maxRes).arg(xres).arg(yres));
errorText->setPixmap( 0, onlyWarning );
break;
case Transparency:
errorText->setText(1, transpar);
errorText->setPixmap( 0, graveError );
453,6 → 466,11
yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale());
object->setText(1, lowDPI.arg(minRes).arg(xres).arg(yres));
break;
case ImageDPITooHigh:
xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale());
yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale());
object->setText(1, highDPI.arg(maxRes).arg(xres).arg(yres));
break;
case Transparency:
object->setText(1, transpar);
hasGraveError = true;
474,7 → 492,7
QListViewItem * errorText = new QListViewItem( object, 0 );
switch (it3.key())
{
case 1:
case MissingGlyph:
errorText->setText(1, missingGlyph);
errorText->setPixmap( 0, graveError );
hasGraveError = true;
481,15 → 499,15
pageGraveError = true;
itemError = true;
break;
case 2:
case TextOverflow:
errorText->setText(1, textOverflow);
errorText->setPixmap( 0, onlyWarning );
break;
case 3:
case ObjectNotOnPage:
errorText->setText(1, notOnPage);
errorText->setPixmap( 0, onlyWarning );
break;
case 4:
case MissingImage:
errorText->setText(1, missingImg);
errorText->setPixmap( 0, graveError );
hasGraveError = true;
496,13 → 514,19
pageGraveError = true;
itemError = true;
break;
case 5:
case ImageDPITooLow:
xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale());
yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale());
errorText->setText(1, lowDPI.arg(minRes).arg(xres).arg(yres));
errorText->setPixmap( 0, onlyWarning );
break;
case 6:
case ImageDPITooHigh:
xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale());
yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale());
errorText->setText(1, highDPI.arg(maxRes).arg(xres).arg(yres));
errorText->setPixmap( 0, onlyWarning );
break;
case Transparency:
errorText->setText(1, transpar);
errorText->setPixmap( 0, graveError );
hasGraveError = true;
509,11 → 533,11
pageGraveError = true;
itemError = true;
break;
case 7:
case PDFAnnotField:
errorText->setText(1, annot);
errorText->setPixmap( 0, onlyWarning );
break;
case 8:
case PlacedPDF:
errorText->setText(1, rasterPDF);
errorText->setPixmap( 0, onlyWarning );
break;
569,36 → 593,41
it3 = it2.data().begin();
switch (it3.key())
{
case 1:
case MissingGlyph:
object->setText(1, missingGlyph);
hasGraveError = true;
pageGraveError = true;
break;
case 2:
case TextOverflow:
object->setText(1, textOverflow);
break;
case 3:
case ObjectNotOnPage:
object->setText(1, notOnPage);
break;
case 4:
case MissingImage:
object->setText(1, missingImg);
hasGraveError = true;
pageGraveError = true;
break;
case 5:
case ImageDPITooLow:
xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale());
yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale());
object->setText(1, lowDPI.arg(minRes).arg(xres).arg(yres));
break;
case 6:
case ImageDPITooHigh:
xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale());
yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale());
object->setText(1, highDPI.arg(maxRes).arg(xres).arg(yres));
break;
case Transparency:
object->setText(1, transpar);
hasGraveError = true;
pageGraveError = true;
break;
case 7:
case PDFAnnotField:
object->setText(1, annot);
break;
case 8:
case PlacedPDF:
object->setText(1, rasterPDF);
break;
}
610,43 → 639,49
QListViewItem * errorText = new QListViewItem( object, 0 );
switch (it3.key())
{
case 1:
case MissingGlyph:
errorText->setText(1, missingGlyph);
errorText->setPixmap( 0, graveError );
hasGraveError = true;
pageGraveError = true;
break;
case 2:
case TextOverflow:
errorText->setText(1, textOverflow);
errorText->setPixmap( 0, onlyWarning );
break;
case 3:
case ObjectNotOnPage:
errorText->setText(1, notOnPage);
errorText->setPixmap( 0, onlyWarning );
break;
case 4:
case MissingImage:
errorText->setText(1, missingImg);
errorText->setPixmap( 0, graveError );
hasGraveError = true;
pageGraveError = true;
break;
case 5:
case ImageDPITooLow:
xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale());
yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale());
errorText->setText(1, lowDPI.arg(minRes).arg(xres).arg(yres));
errorText->setPixmap( 0, onlyWarning );
break;
case 6:
case ImageDPITooHigh:
xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale());
yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale());
errorText->setText(1, highDPI.arg(maxRes).arg(xres).arg(yres));
errorText->setPixmap( 0, onlyWarning );
break;
case Transparency:
errorText->setText(1, transpar);
errorText->setPixmap( 0, graveError );
hasGraveError = true;
pageGraveError = true;
break;
case 7:
case PDFAnnotField:
errorText->setText(1, annot);
errorText->setPixmap( 0, onlyWarning );
break;
case 8:
case PlacedPDF:
errorText->setText(1, rasterPDF);
errorText->setPixmap( 0, onlyWarning );
break;
/branches/Version13x/Scribus/scribus/prefsmanager.cpp
1060,6 → 1060,7
dc79a.setAttribute("checkAnnotations", static_cast<int>(itcp.data().checkAnnotations));
dc79a.setAttribute("checkRasterPDF", static_cast<int>(itcp.data().checkRasterPDF));
dc79a.setAttribute("minResolution",itcp.data().minResolution);
dc79a.setAttribute("maxResolution",itcp.data().maxResolution);
elem.appendChild(dc79a);
}
QDomElement dc81=docu.createElement("CMS");
1596,6 → 1597,7
checkerSettings.checkResolution = static_cast<bool>(dc.attribute("checkResolution", "1").toInt());
checkerSettings.checkTransparency = static_cast<bool>(dc.attribute("checkTransparency", "1").toInt());
checkerSettings.minResolution = dc.attribute("minResolution", "72").toDouble();
checkerSettings.maxResolution = dc.attribute("maxResolution", "4800").toDouble();
checkerSettings.checkAnnotations = static_cast<bool>(dc.attribute("checkAnnotations", "0").toInt());
checkerSettings.checkRasterPDF = static_cast<bool>(dc.attribute("checkRasterPDF", "1").toInt());
appPrefs.checkerProfiles[name] = checkerSettings;
1832,6 → 1834,7
checkerSettings.checkAnnotations = false;
checkerSettings.checkRasterPDF = true;
checkerSettings.minResolution = 72.0;
checkerSettings.maxResolution = 4800.0;
//TODO Stop translating these into settings!!!!!!!!!
cp->insert( QT_TR_NOOP("PostScript"), checkerSettings);
cp->insert( QT_TR_NOOP("PDF 1.3"), checkerSettings);
/branches/Version13x/Scribus/scribus/scribusXml.cpp
3099,6 → 3099,7
dc79a.setAttribute("checkResolution", static_cast<int>(itcp.data().checkResolution));
dc79a.setAttribute("checkTransparency", static_cast<int>(itcp.data().checkTransparency));
dc79a.setAttribute("minResolution",itcp.data().minResolution);
dc79a.setAttribute("maxResolution",itcp.data().maxResolution);
dc79a.setAttribute("checkAnnotations", static_cast<int>(itcp.data().checkAnnotations));
dc79a.setAttribute("checkRasterPDF", static_cast<int>(itcp.data().checkRasterPDF));
dc.appendChild(dc79a);
/branches/Version13x/Scribus/scribus/prefsstructs.h
27,6 → 27,7
bool checkPictures;
bool checkResolution;
double minResolution;
double maxResolution;
bool checkTransparency;
bool checkAnnotations;
bool checkRasterPDF;
/branches/Version13x/Scribus/scribus/scribusstructs.h
284,7 → 284,8
ImageDPITooLow=5,
Transparency=6,
PDFAnnotField=7,
PlacedPDF=8
PlacedPDF=8,
ImageDPITooHigh=9
} PreflightError;
 
typedef QMap<PreflightError, int> errorCodes;
/branches/Version13x/Scribus/scribus/tabcheckdoc.cpp
61,16 → 61,24
pictResolution->setColumnLayout(0, Qt::Vertical );
pictResolution->layout()->setSpacing( 5 );
pictResolution->layout()->setMargin( 10 );
pictResolutionLayout = new QHBoxLayout( pictResolution->layout() );
pictResolutionLayout = new QGridLayout( pictResolution->layout() );
pictResolutionLayout->setAlignment( Qt::AlignTop );
textLabel1 = new QLabel( pictResolution, "textLabel1" );
textLabel1->setText( tr( "Lowest allowed resolution" ) );
pictResolutionLayout->addWidget( textLabel1 );
pictResolutionLayout->addWidget( textLabel1, 0, 0 );
resolutionValue = new QSpinBox( pictResolution, "resolutionValue" );
resolutionValue->setMaxValue( 3600 );
resolutionValue->setMaxValue( 4800 );
resolutionValue->setMinValue( 10 );
resolutionValue->setSuffix( tr( " dpi" ) );
pictResolutionLayout->addWidget( resolutionValue );
pictResolutionLayout->addWidget( resolutionValue, 1, 0 );
textLabel1m = new QLabel( pictResolution, "textLabel1m" );
textLabel1m->setText( tr( "Highest allowed resolution" ) );
pictResolutionLayout->addWidget( textLabel1m, 0, 1 );
resolutionValueM = new QSpinBox( pictResolution, "resolutionValue" );
resolutionValueM->setMaxValue( 4800 );
resolutionValueM->setMinValue( 10 );
resolutionValueM->setSuffix( tr( " dpi" ) );
pictResolutionLayout->addWidget( resolutionValueM, 1, 1 );
TabCheckDocLayout->addWidget( pictResolution );
rasterPDF = new QCheckBox( this, "rasterPDF" );
rasterPDF->setText( tr( "Check for placed PDF Files" ) );
99,6 → 107,7
useAnnotations->setChecked(checkerProfile[prefProfile].checkAnnotations);
rasterPDF->setChecked(checkerProfile[prefProfile].checkRasterPDF);
resolutionValue->setValue( qRound(checkerProfile[prefProfile].minResolution) );
resolutionValueM->setValue( qRound(checkerProfile[prefProfile].maxResolution) );
currentProfile = prefProfile;
if (checkerProfile.count() == 1)
removeProfile->setEnabled(false);
118,6 → 127,7
connect(useAnnotations, SIGNAL(clicked()), this, SLOT(putProfile()));
connect(rasterPDF, SIGNAL(clicked()), this, SLOT(putProfile()));
connect(resolutionValue, SIGNAL(valueChanged(int)), this, SLOT(putProfile()));
connect(resolutionValueM, SIGNAL(valueChanged(int)), this, SLOT(putProfile()));
connect(removeProfile, SIGNAL(clicked()), this, SLOT(delProf()));
connect(addProfile, SIGNAL(clicked()), this, SLOT(addProf()));
141,6 → 151,7
checkerProfile[currentProfile].checkResolution = pictResolution->isChecked();
checkerProfile[currentProfile].checkTransparency = tranparentObjects->isChecked();
checkerProfile[currentProfile].minResolution = resolutionValue->value();
checkerProfile[currentProfile].maxResolution = resolutionValueM->value();
checkerProfile[currentProfile].checkAnnotations = useAnnotations->isChecked();
checkerProfile[currentProfile].checkRasterPDF = rasterPDF->isChecked();
}
172,6 → 183,7
disconnect(pictResolution, SIGNAL(toggled(bool)), this, SLOT(putProfile()));
disconnect(tranparentObjects, SIGNAL(clicked()), this, SLOT(putProfile()));
disconnect(resolutionValue, SIGNAL(valueChanged(int)), this, SLOT(putProfile()));
disconnect(resolutionValueM, SIGNAL(valueChanged(int)), this, SLOT(putProfile()));
disconnect(rasterPDF, SIGNAL(clicked()), this, SLOT(putProfile()));
disconnect(useAnnotations, SIGNAL(clicked()), this, SLOT(putProfile()));
ignoreErrors->setChecked(checkerProfile[name].ignoreErrors);
183,6 → 195,7
missingPictures->setChecked(checkerProfile[name].checkPictures);
pictResolution->setChecked(checkerProfile[name].checkResolution);
resolutionValue->setValue( qRound(checkerProfile[name].minResolution) );
resolutionValueM->setValue( qRound(checkerProfile[name].maxResolution) );
useAnnotations->setChecked(checkerProfile[name].checkAnnotations);
rasterPDF->setChecked(checkerProfile[name].checkRasterPDF);
currentProfile = name;
194,6 → 207,7
connect(pictResolution, SIGNAL(toggled(bool)), this, SLOT(putProfile()));
connect(tranparentObjects, SIGNAL(clicked()), this, SLOT(putProfile()));
connect(resolutionValue, SIGNAL(valueChanged(int)), this, SLOT(putProfile()));
connect(resolutionValueM, SIGNAL(valueChanged(int)), this, SLOT(putProfile()));
connect(rasterPDF, SIGNAL(clicked()), this, SLOT(putProfile()));
connect(useAnnotations, SIGNAL(clicked()), this, SLOT(putProfile()));
}
210,6 → 224,7
checkerSettings.checkResolution = pictResolution->isChecked();
checkerSettings.checkTransparency = tranparentObjects->isChecked();
checkerSettings.minResolution = resolutionValue->value();
checkerSettings.maxResolution = resolutionValueM->value();
checkerSettings.checkAnnotations = useAnnotations->isChecked();
checkerSettings.checkRasterPDF = rasterPDF->isChecked();
checkerProfile.insert(tempNewProfileName, checkerSettings);
/branches/Version13x/Scribus/scribus/tabcheckdoc.h
14,6 → 14,7
#include "prefsstructs.h"
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QComboBox;
class QCheckBox;
class QGroupBox;
43,6 → 44,8
QGroupBox* pictResolution;
QLabel* textLabel1;
QSpinBox* resolutionValue;
QLabel* textLabel1m;
QSpinBox* resolutionValueM;
QPushButton* addProfile;
QPushButton* removeProfile;
CheckerPrefsList checkerProfile;
57,7 → 60,7
 
protected:
QVBoxLayout* TabCheckDocLayout;
QHBoxLayout* pictResolutionLayout;
QGridLayout* pictResolutionLayout;
QHBoxLayout* layout1;
QString tempNewProfileName;
};