Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 1283 → Rev 1284

/branches/Version13x/Scribus/scribus/fileloader.cpp
394,7 → 394,10
doc->guidesSettings.guideRad = QStoInt(dc.attribute("GuideRad","10"));
doc->guidesSettings.grabRad = QStoInt(dc.attribute("GRAB","4"));
if (dc.hasAttribute("currentProfile"))
{
doc->checkerProfiles.clear();
doc->curCheckProfile = dc.attribute("currentProfile");
}
doc->LastAuto = 0;
QDomNode PAGE=DOC.firstChild();
counter = 0;
415,6 → 418,8
checkerSettings.checkResolution = static_cast<bool>(QStoInt(pg.attribute("checkResolution", "1")));
checkerSettings.checkTransparency = static_cast<bool>(QStoInt(pg.attribute("checkTransparency", "1")));
checkerSettings.minResolution = QStodouble(pg.attribute("minResolution","72"));
checkerSettings.checkAnnotations = static_cast<bool>(QStoInt(pg.attribute("checkAnnotations", "0")));
checkerSettings.checkRasterPDF = static_cast<bool>(QStoInt(pg.attribute("checkRasterPDF", "1")));
doc->checkerProfiles[pg.attribute("Name")] = checkerSettings;
}
// 10/25/2004 pv - None is "reserved" color. cannot be defined in any file...
/branches/Version13x/Scribus/scribus/checkDocument.cpp
219,6 → 219,8
QString missingImg = tr("Missing Image");
QString lowDPI = tr("Image has a DPI-Value less than %1 DPI").arg(qRound(doc->checkerProfiles[doc->curCheckProfile].minResolution));
QString transpar = tr("Object has transparency");
QString annot = tr("Object is a PDF-Annotation or Field");
QString rasterPDF = tr("Object is a placed PDF");
reportDisplay->clear();
reportDisplay->setSorting(-1);
itemMap.clear();
286,6 → 288,12
pageGraveError = true;
itemError = true;
break;
case 7:
object->setText(1, annot);
break;
case 8:
object->setText(1, rasterPDF);
break;
}
}
else
328,6 → 336,14
pageGraveError = true;
itemError = true;
break;
case 7:
errorText->setText(1, annot);
errorText->setPixmap( 0, onlyWarning );
break;
case 8:
errorText->setText(1, rasterPDF);
errorText->setPixmap( 0, onlyWarning );
break;
}
}
object->setOpen( true );
401,6 → 417,12
pageGraveError = true;
itemError = true;
break;
case 7:
object->setText(1, annot);
break;
case 8:
object->setText(1, rasterPDF);
break;
}
}
else
443,6 → 465,14
pageGraveError = true;
itemError = true;
break;
case 7:
errorText->setText(1, annot);
errorText->setPixmap( 0, onlyWarning );
break;
case 8:
errorText->setText(1, rasterPDF);
errorText->setPixmap( 0, onlyWarning );
break;
}
}
object->setOpen( true );
519,6 → 549,12
hasGraveError = true;
pageGraveError = true;
break;
case 7:
object->setText(1, annot);
break;
case 8:
object->setText(1, rasterPDF);
break;
}
}
else
558,6 → 594,14
hasGraveError = true;
pageGraveError = true;
break;
case 7:
errorText->setText(1, annot);
errorText->setPixmap( 0, onlyWarning );
break;
case 8:
errorText->setText(1, rasterPDF);
errorText->setPixmap( 0, onlyWarning );
break;
}
}
object->setOpen( true );
/branches/Version13x/Scribus/scribus/charselect.cpp
233,11 → 233,11
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
layout1->addItem( spacer );
 
insertButton = new QPushButton(tr( "&Insert" ), this, "insertButton" );
insertButton = new QPushButton( tr( "&Insert" ), this, "insertButton" );
layout1->addWidget( insertButton );
deleteButton = new QPushButton(tr("C&lear"), this, "deleteButton" );
deleteButton = new QPushButton( tr("C&lear"), this, "deleteButton" );
layout1->addWidget( deleteButton );
closeButton = new QPushButton(tr("&Close"), this, "closeButton" );
closeButton = new QPushButton( tr("&Close"), this, "closeButton" );
layout1->addWidget( closeButton );
zAuswahlLayout->addLayout( layout1 );
sample->setMaximumSize(width(), 52);
/branches/Version13x/Scribus/scribus/scribusXml.cpp
2593,6 → 2593,8
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("checkAnnotations", static_cast<int>(itcp.data().checkAnnotations));
dc79a.setAttribute("checkRasterPDF", static_cast<int>(itcp.data().checkRasterPDF));
dc.appendChild(dc79a);
}
QMap<QString,multiLine>::Iterator itMU;
3004,6 → 3006,8
dc79a.setAttribute("checkPictures", static_cast<int>(itcp.data().checkPictures));
dc79a.setAttribute("checkResolution", static_cast<int>(itcp.data().checkResolution));
dc79a.setAttribute("checkTransparency", static_cast<int>(itcp.data().checkTransparency));
dc79a.setAttribute("checkAnnotations", static_cast<int>(itcp.data().checkAnnotations));
dc79a.setAttribute("checkRasterPDF", static_cast<int>(itcp.data().checkRasterPDF));
dc79a.setAttribute("minResolution",itcp.data().minResolution);
elem.appendChild(dc79a);
}
3130,6 → 3134,7
return false;
Vorein->DColors.clear();
CMYKColor lf = CMYKColor();
Vorein->checkerProfiles.clear();
QDomNode DOC=elem.firstChild();
while(!DOC.isNull())
{
3347,6 → 3352,8
checkerSettings.checkResolution = static_cast<bool>(QStoInt(dc.attribute("checkResolution", "1")));
checkerSettings.checkTransparency = static_cast<bool>(QStoInt(dc.attribute("checkTransparency", "1")));
checkerSettings.minResolution = QStodouble(dc.attribute("minResolution","72"));
checkerSettings.checkAnnotations = static_cast<bool>(QStoInt(dc.attribute("checkAnnotations", "0")));
checkerSettings.checkRasterPDF = static_cast<bool>(QStoInt(dc.attribute("checkRasterPDF", "1")));
Vorein->checkerProfiles[dc.attribute("Name")] = checkerSettings;
}
if (dc.tagName()=="PRINTER")
/branches/Version13x/Scribus/scribus/scribusstructs.h
336,6 → 336,8
bool checkResolution;
double minResolution;
bool checkTransparency;
bool checkAnnotations;
bool checkRasterPDF;
};
 
struct typoPrefs
/branches/Version13x/Scribus/scribus/libabout/about.cpp
65,7 → 65,7
tabLayout1->addWidget( pixmapLabel1 );
buildID = new QLabel( tab, "BB" );
buildID->setAlignment(Qt::AlignCenter);
QString bu = tr("%1. %2 %3 ").arg("25").arg("January").arg("2005");
QString bu = tr("%1. %2 %3 ").arg("26").arg("January").arg("2005");
#ifdef HAVE_CMS
bu += "C";
#else
/branches/Version13x/Scribus/scribus/prefsdialogbase.cpp
32,11 → 32,12
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
layout4->addItem( spacer );
buttonOk = new QPushButton( this, "buttonOk" );
buttonOk->setAutoDefault( true );
buttonOk->setDefault( true );
buttonOk->setAutoDefault( false );
buttonOk->setDefault( false );
layout4->addWidget( buttonOk );
buttonCancel = new QPushButton( this, "buttonCancel" );
buttonCancel->setAutoDefault( true );
buttonCancel->setAutoDefault( false );
buttonCancel->setDefault( false );
layout4->addWidget( buttonCancel );
prefsLayout->addLayout( layout4 );
languageChange();
/branches/Version13x/Scribus/scribus/scribus.cpp
534,6 → 534,8
checkerSettings.checkPictures = true;
checkerSettings.checkResolution = true;
checkerSettings.checkTransparency = true;
checkerSettings.checkAnnotations = false;
checkerSettings.checkRasterPDF = true;
checkerSettings.minResolution = 72.0;
Prefs.checkerProfiles.insert( tr("Postscript"), checkerSettings);
Prefs.checkerProfiles.insert( tr("PDF-1.3"), checkerSettings);
540,6 → 542,7
checkerSettings.checkTransparency = false;
Prefs.checkerProfiles.insert( tr("PDF-1.4"), checkerSettings);
checkerSettings.checkTransparency = true;
checkerSettings.checkAnnotations = true;
checkerSettings.minResolution = 144.0;
Prefs.checkerProfiles.insert( tr("PDF/X-3"), checkerSettings);
Prefs.curCheckProfile = tr("Postscript");
4187,6 → 4190,30
CMSuse = cmsu;
#endif
HaveDoc++;
if (doc->checkerProfiles.count() == 0)
{
struct checkerPrefs checkerSettings;
checkerSettings.ignoreErrors = false;
checkerSettings.autoCheck = true;
checkerSettings.checkGlyphs = true;
checkerSettings.checkOrphans = true;
checkerSettings.checkOverflow = true;
checkerSettings.checkPictures = true;
checkerSettings.checkResolution = true;
checkerSettings.checkTransparency = true;
checkerSettings.checkAnnotations = false;
checkerSettings.checkRasterPDF = true;
checkerSettings.minResolution = 72.0;
doc->checkerProfiles.insert( tr("Postscript"), checkerSettings);
doc->checkerProfiles.insert( tr("PDF-1.3"), checkerSettings);
checkerSettings.checkTransparency = false;
doc->checkerProfiles.insert( tr("PDF-1.4"), checkerSettings);
checkerSettings.checkTransparency = true;
checkerSettings.checkAnnotations = true;
checkerSettings.minResolution = 144.0;
doc->checkerProfiles.insert( tr("PDF/X-3"), checkerSettings);
doc->curCheckProfile = tr("Postscript");
}
if (doc->PDF_Optionen.LPISettings.count() == 0)
{
struct LPIData lpo;
4784,15 → 4811,26
//int Nr;
//bool fil, sep, farbe, PSfile, mirrorH, mirrorV, useICC, DoGCR;
//PSfile = false;
if ((doc->checkerProfiles[doc->curCheckProfile].autoCheck) && (!doc->checkerProfiles[doc->curCheckProfile].ignoreErrors))
if (doc->checkerProfiles[doc->curCheckProfile].autoCheck)
{
scanDocument();
if ((doc->docItemErrors.count() != 0) || (doc->masterItemErrors.count() != 0))
{
docChecker->buildErrorList(doc);
docChecker->show();
scrActions["toolsPreflightVerifier"]->setOn(true);
return;
if (doc->checkerProfiles[doc->curCheckProfile].ignoreErrors)
{
int t = QMessageBox::warning(this, tr("Warning"),
tr("Detected some Errors.\nConsider using the Preflight Checker to correct them"),
tr("Abort"), tr("Ignore"), 0, 0, 0);
if (t == 0)
return;
}
else
{
docChecker->buildErrorList(doc);
docChecker->show();
scrActions["toolsPreflightVerifier"]->setOn(true);
return;
}
}
}
PrintOptions options;
7903,6 → 7941,30
move(Prefs.mainWinSettings.xPosition, Prefs.mainWinSettings.yPosition);
resize(Prefs.mainWinSettings.width, Prefs.mainWinSettings.height);
ReadPrefsXML();
if (Prefs.checkerProfiles.count() == 0)
{
struct checkerPrefs checkerSettings;
checkerSettings.ignoreErrors = false;
checkerSettings.autoCheck = true;
checkerSettings.checkGlyphs = true;
checkerSettings.checkOrphans = true;
checkerSettings.checkOverflow = true;
checkerSettings.checkPictures = true;
checkerSettings.checkResolution = true;
checkerSettings.checkTransparency = true;
checkerSettings.checkAnnotations = false;
checkerSettings.checkRasterPDF = true;
checkerSettings.minResolution = 72.0;
Prefs.checkerProfiles.insert( tr("Postscript"), checkerSettings);
Prefs.checkerProfiles.insert( tr("PDF-1.3"), checkerSettings);
checkerSettings.checkTransparency = false;
Prefs.checkerProfiles.insert( tr("PDF-1.4"), checkerSettings);
checkerSettings.checkTransparency = true;
checkerSettings.checkAnnotations = true;
checkerSettings.minResolution = 144.0;
Prefs.checkerProfiles.insert( tr("PDF/X-3"), checkerSettings);
Prefs.curCheckProfile = tr("Postscript");
}
}
 
void ScribusApp::ReadPrefsXML()
8005,15 → 8067,26
void ScribusApp::SaveAsEps()
{
QString fna;
if ((doc->checkerProfiles[doc->curCheckProfile].autoCheck) && (!doc->checkerProfiles[doc->curCheckProfile].ignoreErrors))
if (doc->checkerProfiles[doc->curCheckProfile].autoCheck)
{
scanDocument();
if ((doc->docItemErrors.count() != 0) || (doc->masterItemErrors.count() != 0))
{
docChecker->buildErrorList(doc);
docChecker->show();
scrActions["toolsPreflightVerifier"]->setOn(true);
return;
if (doc->checkerProfiles[doc->curCheckProfile].ignoreErrors)
{
int t = QMessageBox::warning(this, tr("Warning"),
tr("Detected some Errors.\nConsider using the Preflight Checker to correct them"),
tr("Abort"), tr("Ignore"), 0, 0, 0);
if (t == 0)
return;
}
else
{
docChecker->buildErrorList(doc);
docChecker->show();
scrActions["toolsPreflightVerifier"]->setOn(true);
return;
}
}
}
if (!doc->DocName.startsWith( tr("Document")))
8081,15 → 8154,26
void ScribusApp::SaveAsPDF()
{
QString fn;
if ((doc->checkerProfiles[doc->curCheckProfile].autoCheck) && (!doc->checkerProfiles[doc->curCheckProfile].ignoreErrors))
if (doc->checkerProfiles[doc->curCheckProfile].autoCheck)
{
scanDocument();
if ((doc->docItemErrors.count() != 0) || (doc->masterItemErrors.count() != 0))
{
docChecker->buildErrorList(doc);
docChecker->show();
scrActions["toolsPreflightVerifier"]->setOn(true);
return;
if (doc->checkerProfiles[doc->curCheckProfile].ignoreErrors)
{
int t = QMessageBox::warning(this, tr("Warning"),
tr("Detected some Errors.\nConsider using the Preflight Checker to correct them"),
tr("Abort"), tr("Ignore"), 0, 0, 0);
if (t == 0)
return;
}
else
{
docChecker->buildErrorList(doc);
docChecker->show();
scrActions["toolsPreflightVerifier"]->setOn(true);
return;
}
}
}
int Components = 3;
9993,6 → 10077,8
checkerSettings.checkResolution = doc->checkerProfiles[doc->curCheckProfile].checkResolution;
checkerSettings.checkTransparency = doc->checkerProfiles[doc->curCheckProfile].checkTransparency;
checkerSettings.minResolution = doc->checkerProfiles[doc->curCheckProfile].minResolution;
checkerSettings.checkAnnotations = doc->checkerProfiles[doc->curCheckProfile].checkAnnotations;
checkerSettings.checkRasterPDF = doc->checkerProfiles[doc->curCheckProfile].checkRasterPDF;
doc->docItemErrors.clear();
doc->masterItemErrors.clear();
errorCodes itemError;
10000,6 → 10086,8
{
it = doc->MasterItems.at(d);
itemError.clear();
if (((it->isAnnotation) || (it->isBookmark)) && (checkerSettings.checkAnnotations))
itemError.insert(7, 0);
if (((it->TranspStroke != 0.0) || (it->TranspStroke != 0.0)) && (checkerSettings.checkTransparency))
itemError.insert(6, 0);
if ((it->OwnPage == -1) && (checkerSettings.checkOrphans))
10013,6 → 10101,10
if ((((72.0 / it->LocalScX) < checkerSettings.minResolution) || ((72.0 / it->LocalScY) < checkerSettings.minResolution))
&& (it->isRaster) && (checkerSettings.checkResolution))
itemError.insert(5, 0);
QFileInfo fi = QFileInfo(it->Pfile);
QString ext = fi.extension(false).lower();
if ((ext == "pdf") && (checkerSettings.checkRasterPDF))
itemError.insert(8, 0);
}
}
if ((it->PType == 4) || (it->PType == 8))
10053,6 → 10145,8
itemError.clear();
if (((it->Transparency != 0.0) || (it->TranspStroke != 0.0)) && (checkerSettings.checkTransparency))
itemError.insert(6, 0);
if (((it->isAnnotation) || (it->isBookmark)) && (checkerSettings.checkAnnotations))
itemError.insert(7, 0);
if ((it->OwnPage == -1) && (checkerSettings.checkOrphans))
itemError.insert(3, 0);
if (it->PType == 2)
10064,6 → 10158,10
if ((((72.0 / it->LocalScX) < checkerSettings.minResolution) || ((72.0 / it->LocalScY) < checkerSettings.minResolution))
&& (it->isRaster) && (checkerSettings.checkResolution))
itemError.insert(5, 0);
QFileInfo fi = QFileInfo(it->Pfile);
QString ext = fi.extension(false).lower();
if ((ext == "pdf") && (checkerSettings.checkRasterPDF))
itemError.insert(8, 0);
}
}
if ((it->PType == 4) || (it->PType == 8))
/branches/Version13x/Scribus/scribus/plugins/short-words/shortwords.cpp
10,6 → 10,7
*/
 
#include "shortwords.h"
#include "shortwords.moc"
#include "version.h"
#include "vlnadialog.h"
 
92,7 → 93,7
parse->parseSelection();
break;
case 1:
parse->parsePage(ScApp->doc->currentPage);
parse->parsePage(ScApp->doc->currentPage->PageNr);
break;
case 2:
parse->parseAll();
/branches/Version13x/Scribus/scribus/plugins/short-words/parse.h
38,7 → 38,7
/** one page - using actual page */
void parsePage();
/** one page */
void parsePage(Page *page);
void parsePage(int page);
/** all pages in the document */
void parseAll();
};
/branches/Version13x/Scribus/scribus/plugins/short-words/vlnadialog.cpp
11,6 → 11,7
 
#include "version.h"
#include "vlnadialog.h"
#include "vlnadialog.moc"
#include "scribus.h"
#include "config.h"
#include "configuration.h"
/branches/Version13x/Scribus/scribus/plugins/short-words/vlnadialog.h
67,7 → 67,6
 
protected slots:
virtual void languageChange();
 
};
 
#endif // VLNADIALOG_H
/branches/Version13x/Scribus/scribus/plugins/short-words/configuration.cpp
14,6 → 14,7
 
#include "config.h"
#include "configuration.h"
#include "configuration.moc"
#include "version.h"
#include "shortwords.h"
 
/branches/Version13x/Scribus/scribus/plugins/short-words/Makefile.am
7,11 → 7,12
-DTEMPLATEDIR=\"$(datadir)/scribus/templates/\" \
-DLIBDIR=\"$(libdir)/scribus/\" \
-DPLUGINDIR=\"$(libdir)/scribus/plugins/\"
 
SUBDIRS =
 
plugins_LTLIBRARIES = libscribusshortwords.la
 
if COMPILE_DEBUG
linkflag =
else
linkflag = -s
endif
INCLUDES = $(LIBFREETYPE_CFLAGS) $(all_includes)
 
libscribusshortwords_la_LDFLAGS = -version-info 0:0:0
21,7 → 22,7
EXTRA_DIST = parse.h vlnadialog.h shortwords.h version.h configuration config.h scribus-short-words.rc
 
KDE_OPTIONS = qtonly
AM_LDFLAGS = -s $(LIBFREETYPE_LIBS)
AM_LDFLAGS = $(linkflag) $(LIBFREETYPE_LIBS)
 
install-data-local:
$(mkinstalldirs) $(libdir)/scribus/plugins/
/branches/Version13x/Scribus/scribus/plugins/short-words/parse.cpp
11,6 → 11,7
*/
 
#include "shortwords.h"
#include "parse.moc"
#include "version.h"
 
#include <scribus.h>
32,7 → 33,7
{
// the content of the frame - text itself
QString content = QString();
uint changes = 0;
int changes = 0;
// language of the frame
QString lang;
// list of the short words
103,23 → 104,31
 
void Parse::parsePage()
{
parsePage(ScApp->doc->currentPage);
parsePage(ScApp->doc->currentPage->PageNr);
}
 
void Parse::parsePage(Page *page)
void Parse::parsePage(int page)
{
/* FIXME: following line isn't page related!
The page-items relation isn't finished yet.
it's for compilation.
SEARCH SCRIPTER FOR IT TOO! */
uint cnt = ScApp->doc->Items.count();//page->Items.count();
uint cnt = 0;
for (uint a = 0; a < ScApp->doc->Items.count(); ++a)
{
PageItem* b = ScApp->doc->Items.at(a);
if (b->OwnPage == page)
cnt++;
}
ScApp->FProg->setTotalSteps(cnt);
ScApp->view->GotoPage(page->PageNr);
for (uint i=0; i<cnt; i++)
ScApp->view->GotoPage(page);
uint i = 0;
for (uint a = 0; a < ScApp->doc->Items.count(); ++a)
{
ScApp->FProg->setProgress(i);
parseItem(ScApp->doc->Items.at(i));//page->Items.at(i));
} // for items
PageItem* b = ScApp->doc->Items.at(a);
if (b->OwnPage == page)
{
i++;
ScApp->FProg->setProgress(i);
parseItem(b);
}
}
ScApp->FProg->setProgress(cnt);
}
 
126,5 → 135,5
void Parse::parseAll()
{
for (uint i=0; i < ScApp->doc->Pages.count(); i++)
parsePage(ScApp->doc->Pages.at(i));
parsePage(i);
}
/branches/Version13x/Scribus/scribus/plugins/printpreview/preview.cpp
26,6 → 26,7
#include "libpostscript/pslib.h"
#include "scraction.h"
#include "menumanager.h"
#include "checkDocument.h"
 
extern QPixmap loadIcon(QString nam);
extern void ReOrderText(ScribusDoc *doc, ScribusView *view);
382,6 → 383,33
// Recreate Postscript-File only when the actual Page has changed
if ((Seite != APage) || (EnableGCR->isChecked() != GMode))
{
if (app->doc->checkerProfiles[app->doc->curCheckProfile].autoCheck)
{
app->scanDocument();
if ((app->doc->docItemErrors.count() != 0) || (app->doc->masterItemErrors.count() != 0))
{
if (app->doc->checkerProfiles[app->doc->curCheckProfile].ignoreErrors)
{
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
int t = QMessageBox::warning(this, tr("Warning"),
tr("Detected some Errors.\nConsider using the Preflight Checker to correct them"),
tr("Abort"), tr("Ignore"), 0, 0, 0);
if (t == 0)
{
reject();
return ret;
}
}
else
{
app->docChecker->buildErrorList(app->doc);
app->docChecker->show();
app->scrActions["toolsPreflightVerifier"]->setOn(true);
reject();
return ret;
}
}
}
ReallyUsed.clear();
app->GetUsedFonts(&ReallyUsed);
PSLib *dd = app->getPSDriver(true, app->Prefs.AvailFonts, ReallyUsed, app->doc->PageColors, false);
/branches/Version13x/Scribus/scribus/tabcheckdoc.cpp
9,6 → 9,7
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qcombobox.h>
#include <qpushbutton.h>
 
TabCheckDoc::TabCheckDoc( QWidget* parent, QMap<QString, checkerPrefs> prefsData, QString prefProfile ) : QWidget( parent, "tabcheckDoc", 0 )
{
16,7 → 17,8
TabCheckDocLayout = new QVBoxLayout( this, 10, 5, "TabCheckDocLayout");
TabCheckDocLayout->setAlignment( Qt::AlignTop );
curCheckProfile = new QComboBox( true, this, "Profiles" );
curCheckProfile->setEditable(false);
curCheckProfile->setEditable(true);
curCheckProfile->setDuplicatesEnabled(false);
QMap<QString, checkerPrefs>::Iterator it;
for (it = checkerProfile.begin(); it != checkerProfile.end(); ++it)
{
62,6 → 64,22
resolutionValue->setSuffix( tr( " dpi" ) );
pictResolutionLayout->addWidget( resolutionValue );
TabCheckDocLayout->addWidget( pictResolution );
rasterPDF = new QCheckBox( this, "rasterPDF" );
rasterPDF->setText( tr( "Check for placed PDF-Files" ) );
TabCheckDocLayout->addWidget( rasterPDF );
useAnnotations = new QCheckBox( this, "useAnnotations" );
useAnnotations->setText( tr( "Check for PDF Annotations and Fields" ) );
TabCheckDocLayout->addWidget( useAnnotations );
layout1 = new QHBoxLayout( 0, 0, 5, "layout1");
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
layout1->addItem( spacer );
addProfile = new QPushButton( tr( "Add Profile" ), this, "addProfile" );
layout1->addWidget( addProfile );
removeProfile = new QPushButton( tr( "Remove Profile" ), this, "removeProfile" );
layout1->addWidget( removeProfile );
QSpacerItem* spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
layout1->addItem( spacer2 );
TabCheckDocLayout->addLayout( layout1 );
ignoreErrors->setChecked(checkerProfile[prefProfile].ignoreErrors);
automaticCheck->setChecked(checkerProfile[prefProfile].autoCheck);
missingGlyphs->setChecked(checkerProfile[prefProfile].checkGlyphs);
70,9 → 88,15
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);
resolutionValue->setValue( qRound(checkerProfile[prefProfile].minResolution) );
currentProfile = prefProfile;
if (checkerProfile.count() == 1)
removeProfile->setEnabled(false);
addProfile->setEnabled(false);
connect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&)));
connect(curCheckProfile, SIGNAL(textChanged(const QString&)), this, SLOT(setProfile(const QString&)));
connect(ignoreErrors, SIGNAL(clicked()), this, SLOT(putProfile()));
connect(automaticCheck, SIGNAL(clicked()), this, SLOT(putProfile()));
connect(missingGlyphs, SIGNAL(clicked()), this, SLOT(putProfile()));
80,25 → 104,46
connect(missingPictures, SIGNAL(clicked()), this, SLOT(putProfile()));
connect(pictResolution, SIGNAL(toggled(bool)), this, SLOT(putProfile()));
connect(tranparentObjects, SIGNAL(clicked()), this, SLOT(putProfile()));
connect(rasterPDF, SIGNAL(clicked()), this, SLOT(putProfile()));
connect(useAnnotations, SIGNAL(clicked()), this, SLOT(putProfile()));
connect(resolutionValue, SIGNAL(valueChanged(int)), this, SLOT(putProfile()));
connect(removeProfile, SIGNAL(clicked()), this, SLOT(delProf()));
connect(addProfile, SIGNAL(clicked()), this, SLOT(addProf()));
clearWState( WState_Polished );
}
 
void TabCheckDoc::putProfile()
{
checkerProfile[currentProfile].ignoreErrors = ignoreErrors->isChecked();
checkerProfile[currentProfile].autoCheck = automaticCheck->isChecked();
checkerProfile[currentProfile].checkGlyphs = missingGlyphs->isChecked();
checkerProfile[currentProfile].checkOrphans = checkOrphans->isChecked();
checkerProfile[currentProfile].checkOverflow = textOverflow->isChecked();
checkerProfile[currentProfile].checkPictures = missingPictures->isChecked();
checkerProfile[currentProfile].checkResolution = pictResolution->isChecked();
checkerProfile[currentProfile].checkTransparency = tranparentObjects->isChecked();
checkerProfile[currentProfile].minResolution = resolutionValue->value();
if (checkerProfile.contains(currentProfile))
{
checkerProfile[currentProfile].ignoreErrors = ignoreErrors->isChecked();
checkerProfile[currentProfile].autoCheck = automaticCheck->isChecked();
checkerProfile[currentProfile].checkGlyphs = missingGlyphs->isChecked();
checkerProfile[currentProfile].checkOrphans = checkOrphans->isChecked();
checkerProfile[currentProfile].checkOverflow = textOverflow->isChecked();
checkerProfile[currentProfile].checkPictures = missingPictures->isChecked();
checkerProfile[currentProfile].checkResolution = pictResolution->isChecked();
checkerProfile[currentProfile].checkTransparency = tranparentObjects->isChecked();
checkerProfile[currentProfile].minResolution = resolutionValue->value();
checkerProfile[currentProfile].checkAnnotations = useAnnotations->isChecked();
checkerProfile[currentProfile].checkRasterPDF = rasterPDF->isChecked();
}
}
 
void TabCheckDoc::setProfile(const QString& name)
{
if (checkerProfile.contains(name))
{
putProfile();
updateProfile(name);
addProfile->setEnabled(false);
}
else
addProfile->setEnabled(true);
}
 
void TabCheckDoc::updateProfile(const QString& name)
{
disconnect(ignoreErrors, SIGNAL(clicked()), this, SLOT(putProfile()));
disconnect(automaticCheck, SIGNAL(clicked()), this, SLOT(putProfile()));
disconnect(missingGlyphs, SIGNAL(clicked()), this, SLOT(putProfile()));
107,7 → 152,8
disconnect(pictResolution, SIGNAL(toggled(bool)), this, SLOT(putProfile()));
disconnect(tranparentObjects, SIGNAL(clicked()), this, SLOT(putProfile()));
disconnect(resolutionValue, SIGNAL(valueChanged(int)), this, SLOT(putProfile()));
putProfile();
disconnect(rasterPDF, SIGNAL(clicked()), this, SLOT(putProfile()));
disconnect(useAnnotations, SIGNAL(clicked()), this, SLOT(putProfile()));
ignoreErrors->setChecked(checkerProfile[name].ignoreErrors);
automaticCheck->setChecked(checkerProfile[name].autoCheck);
missingGlyphs->setChecked(checkerProfile[name].checkGlyphs);
117,6 → 163,8
missingPictures->setChecked(checkerProfile[name].checkPictures);
pictResolution->setChecked(checkerProfile[name].checkResolution);
resolutionValue->setValue( qRound(checkerProfile[name].minResolution) );
useAnnotations->setChecked(checkerProfile[name].checkAnnotations);
rasterPDF->setChecked(checkerProfile[name].checkRasterPDF);
currentProfile = name;
connect(ignoreErrors, SIGNAL(clicked()), this, SLOT(putProfile()));
connect(automaticCheck, SIGNAL(clicked()), this, SLOT(putProfile()));
126,4 → 174,46
connect(pictResolution, SIGNAL(toggled(bool)), this, SLOT(putProfile()));
connect(tranparentObjects, SIGNAL(clicked()), this, SLOT(putProfile()));
connect(resolutionValue, SIGNAL(valueChanged(int)), this, SLOT(putProfile()));
connect(rasterPDF, SIGNAL(clicked()), this, SLOT(putProfile()));
connect(useAnnotations, SIGNAL(clicked()), this, SLOT(putProfile()));
}
 
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.checkAnnotations = useAnnotations->isChecked();
checkerSettings.checkRasterPDF = rasterPDF->isChecked();
checkerProfile.insert(curCheckProfile->currentText(), checkerSettings);
currentProfile = curCheckProfile->currentText();
if (checkerProfile.count() > 1)
removeProfile->setEnabled(true);
addProfile->setEnabled(false);
}
 
void TabCheckDoc::delProf()
{
disconnect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&)));
disconnect(curCheckProfile, SIGNAL(textChanged(const QString&)), this, SLOT(setProfile(const QString&)));
checkerProfile.remove(currentProfile);
updateProfile(checkerProfile.begin().key());
QMap<QString, checkerPrefs>::Iterator it;
curCheckProfile->clear();
for (it = checkerProfile.begin(); it != checkerProfile.end(); ++it)
{
curCheckProfile->insertItem(it.key());
}
curCheckProfile->setCurrentText(currentProfile);
connect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&)));
connect(curCheckProfile, SIGNAL(textChanged(const QString&)), this, SLOT(setProfile(const QString&)));
if (checkerProfile.count() == 1)
removeProfile->setEnabled(false);
}
/branches/Version13x/Scribus/scribus/tabcheckdoc.h
12,6 → 12,7
class QGroupBox;
class QLabel;
class QSpinBox;
class QPushButton;
 
class TabCheckDoc : public QWidget
{
29,19 → 30,27
QCheckBox* textOverflow;
QCheckBox* tranparentObjects;
QCheckBox* missingPictures;
QCheckBox* useAnnotations;
QCheckBox* rasterPDF;
QGroupBox* pictResolution;
QLabel* textLabel1;
QSpinBox* resolutionValue;
QPushButton* addProfile;
QPushButton* removeProfile;
QMap<QString, checkerPrefs> checkerProfile;
QString currentProfile;
void updateProfile(const QString& name);
 
public slots:
void putProfile();
void setProfile(const QString& name);
void addProf();
void delProf();
 
protected:
QVBoxLayout* TabCheckDocLayout;
QHBoxLayout* pictResolutionLayout;
QHBoxLayout* layout1;
};
 
#endif // TABCHECKDOC_H