Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 14736 → Rev 14737

/trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
131,11 → 131,18
 
void Prefs_PDFExport::restoreDefaults(struct ApplicationPrefs *prefsData)
{
}
 
void Prefs_PDFExport::restoreDefaults(struct ApplicationPrefs *prefsData, ScribusDoc* doc, const ProfilesL & PDFXProfiles,
const QMap<QString, int> & DocFonts)
{
m_doc=doc;
int unitIndex = prefsData->docSetupPrefs.docUnitIndex;
double unitRatio = unitGetRatioFromIndex(unitIndex);
unitChange(unitIndex);
Opts=prefsData->pdfPrefs;
defaultSolidColorRGBProfile=prefsData->colorPrefs.DCMSset.DefaultSolidColorRGBProfile;
defaultPrinterProfile=prefsData->colorPrefs.DCMSset.DefaultPrinterProfile;
exportAllPagesRadioButton->setChecked(true);
enableRangeControls(false);
rotationComboBox->setCurrentIndex(prefsData->pdfPrefs.RotateDeg / 90);
175,7 → 182,155
maxResolutionLimitCheckBox->setChecked(prefsData->pdfPrefs.RecalcPic);
maxExportResolutionSpinBox->setValue(prefsData->pdfPrefs.PicRes);
maxExportResolutionSpinBox->setEnabled(prefsData->pdfPrefs.RecalcPic);
 
/*
if (mdoc != 0 && exporting)
{
// Build a list of all Fonts used in Annotations;
PageItem *pgit;
for (int c = 0; c < doc->FrameItems.count(); ++c)
{
pgit = doc->FrameItems.at(c);
if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
}
for (int c = 0; c < doc->MasterItems.count(); ++c)
{
pgit = doc->MasterItems.at(c);
if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
}
for (int c = 0; c < doc->DocItems.count(); ++c)
{
pgit = doc->DocItems.at(c);
if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
}
QMap<QString,int>::const_iterator it;
AvailFlist->clear();
for (it = DocFonts.constBegin(); it != DocFonts.constEnd(); ++it)
{
if (AllFonts[it.key()].isReplacement())
new QListWidgetItem( QIcon(loadIcon("font_subst16.png")), it.key(), AvailFlist );
else if (AllFonts[it.key()].type() == ScFace::TYPE1)
new QListWidgetItem( QIcon(loadIcon("font_type1_16.png")), it.key(), AvailFlist );
else if (AllFonts[it.key()].type() == ScFace::TTF)
new QListWidgetItem( QIcon(loadIcon("font_truetype16.png")), it.key(), AvailFlist );
else if (AllFonts[it.key()].type() == ScFace::OTF)
new QListWidgetItem( QIcon(loadIcon("font_otf16.png")), it.key(), AvailFlist );
}
ToEmbed->setEnabled(false);
FromEmbed->setEnabled(false);
ToOutline->setEnabled(false);
FromOutline->setEnabled(false);
if ((Opts.EmbedList.count() == 0) && (Opts.SubsetList.count() == 0) && (Opts.firstUse))
EmbedAll();
else
{
EmbedList->clear();
FontsToEmbed.clear();
for (int fe = 0; fe < Opts.EmbedList.count(); ++fe)
{
EmbedList->addItem(Opts.EmbedList[fe]);
FontsToEmbed.append(Opts.EmbedList[fe]);
}
if (Opts.SubsetList.count() != 0)
{
OutlineList->clear();
FontsToOutline.clear();
for (int fe = 0; fe < Opts.SubsetList.count(); ++fe)
{
OutlineList->addItem(Opts.SubsetList[fe]);
FontsToOutline.append(Opts.SubsetList[fe]);
}
}
QMap<QString, QString>::Iterator itAnn;
for (itAnn = AnnotationFonts.begin(); itAnn != AnnotationFonts.end(); ++itAnn)
{
if (FontsToEmbed.contains(itAnn.key()) == 0)
{
EmbedList->addItem(itAnn.key());
EmbedList->item(EmbedList->count()-1)->setFlags(Qt::ItemIsEnabled);
FontsToEmbed.append(itAnn.key());
}
if (FontsToOutline.contains(itAnn.key()) != 0)
{
FontsToOutline.removeAll(itAnn.key());
QList<QListWidgetItem *> itR = OutlineList->findItems(itAnn.key(), Qt::MatchExactly);
delete OutlineList->takeItem(OutlineList->row(itR.at(0)));
}
}
}
CheckBox10->setChecked(Opts.PresentMode);
PagePrev->setChecked(false);
Pages->clear();
QString tmp;
struct PDFPresentationData ef;
if (EffVal.count() != 0)
{
for (int pg2 = 0; pg2 < doc->Pages->count(); ++pg2)
{
Pages->addItem( tr("Page")+" "+tmp.setNum(pg2+1));
if (EffVal.count()-1 < pg2)
{
ef.pageEffectDuration = 1;
ef.pageViewDuration = 1;
ef.effectType = 0;
ef.Dm = 0;
ef.M = 0;
ef.Di = 0;
EffVal.append(ef);
}
}
}
else
{
for (int pg = 0; pg < doc->Pages->count(); ++pg)
{
Pages->addItem( tr("Page")+" "+tmp.setNum(pg+1));
ef.pageEffectDuration = 1;
ef.pageViewDuration = 1;
ef.effectType = 0;
ef.Dm = 0;
ef.M = 0;
ef.Di = 0;
EffVal.append(ef);
}
}
PageTime->setValue(EffVal[0].pageViewDuration);
EffectTime->setValue(EffVal[0].pageEffectDuration);
bool df = true;
if ((Opts.displayBookmarks) || (Opts.displayFullscreen) || (Opts.displayLayers) || (Opts.displayThumbs))
df = false;
if (df)
useViewDefault->setChecked(df);
useFullScreen->setChecked(Opts.displayFullscreen);
useBookmarks->setChecked(Opts.displayBookmarks);
useThumbnails->setChecked(Opts.displayThumbs);
useLayers2->setChecked(Opts.displayLayers);
hideToolBar->setChecked(Opts.hideToolBar);
hideMenuBar->setChecked(Opts.hideMenuBar);
fitWindow->setChecked(Opts.fitWindow);
QMap<QString,QString>::Iterator itja;
actionCombo->clear();
actionCombo->addItem( tr("No Script"));
for (itja = doc->JavaScripts.begin(); itja != doc->JavaScripts.end(); ++itja)
actionCombo->addItem(itja.key());
if (doc->JavaScripts.contains(Opts.openAction))
setCurrentComboItem(actionCombo, Opts.openAction);
if (Opts.PageLayout == PDFOptions::SinglePage)
singlePage->setChecked(true);
else if (Opts.PageLayout == PDFOptions::OneColumn)
continuousPages->setChecked(true);
else if (Opts.PageLayout == PDFOptions::TwoColumnLeft)
doublePageLeft->setChecked(true);
else if (Opts.PageLayout == PDFOptions::TwoColumnRight)
doublePageRight->setChecked(true);
if ((Opts.Version == PDFOptions::PDFVersion_15) || (Opts.Version == PDFOptions::PDFVersion_X4))
useLayers2->setEnabled(true);
else
useLayers2->setEnabled(false);
}
*/
useEncryptionCheckBox->setChecked( prefsData->pdfPrefs.Encrypt );
passwordOwnerLineEdit->setText(prefsData->pdfPrefs.PassOwner);
passwordUserLineEdit->setText(prefsData->pdfPrefs.PassUser);
201,7 → 356,106
bleedsWidget->setPageHeight(prefsData->docSetupPrefs.pageHeight);
bleedsWidget->setPageSize(prefsData->docSetupPrefs.pageSize);
bleedsWidget->setMarginPreset(prefsData->docSetupPrefs.marginPreset);
//
useCustomRenderingCheckBox->setChecked(prefsData->pdfPrefs.UseLPI);
QMap<QString,LPIData>::Iterator itlp;
customRenderingColorComboBox->clear();
for (itlp = prefsData->pdfPrefs.LPISettings.begin(); itlp != prefsData->pdfPrefs.LPISettings.end(); ++itlp)
customRenderingColorComboBox->addItem( itlp.key() );
customRenderingColorComboBox->setCurrentIndex(0);
 
customRenderingFrequencySpinBox->setValue(prefsData->pdfPrefs.LPISettings[customRenderingColorComboBox->currentText()].Frequency);
customRenderingAngleSpinBox->setValue(prefsData->pdfPrefs.LPISettings[customRenderingColorComboBox->currentText()].Angle);
customRenderingSpotFunctionComboBox->setCurrentIndex(prefsData->pdfPrefs.LPISettings[customRenderingColorComboBox->currentText()].SpotFunc);
useSolidColorProfileCheckBox->setChecked(prefsData->pdfPrefs.UseProfiles);
useImageProfileCheckBox->setChecked(prefsData->pdfPrefs.UseProfiles2);
doNotUseEmbeddedImageProfileCheckBox->setChecked(prefsData->pdfPrefs.EmbeddedI);
if ((prefsData->pdfPrefs.UseRGB) || (prefsData->pdfPrefs.isGrayscale))
{
enableSolidsImagesWidgets(false);
enableProfiles(0);
}
else
enableProfiles(1);
enablePG();
enablePGI();
QString tp(prefsData->pdfPrefs.SolidProf);
if (!ScCore->InputProfiles.contains(tp))
{
/* if (m_doc != 0 && exporting)
tp = m_doc->CMSSettings.DefaultSolidColorRGBProfile;
else*/
tp = defaultSolidColorRGBProfile;
}
ProfilesL::Iterator itp;
ProfilesL::Iterator itpend=ScCore->InputProfiles.end();
solidColorProfileComboBox->clear();
for (itp = ScCore->InputProfiles.begin(); itp != itpend; ++itp)
{
solidColorProfileComboBox->addItem(itp.key());
if (itp.key() == tp)
{
if (cmsUse)
solidColorProfileComboBox->setCurrentIndex(solidColorProfileComboBox->count()-1);
}
}
if (cmsUse)
solidColorRenderingIntentComboBox->setCurrentIndex(Opts.Intent);
QString tp1 = Opts.ImageProf;
if (!ScCore->InputProfiles.contains(tp1))
{
/* if (m_doc != 0 && exporting)
tp1 = m_doc->CMSSettings.DefaultSolidColorRGBProfile;
else*/
tp1 = defaultSolidColorRGBProfile;
}
ProfilesL::Iterator itp2;
ProfilesL::Iterator itp2end=ScCore->InputProfiles.end();
imageProfileComboBox->clear();
for (itp2 = ScCore->InputProfiles.begin(); itp2 != itp2end; ++itp2)
{
imageProfileComboBox->addItem(itp2.key());
if (itp2.key() == tp1)
{
if (cmsUse)
imageProfileComboBox->setCurrentIndex(imageProfileComboBox->count()-1);
}
}
if (cmsUse)
imageRenderingIntentComboBox->setCurrentIndex(Opts.Intent2);
if (!cmsUse)
{
//Disabling vis hiding
//setSolidsImagesWidgetsShown(false);
enableSolidsImagesWidgets(false);
}
 
ProfilesL::const_iterator itp3;
QString tp3(Opts.PrintProf);
if (!PDFXProfiles.contains(tp3))
{
/* if (m_doc != 0 && exporting)
tp3 = m_doc->CMSSettings.DefaultPrinterProfile;
else*/
tp3 = defaultPrinterProfile;
}
pdfx3OutputProfileComboBox->clear();
for (itp3 = PDFXProfiles.constBegin(); itp3 != PDFXProfiles.constEnd(); ++itp3)
{
pdfx3OutputProfileComboBox->addItem(itp3.key());
if (itp3.key() == tp3)
pdfx3OutputProfileComboBox->setCurrentIndex(pdfx3OutputProfileComboBox->count()-1);
}
pdfx3InfoStringLineEdit->setText(Opts.Info);
 
 
/*
if (m_doc != 0 && exporting)
{
docBleeds->setChecked(Opts.useDocBleeds);
doDocBleeds();
}
*/
registrationMarkOffsetSpinBox->setValue(prefsData->pdfPrefs.markOffset*unitRatio);
printCropMarksCheckBox->setChecked(prefsData->pdfPrefs.cropMarks);
printBleedMarksCheckBox->setChecked(prefsData->pdfPrefs.bleedMarks);
208,7 → 462,62
printRegistrationMarksCheckBox->setChecked(prefsData->pdfPrefs.registrationMarks);
printColorBarsCheckBox->setChecked(prefsData->pdfPrefs.colorMarks);
printPageInfoCheckBox->setChecked(prefsData->pdfPrefs.docInfoMarks);
if (!cmsUse)
enablePDFXWidgets(false);
if (cmsUse && (Opts.Version == PDFOptions::PDFVersion_X1a) && (!PDFXProfiles.isEmpty()))
enablePDFX(3);
else if (cmsUse && (Opts.Version == PDFOptions::PDFVersion_X3) && (!PDFXProfiles.isEmpty()))
enablePDFX(4);
else if (cmsUse && (Opts.Version == PDFOptions::PDFVersion_X4) && (!PDFXProfiles.isEmpty()))
enablePDFX(5);
else
enablePDFXWidgets(false);
/*
if (mdoc != 0 && exporting)
{
EffectType->clear();
EffectType->addItem( tr("No Effect"));
EffectType->addItem( tr("Blinds"));
EffectType->addItem( tr("Box"));
EffectType->addItem( tr("Dissolve"));
EffectType->addItem( tr("Glitter"));
EffectType->addItem( tr("Split"));
EffectType->addItem( tr("Wipe"));
if (Opts.Version == PDFOptions::PDFVersion_15)
{
EffectType->addItem( tr("Push"));
EffectType->addItem( tr("Cover"));
EffectType->addItem( tr("Uncover"));
EffectType->addItem( tr("Fade"));
}
PgSel = 0;
Pages->setCurrentRow(0);
SetEffOpts(0);
Pages->setEnabled(false);
Effects->setEnabled(false);
PagePrev->setEnabled(false);
DoEffects();
if (CheckBox10->isChecked())
{
PageTime->setValue(EffVal[0].pageViewDuration);
EffectTime->setValue(EffVal[0].pageEffectDuration);
EffectType->setCurrentIndex(EffVal[0].effectType);
EDirection->setCurrentIndex(EffVal[0].Dm);
EDirection_2->setCurrentIndex(EffVal[0].M);
EDirection_2_2->setCurrentIndex(EffVal[0].Di);
SetEffOpts(EffectType->currentIndex());
}
if (mdoc->currentPageLayout != 0)
{
BleedTxt3->setText( tr( "Inside:" ) );
BleedTxt4->setText( tr( "Outside:" ) );
}
 
}
*/
//
 
 
}
 
 
270,7 → 579,7
if (i == 1 && pdfVersionComboBox->currentIndex() != 3)
setter = true;
 
setSolidsImagesWidgetsEnabled(setter);
enableSolidsImagesWidgets(setter);
}
 
void Prefs_PDFExport::enableLPI(int i)
321,12 → 630,14
}
if (cmsEnabled)
imageRenderingIntentComboBox->setCurrentIndex(Opts.Intent2);
setSolidsImagesWidgetsShown(cmsEnabled);
//Disabling vis hiding
//setSolidsImagesWidgetsShown(cmsEnabled);
enableSolidsImagesWidgets(cmsEnabled);
convertSpotsToProcessCheckBox->show();
if (m_doc!=0)
{
useCustomRenderingCheckBox->show();
setCustomRenderingWidgetsShown(useCustomRenderingCheckBox->isChecked());
enableCustomRenderingWidgets(useCustomRenderingCheckBox->isChecked());
}
}
else
333,7 → 644,7
{
convertSpotsToProcessCheckBox->hide();
useCustomRenderingCheckBox->hide();
setCustomRenderingWidgetsShown(false);
enableCustomRenderingWidgets(false);
}
}
 
346,18 → 657,30
customRenderingSpotFunctionComboBox->setShown(visible);
}
 
void Prefs_PDFExport::enableCustomRenderingWidgets(bool enabled)
{
useCustomRenderingCheckBox->setEnabled(enabled);
customRenderingColorComboBox->setEnabled(enabled);
customRenderingFrequencySpinBox->setEnabled(enabled);
customRenderingAngleSpinBox->setEnabled(enabled);
customRenderingSpotFunctionComboBox->setEnabled(enabled);
}
 
void Prefs_PDFExport::setSolidsImagesWidgetsShown(bool visible)
{
solidColorsLabel->setShown(visible);
solidColorsLine->setShown(visible);
useSolidColorProfileCheckBox->setShown(visible);
solidColorProfileComboBox->setShown(visible);
solidColorRenderingIntentComboBox->setShown(visible);
imagesLabel->setShown(visible);
imagesLine->setShown(visible);
useImageProfileCheckBox->setShown(visible);
doNotUseEmbeddedImageProfileCheckBox->setShown(visible);
imageProfileComboBox->setShown(visible);
imageRenderingIntentComboBox->setShown(visible);
}
void Prefs_PDFExport::setSolidsImagesWidgetsEnabled(bool enabled)
void Prefs_PDFExport::enableSolidsImagesWidgets(bool enabled)
{
useSolidColorProfileCheckBox->setEnabled(enabled);
solidColorProfileComboBox->setEnabled(enabled);
368,7 → 691,13
imageRenderingIntentComboBox->setEnabled(enabled);
}
 
void Prefs_PDFExport::enablePDFXWidgets(bool enabled)
{
pdfx3OutputProfileComboBox->setEnabled(enabled);
pdfx3InfoStringLineEdit->setEnabled(enabled);
}
 
 
void Prefs_PDFExport::enablePGI()
{
bool setter=false;
441,8 → 770,7
*/
if (i < 3) // not PDF/X
{
pdfx3OutputProfileComboBox->setEnabled(false);
pdfx3InfoStringLineEdit->setEnabled(false);
enablePDFXWidgets(false);
tabWidget->setTabEnabled(2, true);
outputIntentionComboBox->setEnabled(true);
useImageProfileCheckBox->setEnabled(true);
/trunk/Scribus/scribus/ui/prefs_pdfexport.h
23,6 → 23,8
Prefs_PDFExport(QWidget* parent=0);
~Prefs_PDFExport();
virtual void restoreDefaults(struct ApplicationPrefs *prefsData);
virtual void restoreDefaults(struct ApplicationPrefs *prefsData, ScribusDoc* doc, const ProfilesL & PDFXProfiles,
const QMap<QString, int> & DocFonts);
virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const;
 
signals:
48,10 → 50,13
protected:
void setCustomRenderingWidgetsShown(bool);
void setSolidsImagesWidgetsShown(bool);
void setSolidsImagesWidgetsEnabled(bool);
void enableCustomRenderingWidgets(bool);
void enableSolidsImagesWidgets(bool);
void enablePDFXWidgets(bool);
bool cmsEnabled;
ScribusDoc* m_doc;
QString defaultSolidColorRGBProfile;
QString defaultPrinterProfile;
PDFOptions Opts;
};
 
/trunk/Scribus/scribus/ui/prefs_pdfexportbase.ui
714,7 → 714,7
</spacer>
</item>
<item>
<widget class="QLabel" name="label_20">
<widget class="QLabel" name="solidColorsLabel">
<property name="font">
<font>
<weight>75</weight>
727,7 → 727,7
</widget>
</item>
<item>
<widget class="Line" name="line">
<widget class="Line" name="solidColorsLine">
<property name="font">
<font>
<pointsize>14</pointsize>
788,7 → 788,7
</spacer>
</item>
<item>
<widget class="QLabel" name="label_21">
<widget class="QLabel" name="imagesLabel">
<property name="font">
<font>
<weight>75</weight>
801,7 → 801,7
</widget>
</item>
<item>
<widget class="Line" name="line_11">
<widget class="Line" name="imagesLine">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
875,7 → 875,7
</widget>
</item>
<item>
<widget class="Line" name="line_12">
<widget class="Line" name="customRenderingLine">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
/trunk/Scribus/scribus/ui/preferencesdialog.cpp
125,7 → 125,8
prefs_Hyphenator->restoreDefaults(&localPrefs);
prefs_Fonts->restoreDefaults(&localPrefs);
prefs_Printer->restoreDefaults(&localPrefs);
prefs_PDFExport->restoreDefaults(&localPrefs);
QMap<QString, int> DocFonts;
prefs_PDFExport->restoreDefaults(&localPrefs, NULL, ScCore->PDFXProfiles, DocFonts);
prefs_PreflightVerifier->restoreDefaults(&localPrefs);
prefs_DocumentItemAttributes->restoreDefaults(&localPrefs);
prefs_TableOfContents->restoreDefaults(&localPrefs);